abstract class FSTEnum<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected FST.Arc<T>[] |
arcs |
protected FST<T> |
fst |
protected FST.BytesReader |
fstReader |
protected T |
NO_OUTPUT |
protected T[] |
output |
protected FST.Arc<T> |
scratchArc |
(package private) int |
targetLength |
protected int |
upto |
Constructor and Description |
---|
FSTEnum(FST<T> fst)
doFloor controls the behavior of advance: if it's true
doFloor is true, advance positions to the biggest
term before target.
|
Modifier and Type | Method and Description |
---|---|
private FST.Arc<T> |
backtrackToFloorArc(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in)
Backtracks until it finds a node which first arc is before our target label.`
Then on the node, finds the arc just before the targetLabel.
|
protected void |
doNext() |
protected void |
doSeekCeil()
Seeks to smallest term that's >= target.
|
private FST.Arc<T> |
doSeekCeilArrayDirectAddressing(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in) |
private FST.Arc<T> |
doSeekCeilArrayPacked(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in) |
private FST.Arc<T> |
doSeekCeilList(FST.Arc<T> arc,
int targetLabel) |
(package private) boolean |
doSeekExact()
Seeks to exactly target term.
|
(package private) void |
doSeekFloor()
Seeks to largest term that's <= target.
|
private FST.Arc<T> |
doSeekFloorArrayDirectAddressing(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in) |
private FST.Arc<T> |
doSeekFloorArrayPacked(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in) |
private FST.Arc<T> |
doSeekFloorList(FST.Arc<T> arc,
int targetLabel) |
private void |
findNextFloorArcBinarySearch(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in)
Same as
findNextFloorArcDirectAddressing(org.apache.lucene.util.fst.FST.Arc<T>, int, org.apache.lucene.util.fst.FST.BytesReader) for binary search node. |
private void |
findNextFloorArcDirectAddressing(FST.Arc<T> arc,
int targetLabel,
FST.BytesReader in)
Finds and reads an arc on the current node which label is strictly less than the given label.
|
private FST.Arc<T> |
getArc(int idx) |
protected abstract int |
getCurrentLabel() |
protected abstract int |
getTargetLabel() |
protected abstract void |
grow() |
private void |
incr() |
private void |
pushFirst() |
private void |
pushLast() |
private void |
rewindPrefix()
Rewinds enum state to match the shared prefix between
current term and target term
|
protected abstract void |
setCurrentLabel(int label) |
protected T[] output
protected final T NO_OUTPUT
protected final FST.BytesReader fstReader
protected int upto
int targetLength
protected abstract int getTargetLabel()
protected abstract int getCurrentLabel()
protected abstract void setCurrentLabel(int label)
protected abstract void grow()
private void rewindPrefix() throws java.io.IOException
java.io.IOException
protected void doNext() throws java.io.IOException
java.io.IOException
protected void doSeekCeil() throws java.io.IOException
java.io.IOException
private FST.Arc<T> doSeekCeilArrayDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
java.io.IOException
private FST.Arc<T> doSeekCeilArrayPacked(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
java.io.IOException
private FST.Arc<T> doSeekCeilList(FST.Arc<T> arc, int targetLabel) throws java.io.IOException
java.io.IOException
void doSeekFloor() throws java.io.IOException
java.io.IOException
private FST.Arc<T> doSeekFloorArrayDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
java.io.IOException
private FST.Arc<T> backtrackToFloorArc(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
java.io.IOException
private void findNextFloorArcDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
Precondition: the given arc is the first arc of the node.
java.io.IOException
private void findNextFloorArcBinarySearch(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
findNextFloorArcDirectAddressing(org.apache.lucene.util.fst.FST.Arc<T>, int, org.apache.lucene.util.fst.FST.BytesReader)
for binary search node.java.io.IOException
private FST.Arc<T> doSeekFloorArrayPacked(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws java.io.IOException
java.io.IOException
private FST.Arc<T> doSeekFloorList(FST.Arc<T> arc, int targetLabel) throws java.io.IOException
java.io.IOException
boolean doSeekExact() throws java.io.IOException
java.io.IOException
private void incr()
private void pushFirst() throws java.io.IOException
java.io.IOException
private void pushLast() throws java.io.IOException
java.io.IOException