protected class IntersectBlockReader.AutomatonNextTermCalculator extends Object
Modifier and Type | Field and Description |
---|---|
protected short |
curGen |
protected boolean |
linear |
protected BytesRef |
linearUpperBound |
protected IntsRefBuilder |
savedStates |
protected BytesRefBuilder |
seekBytesRef |
protected Transition |
transition |
protected short[] |
visited |
Modifier | Constructor and Description |
---|---|
protected |
AutomatonNextTermCalculator(CompiledAutomaton compiled) |
Modifier and Type | Method and Description |
---|---|
protected int |
backtrack(int position)
Attempts to backtrack thru the string after encountering a dead end
at some given position.
|
protected boolean |
isLinearState(BytesRef term)
True if the current state of the automata is best iterated linearly (without seeking).
|
protected boolean |
isVisited(int state)
Indicates whether the given state has been visited.
|
protected BytesRef |
nextSeekTerm(BytesRef term) |
protected boolean |
nextString()
Increments the byte buffer to the next String in binary order after s that will not put
the machine into a reject state.
|
protected boolean |
nextString(int state,
int position)
Returns the next String in lexicographic order that will not put
the machine into a reject state.
|
protected void |
setLinear(int position)
Sets the enum to operate in linear fashion, as we have found
a looping transition at position: we set an upper bound and
act like a TermRangeQuery for this portion of the term space.
|
protected void |
setVisited(int state)
Records the given state has been visited.
|
protected final short[] visited
protected short curGen
protected final BytesRefBuilder seekBytesRef
protected boolean linear
protected final BytesRef linearUpperBound
protected final Transition transition
protected final IntsRefBuilder savedStates
protected AutomatonNextTermCalculator(CompiledAutomaton compiled)
protected void setVisited(int state)
protected boolean isVisited(int state)
protected boolean isLinearState(BytesRef term)
protected BytesRef nextSeekTerm(BytesRef term)
FilteredTermsEnum.nextSeekTerm(BytesRef)
protected void setLinear(int position)
protected boolean nextString()
The correctness of this method depends upon the automaton being deterministic, and having no transitions to dead states.
protected boolean nextString(int state, int position)
This method traverses the DFA from the given position in the String, starting at the given state.
If this cannot satisfy the machine, returns false. This method will walk the minimal path, in lexicographic order, as long as possible.
If this method returns false, then there might still be more solutions, it is necessary to backtrack to find out.
state
- current non-reject stateposition
- useful portion of the stringprotected int backtrack(int position)
position
- current position in the input Stringposition >= 0
if more possible solutions exist for the DFACopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.