laser.regularlanguage.fsa.util
Class CompositeState<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.fsa.util.CompositeState<L>
All Implemented Interfaces:
java.lang.Comparable<CompositeState<L>>

public class CompositeState<L extends LabelInterface>
extends java.lang.Object
implements java.lang.Comparable<CompositeState<L>>

A composite state is used when computing the composition of two FSAs and represents a state that has one state from the first FSA and one state from the second FSA.

Author:
Jamieson M. Cobleigh (laser-software@cs.umass.edu)

Constructor Summary
CompositeState(FSAStateInterface<L> state1, FSAStateInterface<L> state2)
          Creates a new composite state for the given states
 
Method Summary
 int compareTo(CompositeState<L> composite)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object o)
          Determines if the given object is equal to this one
 FSAStateInterface<L> getState1()
          Gets the first state
 FSAStateInterface<L> getState2()
          Gets the second state
 java.lang.String toString()
          Returns a string represetnation of this composite state
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeState

public CompositeState(FSAStateInterface<L> state1,
                      FSAStateInterface<L> state2)
Creates a new composite state for the given states

Parameters:
state1 - the first state
state2 - the second state
Method Detail

compareTo

public int compareTo(CompositeState<L> composite)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable<CompositeState<L extends LabelInterface>>
Parameters:
composite - the composite state being compared to
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equals

public boolean equals(java.lang.Object o)
Determines if the given object is equal to this one

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object
Returns:
true if the given object is equal to this one, false otherwise

getState1

public FSAStateInterface<L> getState1()
Gets the first state

Returns:
the first state

getState2

public FSAStateInterface<L> getState2()
Gets the second state

Returns:
the second state

toString

public java.lang.String toString()
Returns a string represetnation of this composite state

Overrides:
toString in class java.lang.Object
Returns:
a string represetnation of this composite state