Class BluetoothStatusToken<T>


  • public class BluetoothStatusToken<T>
    extends BluetoothToken
    This class represents a status token generated by the BluetoothDevice actor that is output when a command has successfully or unsuccessfully been executed, or when data has been received. It contains the generic type T that is formed by any arbitrary piece of data. This data is not represented in the toString() of the object. If the data is a string, however, it will be represented when toString() is called.

    This class must be instantiated with two parameters: a BluetoothStatus enum element, and a data of type T.

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Phillip Azar
    See Also:
    BluetoothStatus, BluetoothDevice
    • Constructor Detail

      • BluetoothStatusToken

        public BluetoothStatusToken​(BluetoothStatus status,
                                    T data)
        Constructs a status token with a BluetoothStatus enum element and arbitrary data point.
        Parameters:
        status - The status
        data - The data
    • Method Detail

      • getStatusValue

        public BluetoothStatus getStatusValue()
        Returns the status value held by this token.
        Returns:
        BluetoothStatus status
      • getData

        public T getData()
        Returns the data held by this status token.
        Returns:
        T data
      • isEqualTo

        public BooleanToken isEqualTo​(Token rightArgument)
                               throws IllegalActionException
        Description copied from class: Token
        Test for equality of the values of this Token and the argument Token.
        Overrides:
        isEqualTo in class Token
        Parameters:
        rightArgument - The token with which to test equality.
        Returns:
        A BooleanToken which contains the result of the test. If either this token or the argument token is a nil token, then a boolean token that contains the value false is returned.
        Throws:
        IllegalActionException - If the argument token is not of a type that can be compared with this token.
      • toString

        public java.lang.String toString()
        Description copied from class: Token
        Return the value of this token as a string that can be parsed by the expression language to recover a token with the same value. This method should be overridden by derived classes. In this base class, return the String "present" to indicate that an event is present. If this token is Token.NIL then return "nil"
        Overrides:
        toString in class Token
        Returns:
        The String "present", unless this token is Token.NIL, in which case return the String "nil".