Package ptolemy.data.expr
Class ConcreteScalarToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.data.ScalarToken
-
- ptolemy.data.expr.ConcreteScalarToken
-
- All Implemented Interfaces:
BitwiseOperationToken
,PartiallyOrderedToken
public class ConcreteScalarToken extends ScalarToken
A token that represents a scalar of any type. This is instantiated by the Constants class with name "scalar".- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Yellow (wbwu)
- Pt.ProposedRating:
- Yellow (yuhong)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ScalarToken
_unitCategoryExponents
-
-
Constructor Summary
Constructors Constructor Description ConcreteScalarToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ScalarToken
_absolute()
Return this token.protected ScalarToken
_add(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_bitwiseAnd(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_bitwiseNot()
Throw an exception.protected ScalarToken
_bitwiseOr(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_bitwiseXor(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_divide(ScalarToken rightArgument)
Throw an exception.protected BooleanToken
_isCloseTo(ScalarToken rightArgument, double epsilon)
Throw an exception.protected BooleanToken
_isLessThan(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_modulo(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_multiply(ScalarToken rightArgument)
Throw an exception.protected ScalarToken
_subtract(ScalarToken rightArgument)
Throw an exception.Type
getType()
Return the type of this token.-
Methods inherited from class ptolemy.data.ScalarToken
_addCategoryExponents, _areUnitsEqual, _copyOfCategoryExponents, _isEqualTo, _isUnitless, _subtractCategoryExponents, absolute, add, addReverse, bitwiseAnd, bitwiseNot, bitwiseOr, bitwiseXor, byteValue, complexValue, divide, divideReverse, doubleValue, fixValue, floatValue, intValue, inUnitsOf, isCloseTo, isEqualTo, isGreaterThan, isLessThan, isLessThan, leftShift, logicalRightShift, longValue, modulo, moduloReverse, multiply, multiplyReverse, rightShift, setUnitCategory, shortValue, subtract, subtractReverse, unitsString
-
Methods inherited from class ptolemy.data.Token
isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, toString, zero, zeroReturnType
-
-
-
-
Method Detail
-
getType
public Type getType()
Return the type of this token.- Specified by:
getType
in classScalarToken
- Returns:
- BaseType.SCALAR.
-
_absolute
protected ScalarToken _absolute()
Return this token.- Specified by:
_absolute
in classScalarToken
- Returns:
- This token.
-
_add
protected ScalarToken _add(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_add
in classScalarToken
- Parameters:
rightArgument
- The token to add to this token.- Returns:
- A new token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
_bitwiseAnd
protected ScalarToken _bitwiseAnd(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_bitwiseAnd
in classScalarToken
- Parameters:
rightArgument
- The ScalarToken to bitwise AND with this one.- Returns:
- The bitwise AND.
- Throws:
IllegalActionException
- If the given token is not compatible for this operation, or the operation does not make sense for this type.
-
_bitwiseNot
protected ScalarToken _bitwiseNot() throws IllegalActionException
Throw an exception.- Specified by:
_bitwiseNot
in classScalarToken
- Returns:
- The bitwise NOT of this token.
- Throws:
IllegalActionException
- If the given token is not compatible for this operation, or the operation does not make sense for this type.
-
_bitwiseOr
protected ScalarToken _bitwiseOr(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_bitwiseOr
in classScalarToken
- Parameters:
rightArgument
- The ScalarToken to bitwise OR with this one.- Returns:
- The bitwise OR.
- Throws:
IllegalActionException
- If the given token is not compatible for this operation, or the operation does not make sense for this type.
-
_bitwiseXor
protected ScalarToken _bitwiseXor(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_bitwiseXor
in classScalarToken
- Parameters:
rightArgument
- The ScalarToken to bitwise XOR with this one.- Returns:
- The bitwise XOR.
- Throws:
IllegalActionException
- If the given token is not compatible for this operation, or the operation does not make sense for this type.
-
_divide
protected ScalarToken _divide(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_divide
in classScalarToken
- Parameters:
rightArgument
- The token to divide this token by.- Returns:
- A new Token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
_isCloseTo
protected BooleanToken _isCloseTo(ScalarToken rightArgument, double epsilon) throws IllegalActionException
Throw an exception.- Specified by:
_isCloseTo
in classScalarToken
- Parameters:
rightArgument
- The token to compare to this token.epsilon
- The value that we use to determine whether two tokens are close.- Returns:
- A token containing true if the value of the first argument is close to the value of this token.
- Throws:
IllegalActionException
- If there is a problem processing the rightArgument.
-
_isLessThan
protected BooleanToken _isLessThan(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_isLessThan
in classScalarToken
- Parameters:
rightArgument
- The token to add to this token.- Returns:
- A new Token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
_modulo
protected ScalarToken _modulo(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_modulo
in classScalarToken
- Parameters:
rightArgument
- The token to modulo this token by.- Returns:
- A new Token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
_multiply
protected ScalarToken _multiply(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_multiply
in classScalarToken
- Parameters:
rightArgument
- The token to multiply this token by.- Returns:
- A new Token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
_subtract
protected ScalarToken _subtract(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_subtract
in classScalarToken
- Parameters:
rightArgument
- The token to subtract from this token.- Returns:
- A new Token containing the result.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
-