T
- - the type for the data contained within this token.public class BluetoothResponseToken<T> extends BluetoothToken
The device identifier field represents the target device for this response token. The source identifier field represents the current device this response token is bieng sent from. This will be set to the return value of this.getName() in all cases except when scanning, where it will be set to "scan". The data field represents an arbitrary peice of data to communicate to another BluetoothDevice actor.
Construction of an object of this class requires a BluetoothResponse enum element, a device identifier, a source identifier, and an arbitrary piece of data. The fields of this class are immutable.
The toString() method will return the string equivalent of the BluetoothResponse enum element contained within this object.
BluetoothResponse
,
BluetoothDevice
Constructor and Description |
---|
BluetoothResponseToken(BluetoothResponse response,
java.lang.String deviceIdentifier,
java.lang.String sourceIdentifier,
T data)
Construct a BluetoothResposeToken.
|
Modifier and Type | Method and Description |
---|---|
T |
getData()
Get the data stored within this token.
|
java.lang.String |
getDeviceIdentifier()
Get the name of the target device associated with this token.
|
BluetoothResponse |
getResponse()
Get the BluetoothResponse enum element associated with this
token.
|
java.lang.String |
getSourceIdentifier()
Get the name of the source device associated with 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.
|
add, addReverse, divide, divideReverse, isCloseTo, modulo, moduloReverse, multiply, multiplyReverse, pow, subtract, subtractReverse
getType, isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, zero, zeroReturnType
public BluetoothResponseToken(BluetoothResponse response, java.lang.String deviceIdentifier, java.lang.String sourceIdentifier, T data)
response
- The response, request, or command
desired. Acceptable entries are contained within the
BluetoothResponse enumeration.deviceIdentifier
- A String representing the name of
target device.sourceIdentifier
- A String representing the name of the
device constructing this token.data
- The arbitrary data to send.public BluetoothResponse getResponse()
public java.lang.String getDeviceIdentifier()
public java.lang.String getSourceIdentifier()
public T getData()
public java.lang.String toString()
Token
Token.NIL
then
return "nil"public BooleanToken isEqualTo(Token rightArgument) throws IllegalActionException
Token
isEqualTo
in class Token
rightArgument
- The token with which to test equality.IllegalActionException
- If the argument token is not
of a type that can be compared with this token.