Package org.apache.lucene.util.automaton
Class Transition
- java.lang.Object
-
- org.apache.lucene.util.automaton.Transition
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Transition extends java.lang.Object implements java.lang.Cloneable
Automaton transition.A transition, which belongs to a source state, consists of a Unicode codepoint interval and a destination state.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Transition>
CompareByDestThenMinMax
static java.util.Comparator<Transition>
CompareByMinMaxThenDest
-
Constructor Summary
Constructors Constructor Description Transition(int min, int max, State to)
Constructs a new transition.Transition(int c, State to)
Constructs a new singleton interval transition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transition
clone()
Clones this transition.boolean
equals(java.lang.Object obj)
Checks for equality.State
getDest()
Returns destination of this transition.int
getMax()
Returns maximum of this transition interval.int
getMin()
Returns minimum of this transition interval.int
hashCode()
Returns hash code.java.lang.String
toString()
Returns a string describing this state.
-
-
-
Field Detail
-
CompareByDestThenMinMax
public static final java.util.Comparator<Transition> CompareByDestThenMinMax
-
CompareByMinMaxThenDest
public static final java.util.Comparator<Transition> CompareByMinMaxThenDest
-
-
Constructor Detail
-
Transition
public Transition(int c, State to)
Constructs a new singleton interval transition.- Parameters:
c
- transition codepointto
- destination state
-
Transition
public Transition(int min, int max, State to)
Constructs a new transition. Both end points are included in the interval.- Parameters:
min
- transition interval minimummax
- transition interval maximumto
- destination state
-
-
Method Detail
-
getMin
public int getMin()
Returns minimum of this transition interval.
-
getMax
public int getMax()
Returns maximum of this transition interval.
-
getDest
public State getDest()
Returns destination of this transition.
-
equals
public boolean equals(java.lang.Object obj)
Checks for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- object to compare with- Returns:
- true if obj is a transition with same character interval and destination state as this transition.
-
hashCode
public int hashCode()
Returns hash code. The hash code is based on the character interval (not the destination state).- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hash code
-
clone
public Transition clone()
Clones this transition.- Returns:
- clone with same character interval and destination state
-
toString
public java.lang.String toString()
Returns a string describing this state. Normally invoked viaAutomaton.toString()
.- Overrides:
toString
in classjava.lang.Object
-
-