Package org.apache.lucene.util.automaton
Class CompiledAutomaton
- java.lang.Object
-
- org.apache.lucene.util.automaton.CompiledAutomaton
-
public class CompiledAutomaton extends Object
Immutable class holding compiled details for a given Automaton. The Automaton is deterministic, must not have dead states but is not necessarily minimal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompiledAutomaton.AUTOMATON_TYPE
Automata are compiled into different internal forms for the most efficient execution depending upon the language they accept.
-
Field Summary
Fields Modifier and Type Field Description BytesRef
commonSuffixRef
Shared common suffix accepted by the automaton.Boolean
finite
Indicates if the automaton accepts a finite set of strings.ByteRunAutomaton
runAutomaton
Matcher for quickly determining if a byte[] is accepted.Transition[][]
sortedTransitions
Two dimensional array of transitions, indexed by state number for traversal.BytesRef
term
ForCompiledAutomaton.AUTOMATON_TYPE.PREFIX
, this is the prefix term; forCompiledAutomaton.AUTOMATON_TYPE.SINGLE
this is the singleton term.CompiledAutomaton.AUTOMATON_TYPE
type
-
Constructor Summary
Constructors Constructor Description CompiledAutomaton(Automaton automaton)
CompiledAutomaton(Automaton automaton, Boolean finite, boolean simplify)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
BytesRef
floor(BytesRef input, BytesRef output)
Finds largest term accepted by this Automaton, that's <= the provided input term.TermsEnum
getTermsEnum(Terms terms)
int
hashCode()
String
toDot()
-
-
-
Field Detail
-
type
public final CompiledAutomaton.AUTOMATON_TYPE type
-
term
public final BytesRef term
ForCompiledAutomaton.AUTOMATON_TYPE.PREFIX
, this is the prefix term; forCompiledAutomaton.AUTOMATON_TYPE.SINGLE
this is the singleton term.
-
runAutomaton
public final ByteRunAutomaton runAutomaton
Matcher for quickly determining if a byte[] is accepted. only valid forCompiledAutomaton.AUTOMATON_TYPE.NORMAL
.
-
sortedTransitions
public final Transition[][] sortedTransitions
Two dimensional array of transitions, indexed by state number for traversal. The state numbering is consistent withrunAutomaton
. Only valid forCompiledAutomaton.AUTOMATON_TYPE.NORMAL
.
-
commonSuffixRef
public final BytesRef commonSuffixRef
Shared common suffix accepted by the automaton. Only valid forCompiledAutomaton.AUTOMATON_TYPE.NORMAL
, and only when the automaton accepts an infinite language.
-
finite
public final Boolean finite
Indicates if the automaton accepts a finite set of strings. Null if this was not computed. Only valid forCompiledAutomaton.AUTOMATON_TYPE.NORMAL
.
-
-
Method Detail
-
getTermsEnum
public TermsEnum getTermsEnum(Terms terms) throws IOException
- Throws:
IOException
-
floor
public BytesRef floor(BytesRef input, BytesRef output)
Finds largest term accepted by this Automaton, that's <= the provided input term. The result is placed in output; it's fine for output and input to point to the same BytesRef. The returned result is either the provided output, or null if there is no floor term (ie, the provided input term is before the first term accepted by this Automaton).
-
toDot
public String toDot()
-
-