Package ptolemy.domains.modal.kernel.ia
Class StatePair
- java.lang.Object
-
- ptolemy.domains.modal.kernel.ia.StatePair
-
public class StatePair extends java.lang.Object
A pair of states. This class is used in the representation of alternating simulation.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Yuhong Xiong
- See Also:
InterfaceAutomaton.computeAlternatingSimulation(ptolemy.domains.modal.kernel.ia.InterfaceAutomaton)
- Pt.AcceptedRating:
- Red (yuhong)
- Pt.ProposedRating:
- Red (yuhong)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Override the base class method to return true if the specified object is an instance of StatePair and it contains the same states as this one.State
first()
Return the first state in this pair.int
hashCode()
Override the base class method to ensure that the pairs that are equal (according to the equals() method) have the same hash code.State
second()
Return the second state in this pair.java.lang.String
toString()
Return a string representation of this pair.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
Override the base class method to return true if the specified object is an instance of StatePair and it contains the same states as this one.- Overrides:
equals
in classjava.lang.Object
- Parameters:
object
- An object to compare with this one.- Returns:
- True if the specified object is an instance of StatePair and this one contains the same states, false otherwise.
-
first
public State first()
Return the first state in this pair.- Returns:
- The first state in this pair.
-
hashCode
public int hashCode()
Override the base class method to ensure that the pairs that are equal (according to the equals() method) have the same hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code.
-
second
public State second()
Return the second state in this pair.- Returns:
- The second state in this pair.
-
toString
public java.lang.String toString()
Return a string representation of this pair. The string contains the name of the first state, followed by a " - ", followed by the name of the second state.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string containing the names of the two states separated by a " - ".
-
-