Package org.apache.lucene.util.automaton
Class CompiledAutomaton
- java.lang.Object
-
- org.apache.lucene.util.automaton.CompiledAutomaton
-
public class CompiledAutomaton extends java.lang.ObjectImmutable 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 classCompiledAutomaton.AUTOMATON_TYPEAutomata 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 BytesRefcommonSuffixRefShared common suffix accepted by the automaton.java.lang.BooleanfiniteIndicates if the automaton accepts a finite set of strings.ByteRunAutomatonrunAutomatonMatcher for quickly determining if a byte[] is accepted.Transition[][]sortedTransitionsTwo dimensional array of transitions, indexed by state number for traversal.BytesReftermForCompiledAutomaton.AUTOMATON_TYPE.PREFIX, this is the prefix term; forCompiledAutomaton.AUTOMATON_TYPE.SINGLEthis is the singleton term.CompiledAutomaton.AUTOMATON_TYPEtype
-
Constructor Summary
Constructors Constructor Description CompiledAutomaton(Automaton automaton)CompiledAutomaton(Automaton automaton, java.lang.Boolean finite, boolean simplify)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)BytesReffloor(BytesRef input, BytesRef output)Finds largest term accepted by this Automaton, that's <= the provided input term.TermsEnumgetTermsEnum(Terms terms)inthashCode()java.lang.StringtoDot()
-
-
-
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.SINGLEthis 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 java.lang.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 java.io.IOException
- Throws:
java.io.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 java.lang.String toDot()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-