Package jade.wrapper

Class StateBase

    • Method Detail

      • getName

        public String getName()
        Returns the descriptive name of the state.
        Specified by:
        getName in interface State
        Returns:
        The descriptive name of the state. Will never return null.
      • getCode

        public int getCode()
        Return the integer code that identifies this state.
        Specified by:
        getCode in interface State
        Returns:
        The integer code that identifies this state.
      • equals

        public boolean equals​(Object object)
        Determines if an object is equal to this object. In order for the the passed object to be equal to this one the passed object must be an instance if State and contain the same state code.
        Overrides:
        equals in class Object
        Parameters:
        object - An object to test for equality.
        Returns:
        True if the object represent the same state and False otherwise.
      • compareTo

        public int compareTo​(Object object)
        Compares a given object to this state object for the purpose of collating. This method is used for the sorting of states. A positive value means the receiver (this object) is "greater than" the passed object. A negative value means the receiver is "less than" the passed object. A value of zero means the receiver and the passed object are equal to each other.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        object - An object to compare this object to.
        Returns:
        The result of the comparison.

        The value 1 is returned if:

        • the passed object is null (the receiver is considered "greater than" null objects)
        • the state code held by the receiver (this object) is greater than the code of the passed object

        The value 0 (zero) is returned if:

        • the two state objects hold the same state code

        The value -1 is returned if:

        • the passed object is not a AgentStateImpl object (the receiver is considered "less than" objects of other types)
        • the state code held by the receiver (this object) is less than the code of the passed object
        • hashCode

          public int hashCode()
          Returns the hash code for this state. The hash code equals the state code.
          Overrides:
          hashCode in class Object
          Returns:
          The state code for this state.
        • toString

          public String toString()
          A string representation of this state. The returned string is of the form StateName(StateCode).
          Specified by:
          toString in interface State
          Overrides:
          toString in class Object
          Returns:
          A string containing the name and code for this state.