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.TypegetType()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:
getTypein classScalarToken- Returns:
- BaseType.SCALAR.
-
_absolute
protected ScalarToken _absolute()
Return this token.- Specified by:
_absolutein classScalarToken- Returns:
- This token.
-
_add
protected ScalarToken _add(ScalarToken rightArgument) throws IllegalActionException
Throw an exception.- Specified by:
_addin 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:
_bitwiseAndin 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:
_bitwiseNotin 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:
_bitwiseOrin 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:
_bitwiseXorin 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:
_dividein 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:
_isCloseToin 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:
_isLessThanin 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:
_moduloin 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:
_multiplyin 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:
_subtractin 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.
-
-