java.lang.Object
org.apache.lucene.util.fst.FSTEnum<T>
- Direct Known Subclasses:
BytesRefFSTEnum
,IntsRefFSTEnum
Can next() and advance() through the terms in an FST
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbacktrackToFloorArc
(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
Seeks to smallest term that's >= target.doSeekCeilArrayContinuous
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekCeilArrayDirectAddressing
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekCeilArrayPacked
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekCeilList
(FST.Arc<T> arc, int targetLabel) (package private) boolean
Seeks to exactly target term.(package private) void
Seeks to largest term that's <= target.doSeekFloorArrayDirectAddressing
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekFloorArrayPacked
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekFloorContinuous
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) doSeekFloorList
(FST.Arc<T> arc, int targetLabel) private void
findNextFloorArcBinarySearch
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) Same asfindNextFloorArcDirectAddressing(org.apache.lucene.util.fst.FST.Arc<T>, int, org.apache.lucene.util.fst.FST.BytesReader)
for binary search node.private void
findNextFloorArcContinuous
(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) 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.getArc
(int idx) protected abstract int
protected abstract int
protected abstract void
grow()
private void
incr()
private void
private void
pushLast()
private void
Rewinds enum state to match the shared prefix between current term and target termprivate void
Target is beyond the last arc, out of label range.protected abstract void
setCurrentLabel
(int label)
-
Field Details
-
fst
-
arcs
-
output
-
NO_OUTPUT
-
fstReader
-
upto
protected int upto -
targetLength
int targetLength
-
-
Constructor Details
-
FSTEnum
doFloor controls the behavior of advance: if it's true doFloor is true, advance positions to the biggest term before target.
-
-
Method Details
-
getTargetLabel
protected abstract int getTargetLabel() -
getCurrentLabel
protected abstract int getCurrentLabel() -
setCurrentLabel
protected abstract void setCurrentLabel(int label) -
grow
protected abstract void grow() -
rewindPrefix
Rewinds enum state to match the shared prefix between current term and target term- Throws:
IOException
-
doNext
- Throws:
IOException
-
doSeekCeil
Seeks to smallest term that's >= target.- Throws:
IOException
-
doSeekCeilArrayContinuous
private FST.Arc<T> doSeekCeilArrayContinuous(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
doSeekCeilArrayDirectAddressing
private FST.Arc<T> doSeekCeilArrayDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
doSeekCeilArrayPacked
private FST.Arc<T> doSeekCeilArrayPacked(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
doSeekCeilList
- Throws:
IOException
-
doSeekFloor
Seeks to largest term that's <= target.- Throws:
IOException
-
doSeekFloorContinuous
private FST.Arc<T> doSeekFloorContinuous(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
doSeekFloorArrayDirectAddressing
private FST.Arc<T> doSeekFloorArrayDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
rollbackToLastForkThenPush
Target is beyond the last arc, out of label range. Dead end (target is after the last arc); rollback to last fork then push- Throws:
IOException
-
backtrackToFloorArc
private FST.Arc<T> backtrackToFloorArc(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException 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.- Returns:
- null to continue the seek floor recursion loop.
- Throws:
IOException
-
findNextFloorArcDirectAddressing
private void findNextFloorArcDirectAddressing(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException Finds and reads an arc on the current node which label is strictly less than the given label. Skips the first arc, finds next floor arc; or none if the floor arc is the first arc itself (in this case it has already been read).Precondition: the given arc is the first arc of the node.
- Throws:
IOException
-
findNextFloorArcContinuous
private void findNextFloorArcContinuous(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException Same asfindNextFloorArcDirectAddressing(org.apache.lucene.util.fst.FST.Arc<T>, int, org.apache.lucene.util.fst.FST.BytesReader)
for continuous node.- Throws:
IOException
-
findNextFloorArcBinarySearch
private void findNextFloorArcBinarySearch(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException Same asfindNextFloorArcDirectAddressing(org.apache.lucene.util.fst.FST.Arc<T>, int, org.apache.lucene.util.fst.FST.BytesReader)
for binary search node.- Throws:
IOException
-
doSeekFloorArrayPacked
private FST.Arc<T> doSeekFloorArrayPacked(FST.Arc<T> arc, int targetLabel, FST.BytesReader in) throws IOException - Throws:
IOException
-
doSeekFloorList
- Throws:
IOException
-
doSeekExact
Seeks to exactly target term.- Throws:
IOException
-
incr
private void incr() -
pushFirst
- Throws:
IOException
-
pushLast
- Throws:
IOException
-
getArc
-