Package org.apache.lucene.util.automaton
Class DaciukMihovAutomatonBuilder.State
- java.lang.Object
-
- org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder.State
-
- Enclosing class:
- DaciukMihovAutomatonBuilder
private static final class DaciukMihovAutomatonBuilder.State extends java.lang.ObjectDFSA state withcharlabels on transitions.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanis_finaltrueif this state corresponds to the end of at least one input sequence.(package private) int[]labelsLabels of outgoing transitions.private static int[]NO_LABELSAn empty set of labels.private static DaciukMihovAutomatonBuilder.State[]NO_STATESAn empty set of states.(package private) DaciukMihovAutomatonBuilder.State[]statesStates reachable from outgoing transitions.
-
Constructor Summary
Constructors Modifier Constructor Description privateState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Two states are equal if: they have an identical number of outgoing transitions, labeled with the same labels corresponding outgoing transitions lead to the same states (to states with an identical right-language).(package private) DaciukMihovAutomatonBuilder.StategetState(int label)Returns the target state of a transition leaving this state and labeled withlabel.(package private) booleanhasChildren()Returntrueif this state has any children (outgoing transitions).inthashCode()Compute the hash code of the current status of this state.(package private) DaciukMihovAutomatonBuilder.StatelastChild()Return the most recent transitions's target state.(package private) DaciukMihovAutomatonBuilder.StatelastChild(int label)Return the associated state if the most recent transition is labeled withlabel.(package private) DaciukMihovAutomatonBuilder.StatenewState(int label)Create a new outgoing transition labeledlabeland return the newly created target state for this transition.private static booleanreferenceEquals(java.lang.Object[] a1, java.lang.Object[] a2)Compare two lists of objects for reference-equality.(package private) voidreplaceLastChild(DaciukMihovAutomatonBuilder.State state)Replace the last added outgoing transition's target state with the given state.
-
-
-
Field Detail
-
NO_LABELS
private static final int[] NO_LABELS
An empty set of labels.
-
NO_STATES
private static final DaciukMihovAutomatonBuilder.State[] NO_STATES
An empty set of states.
-
labels
int[] labels
Labels of outgoing transitions. Indexed identically tostates. Labels must be sorted lexicographically.
-
states
DaciukMihovAutomatonBuilder.State[] states
States reachable from outgoing transitions. Indexed identically tolabels.
-
is_final
boolean is_final
trueif this state corresponds to the end of at least one input sequence.
-
-
Method Detail
-
getState
DaciukMihovAutomatonBuilder.State getState(int label)
Returns the target state of a transition leaving this state and labeled withlabel. If no such transition exists, returnsnull.
-
equals
public boolean equals(java.lang.Object obj)
Two states are equal if:- they have an identical number of outgoing transitions, labeled with the same labels
- corresponding outgoing transitions lead to the same states (to states with an identical right-language).
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Compute the hash code of the current status of this state.- Overrides:
hashCodein classjava.lang.Object
-
hasChildren
boolean hasChildren()
Returntrueif this state has any children (outgoing transitions).
-
newState
DaciukMihovAutomatonBuilder.State newState(int label)
Create a new outgoing transition labeledlabeland return the newly created target state for this transition.
-
lastChild
DaciukMihovAutomatonBuilder.State lastChild()
Return the most recent transitions's target state.
-
lastChild
DaciukMihovAutomatonBuilder.State lastChild(int label)
Return the associated state if the most recent transition is labeled withlabel.
-
replaceLastChild
void replaceLastChild(DaciukMihovAutomatonBuilder.State state)
Replace the last added outgoing transition's target state with the given state.
-
referenceEquals
private static boolean referenceEquals(java.lang.Object[] a1, java.lang.Object[] a2)Compare two lists of objects for reference-equality.
-
-