V
- public interface ValueContainer<V>
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(int[] ngram,
int startPos,
int endPos,
int ngramOrder,
long offset,
long contextOffset,
int word,
V val,
long suffixOffset,
boolean ngramIsNew)
Adds a new value at the specified offset.
|
void |
clearStorageForOrder(int ngramOrder) |
ValueContainer<V> |
createFreshValues(long[] numNgramsForEachOrder)
Creates a fresh value container for copying purposes.
|
void |
getFromOffset(long offset,
int ngramOrder,
V outputVal)
Gets the value living at a particular offset.
|
V |
getScratchValue()
Creates a fresh value of object (useful for passing as an output
parameter)
|
int |
numValueBits(int ngramOrder) |
void |
setFromOtherValues(ValueContainer<V> other)
Destructively sets internal storage from another object.
|
void |
setMap(NgramMap<V> map)
Initializes a value container with the map that contains it
|
void |
setSizeAtLeast(long size,
int ngramOrder)
Sets internal storage for size for a particular n-gram order
|
boolean |
storeSuffixoffsets() |
void |
trim()
Final clean up of storage.
|
void |
trimAfterNgram(int ngramOrder,
long size)
Clear storage after an n-gram order is complete
|
boolean add(int[] ngram, int startPos, int endPos, int ngramOrder, long offset, long contextOffset, int word, V val, long suffixOffset, boolean ngramIsNew)
ngramOrder
- As always, ngramOrder is 0-based (0=unigram)offset
- contextOffset
- word
- val
- suffixOffset
- void setSizeAtLeast(long size, int ngramOrder)
size
- ngramOrder
- ValueContainer<V> createFreshValues(long[] numNgramsForEachOrder)
void getFromOffset(long offset, int ngramOrder, V outputVal)
offset
- ngramOrder
- void setFromOtherValues(ValueContainer<V> other)
other
- void trimAfterNgram(int ngramOrder, long size)
ngramOrder
- size
- void trim()
V getScratchValue()
void clearStorageForOrder(int ngramOrder)
boolean storeSuffixoffsets()
int numValueBits(int ngramOrder)