org.jscience.computing.automaton
Class Transition

java.lang.Object
  extended by org.jscience.computing.automaton.Transition
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Transition
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Automaton transition.

A transition, which belongs to a source state, consists of a Unicode character interval and a destination state.

See Also:
Serialized Form

Constructor Summary
Transition(char min, char max, State to)
          Constructs new transition.
Transition(char c, State to)
          Constructs new singleton interval transition.
 
Method Summary
 java.lang.Object clone()
          Clones this transition.
 boolean equals(java.lang.Object obj)
          Checks for equality.
 State getDest()
          Returns destination of this transition.
 char getMax()
          Returns maximum of this transition interval.
 char getMin()
          Returns minimum of this transition interval.
 int hashCode()
          Returns hash code.
 java.lang.String toString()
          Returns string describing this state.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transition

public Transition(char c,
                  State to)
Constructs new singleton interval transition.

Parameters:
c - transition character
to - destination state

Transition

public Transition(char min,
                  char max,
                  State to)
Constructs new transition. Both end points are included in the interval.

Parameters:
min - transition interval minimum
max - transition interval maximum
to - 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:
equals in class java.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 class java.lang.Object
Returns:
hash code

clone

public java.lang.Object clone()
Clones this transition.

Overrides:
clone in class java.lang.Object
Returns:
clone with same character interval and destination state

toString

public java.lang.String toString()
Returns string describing this state. Normally invoked via Automaton.toString().

Overrides:
toString in class java.lang.Object