Package dk.brics.automaton
Class Transition
- java.lang.Object
-
- dk.brics.automaton.Transition
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Transition extends java.lang.Object implements java.io.Serializable, java.lang.CloneableAutomatontransition.A transition, which belongs to a source state, consists of a Unicode character interval and a destination state.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) charmax(package private) charmin(package private) static longserialVersionUID(package private) Stateto
-
Constructor Summary
Constructors Constructor Description Transition(char min, char max, State to)Constructs a new transition.Transition(char c, State to)Constructs a new singleton interval transition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static voidappendCharString(char c, java.lang.StringBuilder b)(package private) voidappendDot(java.lang.StringBuilder b)Transitionclone()Clones this transition.booleanequals(java.lang.Object obj)Checks for equality.StategetDest()Returns destination of this transition.chargetMax()Returns maximum of this transition interval.chargetMin()Returns minimum of this transition interval.inthashCode()Returns hash code.java.lang.StringtoString()Returns a string describing this state.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
min
char min
-
max
char max
-
to
State to
-
-
Constructor Detail
-
Transition
public Transition(char c, State to)Constructs a new singleton interval transition.- Parameters:
c- transition characterto- destination state
-
Transition
public Transition(char min, char 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 char getMin()
Returns minimum of this transition interval.
-
getMax
public char 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:
equalsin classjava.lang.Object- Parameters:
obj- object to compare with- Returns:
- true if
objis 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:
hashCodein classjava.lang.Object- Returns:
- hash code
-
clone
public Transition clone()
Clones this transition.- Overrides:
clonein classjava.lang.Object- Returns:
- clone with same character interval and destination state
-
appendCharString
static void appendCharString(char c, java.lang.StringBuilder b)
-
toString
public java.lang.String toString()
Returns a string describing this state. Normally invoked viaAutomaton.toString().- Overrides:
toStringin classjava.lang.Object
-
appendDot
void appendDot(java.lang.StringBuilder b)
-
-