|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.Token
ptolemy.data.ObjectToken
public class ObjectToken
A token that contains a reference to an arbitrary object. Note that when this token constructed, the object passed to the constructor is not cloned. Thus, care must be exercised to ensure that actors do not modify that object in a nondeterministic way, unless such nondeterminism is acceptable.
Yellow (wbwu) |
Yellow (yuhong) |
Field Summary | |
---|---|
private java.lang.Class |
_class
The class of the object. |
private java.lang.Object |
_value
The actual Object. |
static ObjectToken |
NULL
A new empty ObjectToken. |
Fields inherited from class ptolemy.data.Token |
---|
NIL |
Constructor Summary | |
---|---|
ObjectToken()
Construct an empty token. |
|
ObjectToken(java.lang.Object value)
Construct a token with a reference to the specified object. |
|
ObjectToken(java.lang.Object value,
java.lang.Class<?> valueClass)
Construct a token with the given value and the given class as the value's type. |
Method Summary | |
---|---|
static ObjectToken |
convert(Token token)
Convert the specified token into an instance of ObjectToken. |
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of ObjectToken and its contained object is equal to the object contained in this token, as tested by the equals() method of the contained object. |
Type |
getType()
Return the type of this token. |
java.lang.Object |
getValue()
Return the value of the token, a reference to an object. |
java.lang.Class |
getValueClass()
Return the class of the object contained in this token. |
int |
hashCode()
Return a hash code value for this token. |
BooleanToken |
isEqualTo(Token rightArgument)
Compare this ObjectToken to the given argument, and return true if the values contained in the two are the same Java object. |
static ObjectToken |
object(java.lang.String className)
Return an ObjectToken with value null and class specified by the className argument. |
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.data.Token |
---|
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ObjectToken NULL
private java.lang.Class _class
private java.lang.Object _value
Constructor Detail |
---|
public ObjectToken()
public ObjectToken(java.lang.Object value) throws IllegalActionException
value
- The specified object referred to by this token.
IllegalActionException
- If the argument is not of
the appropriate type (may be thrown by derived classes, but is
not thrown here).public ObjectToken(java.lang.Object value, java.lang.Class<?> valueClass) throws IllegalActionException
value
- The value.valueClass
- The class of the value.
IllegalActionException
- If the argument is not of
the appropriate type.Method Detail |
---|
public static ObjectToken convert(Token token) throws IllegalActionException
token
- The token to be converted to an ObjectToken.
IllegalActionException
- If the conversion
cannot be carried out.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- An instance of Object.
public Type getType()
getType
in class Token
public java.lang.Object getValue()
public java.lang.Class getValueClass()
public int hashCode()
hashCode
in class java.lang.Object
public BooleanToken isEqualTo(Token rightArgument)
isEqualTo
in class Token
rightArgument
- The argument.
public static ObjectToken object(java.lang.String className) throws IllegalActionException
className
- The className.
IllegalActionException
- If the class with className as its name
cannot be loaded.public java.lang.String toString()
toString
in class Token
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |