public class StringHashTableDictionary extends Object implements Dictionary
This implementation is not thread-safe.
Dictionary.IMPL, Dictionary.Visitor, Dictionary.VisitorContextINITIAL_DICTIONARY_SIZE| Constructor and Description |
|---|
StringHashTableDictionary(int initialCapacity) |
StringHashTableDictionary(int initialCapacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(byte[] bytes,
int offset,
int length) |
int |
add(Text text) |
void |
clear() |
long |
getSizeInBytes() |
ByteBuffer |
getText(int positionInKeyOffset) |
void |
getText(Text result,
int positionInKeyOffset)
Given the position index, return the original string before being encoded.
|
int |
size() |
void |
visit(Dictionary.Visitor visitor)
Traverse the whole dictionary and apply the action.
|
int |
writeTo(OutputStream out,
int position)
Given the position index, write the original string, before being encoded,
to the OutputStream.
|
public StringHashTableDictionary(int initialCapacity)
public StringHashTableDictionary(int initialCapacity,
float loadFactor)
public void visit(Dictionary.Visitor visitor) throws IOException
Dictionaryvisit in interface DictionaryIOExceptionpublic void clear()
clear in interface Dictionarypublic void getText(Text result, int positionInKeyOffset)
Dictionaryresult.getText in interface Dictionaryresult - the holder to copy the dictionary text intopositionInKeyOffset - the position where the key was addedpublic ByteBuffer getText(int positionInKeyOffset)
getText in interface Dictionarypublic int writeTo(OutputStream out, int position) throws IOException
DictionarywriteTo in interface Dictionaryout - the output stream to which to write the dataposition - the position where the key was originally addedIOException - if an I/O error occurspublic int add(Text text)
public int add(byte[] bytes,
int offset,
int length)
add in interface Dictionarypublic int size()
size in interface Dictionarypublic long getSizeInBytes()
getSizeInBytes in interface DictionaryCopyright © 2013–2023 The Apache Software Foundation. All rights reserved.