Class BluetoothStatusToken<T>
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.domains.wireless.lib.bluetooth.BluetoothToken
-
- ptolemy.domains.wireless.lib.bluetooth.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 Summary
Constructors Constructor Description BluetoothStatusToken(BluetoothStatus status, T data)
Constructs a status token with a BluetoothStatus enum element and arbitrary data point.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getData()
Returns the data held by this status token.BluetoothStatus
getStatusValue()
Returns the status value held by this token.BooleanToken
isEqualTo(Token rightArgument)
Test for equality of the values of this Token and the argument Token.java.lang.String
toString()
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.-
Methods inherited from class ptolemy.domains.wireless.lib.bluetooth.BluetoothToken
add, addReverse, divide, divideReverse, isCloseTo, modulo, moduloReverse, multiply, multiplyReverse, pow, subtract, subtractReverse
-
Methods inherited from class ptolemy.data.Token
getType, isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, zero, zeroReturnType
-
-
-
-
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 statusdata
- 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 classToken
- 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 isToken.NIL
then return "nil"
-
-