int getTertiaryBefore(long p, int s, int t) {
        assert((t & ~Collation.ONLY_TERTIARY_MASK) == 0);
        int index;
        int previousTer;
        long secTer;
        if(p == 0) {
            if(s == 0) {
                index = (int)elements[IX_FIRST_TERTIARY_INDEX];
                // Gap at the beginning of the tertiary CE range.
                previousTer = 0;
            } else {
                index = (int)elements[IX_FIRST_SECONDARY_INDEX];
                previousTer = Collation.BEFORE_WEIGHT16;
            }
            secTer = elements[index] & ~SEC_TER_DELTA_FLAG;
        } else {
            index = findPrimary(p) + 1;
            previousTer = Collation.BEFORE_WEIGHT16;
            secTer = getFirstSecTerForPrimary(index);
        }
        long st = ((long)s << 16) | t;
        while(st > secTer) {
            if((int)(secTer >> 16) == s) { previousTer = (int)secTer; }
            assert((elements[index] & SEC_TER_DELTA_FLAG) != 0);
            secTer = elements[index++] & ~SEC_TER_DELTA_FLAG;
        }
        assert(secTer == st);
        return previousTer & 0xffff;
    }
int getTertiaryBefore ( long p , int s , int t ) { assert ( ( t & ~ Collation . ONLY_TERTIARY_MASK ) == 0 ) ; int index ; int previousTer ; long secTer ; if ( p == 0 ) { if ( s == 0 ) { index = ( int ) elements [ IX_FIRST_TERTIARY_INDEX ] ; previousTer = 0 ; } else { index = ( int ) elements [ IX_FIRST_SECONDARY_INDEX ] ; previousTer = Collation . BEFORE_WEIGHT16 ; } secTer = elements [ index ] & ~ SEC_TER_DELTA_FLAG ; } else { index = findPrimary ( p ) + 1 ; previousTer = Collation . BEFORE_WEIGHT16 ; secTer = getFirstSecTerForPrimary ( index ) ; } long st = ( ( long ) s << 16 ) | t ; while ( st > secTer ) { if ( ( int ) ( secTer > > 16 ) == s ) { previousTer = ( int ) secTer ; } assert ( ( elements [ index ] & SEC_TER_DELTA_FLAG ) != 0 ) ; secTer = elements [ index ++ ] & ~ SEC_TER_DELTA_FLAG ; } assert ( secTer == st ) ; return previousTer & 0xffff ; }
Returns the tertiary weight before [p, s, t].