ptolemy.data.expr
Class ConcreteScalarToken

java.lang.Object
  extended by ptolemy.data.Token
      extended by ptolemy.data.ScalarToken
          extended by ptolemy.data.expr.ConcreteScalarToken
All Implemented Interfaces:
java.io.Serializable, BitwiseOperationToken

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: ConcreteScalarToken.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Yellow (wbwu)
Proposed Rating:
Yellow (yuhong)

Field Summary
 
Fields inherited from class ptolemy.data.ScalarToken
_unitCategoryExponents
 
Fields inherited from class ptolemy.data.Token
NIL
 
Constructor Summary
ConcreteScalarToken()
           
 
Method Summary
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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcreteScalarToken

public ConcreteScalarToken()
Method Detail

getType

public Type getType()
Return the type of this token.

Specified by:
getType in class ScalarToken
Returns:
BaseType.SCALAR.

_absolute

protected ScalarToken _absolute()
Return this token.

Specified by:
_absolute in class ScalarToken
Returns:
This token.

_add

protected ScalarToken _add(ScalarToken rightArgument)
                    throws IllegalActionException
Throw an exception.

Specified by:
_add in class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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 class ScalarToken
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.