Class BinaryDictionary
java.lang.Object
dev.hardwood.reader.BinaryDictionary
- All Implemented Interfaces:
ColumnDictionary
The dictionary of a BYTE_ARRAY, FIXED_LEN_BYTE_ARRAY or INT96 column chunk, from
ColumnReader.getBinaryDictionary(). Its entries never change, and it may be read from any
thread. Every batch drawn from the same dictionary returns the same instance, so comparing
it with the previous batch's (!=) tells when the dictionary changed.
This API is Experimental: it may change in future releases without prior
deprecation.
-
Method Summary
-
Method Details
-
size
public int size()Description copied from interface:ColumnDictionaryThe number of entries; entry ids run from0tosize() - 1.- Specified by:
sizein interfaceColumnDictionary
-
getBinary
public byte[] getBinary(int entry) A copy of entryentry.- Throws:
IndexOutOfBoundsException- ifentryis not in[0, size())
-
getString
Entryentrydecoded as UTF-8. The result is cached for later calls, but compare it withequals: calls from several threads may each decode the entry and return distinct, equal strings. The column has to hold text, as forColumnReader.getStrings().- Throws:
IllegalArgumentException- if the column does not hold textIndexOutOfBoundsException- ifentryis not in[0, size())
-