Class BytesRefHash

BytesRefHash is a special purpose hash-map like data-structure
optimized for BytesRef instances. BytesRefHash maintains mappings of
byte arrays to ordinal (Map) storing the hashed bytes
efficiently in continuous storage. The mapping to the ordinal is
encapsulated inside BytesRefHash and is guaranteed to be increased
for each added BytesRef.

close

add

the ord the given bytes are hashed if there was no mapping for the
given bytes, otherwise (-(ord)-1). This guarantees
that the return value will always be >= 0 if the given bytes
haven't been hashed before.

the ord the given bytes are hashed if there was no mapping for the
given bytes, otherwise (-(ord)-1). This guarantees
that the return value will always be >= 0 if the given bytes
haven't been hashed before.