protected int getCenterChild(CacheDataSet cache) {
        if (cache.count() == 0)
            return -1;

        int id = cache.getId(0);
        switch (getGravityInternal()) {
            case TOP:
            case LEFT:
            case FRONT:
            case FILL:
                break;
            case BOTTOM:
            case RIGHT:
            case BACK:
                id = cache.getId(cache.count() - 1);
                break;
            case CENTER:
                int i = cache.count() / 2;
                while (i < cache.count() && i >= 0) {
                    id =  cache.getId(i);
                    if (cache.getStartDataOffset(id) <= 0) {
                        if (cache.getEndDataOffset(id) >= 0) {
                            break;
                        } else {
                            i++;
                        }
                    } else {
                        i--;
                    }
                }
                break;
            default:
                break;
        }

        Log.d(LAYOUT, TAG, "getCenterChild = %d ", id);
        return id;
    }
protected int getCenterChild ( CacheDataSet cache ) { if ( cache . count ( ) == 0 ) return - 1 ; int id = cache . getId ( 0 ) ; switch ( getGravityInternal ( ) ) { case TOP : case LEFT : case FRONT : case FILL : break ; case BOTTOM : case RIGHT : case BACK : id = cache . getId ( cache . count ( ) - 1 ) ; break ; case CENTER : int i = cache . count ( ) / 2 ; while ( i < cache . count ( ) && i >= 0 ) { id = cache . getId ( i ) ; if ( cache . getStartDataOffset ( id ) <= 0 ) { if ( cache . getEndDataOffset ( id ) >= 0 ) { break ; } else { i ++ ; } } else { i -- ; } } break ; default : break ; } Log . d ( LAYOUT , TAG , "getCenterChild = %d " , id ) ; return id ; }
>>>>>> measureUntilFull helper methods