public int exactMatchSearch ( byte [ ] key ) { int unit = _array [ 0 ] ; int nodePos = 0 ; for ( byte b : key ) { // nodePos ^= unit.offset() ^ b nodePos ^= ( ( unit >>> 10 ) << ( ( unit & ( 1 << 9 ) ) >>> 6 ) ) ^ ( b & 0xFF ) ; unit = _array [ nodePos ] ; // if (unit.label() != b) if ( ( unit & ( ( 1 << 31 ) | 0xFF ) ) != ( b & 0xff ) ) { return - 1 ; } } // if (!unit.has_leaf()) { if ( ( ( unit >>> 8 ) & 1 ) != 1 ) { return - 1 ; } // unit = _array[nodePos ^ unit.offset()]; unit = _array [ nodePos ^ ( ( unit >>> 10 ) << ( ( unit & ( 1 << 9 ) ) >>> 6 ) ) ] ; // return unit.value(); return unit & ( ( 1 << 31 ) - 1 ) ; }
Returns the corresponding value if the key is found . Otherwise returns - 1 .