|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.data.Token
ptolemy.data.AbstractConvertibleToken
ptolemy.data.StringToken
A token that contains a string, or more specifically, a reference to an instance of String. The reference is never null, although it may be an empty string (""). Note that when this token is cloned, the clone will refer to exactly the same String object. However, a String object in Java is immutable, so there is no risk when two tokens refer to the same string that one of the strings will be changed.
| Yellow (wbwu) |
| Green (neuendor) |
| Constructor Summary | |
StringToken()
Construct a token with an empty string. |
|
StringToken(java.lang.String value)
Construct a token with the specified string. |
|
| Method Summary | |
protected Token |
_add(Token rightArgument)
Return a new token whose value is the value of the argument Token added to the value of this Token. |
protected Token |
_divide(Token rightArgument)
Return a new token whose value is the value of this token divided by the value of the argument token. |
protected BooleanToken |
_isCloseTo(Token rightArgument,
double epsilon)
Test for closeness of the values of this Token and the argument Token. |
protected BooleanToken |
_isEqualTo(Token rightArgument)
Test for equality of the values of this Token and the argument Token. |
protected Token |
_modulo(Token rightArgument)
Return a new token whose value is the value of this token modulo the value of the argument token. |
protected Token |
_multiply(Token rightArgument)
Return a new token whose value is the value of this token multiplied by the value of the argument token. |
protected Token |
_subtract(Token rightArgument)
Return a new token whose value is the value of the argument token subtracted from the value of this token. |
static StringToken |
convert(Token token)
Convert the specified token into an instance of StringToken. |
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of StringToken with the same value. |
Type |
getType()
Return the type of this token. |
int |
hashCode()
Return a hash code value for this token. |
java.lang.String |
stringValue()
Return the string that this token contains. |
java.lang.String |
toString()
Return the value of this Token as a string. |
Token |
zero()
Return a StringToken containing an empty string, which is considered as the additive identity of string. |
| Methods inherited from class ptolemy.data.AbstractConvertibleToken |
add, addReverse, divide, divideReverse, isCloseTo, isEqualTo, modulo, moduloReverse, multiply, multiplyReverse, subtract, subtractReverse |
| Methods inherited from class ptolemy.data.Token |
isCloseTo, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, one, pow, zeroReturnType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public StringToken()
public StringToken(java.lang.String value)
| Method Detail |
public static StringToken convert(Token token)
throws IllegalActionException
token - The token to be converted to a StringToken.
IllegalActionException - If the conversion cannot
be carried out.public boolean equals(java.lang.Object object)
object - An instance of Object.
public Type getType()
getType in class Tokenpublic int hashCode()
public java.lang.String stringValue()
public java.lang.String toString()
toString in class Tokenpublic Token zero()
zero in class Token
protected Token _add(Token rightArgument)
throws IllegalActionException
_add in class AbstractConvertibleTokenrightArgument - The token whose value we add to the value of
this token.
IllegalActionException - If this method is not
supported by the derived class.
protected Token _divide(Token rightArgument)
throws IllegalActionException
_divide in class AbstractConvertibleTokenrightArgument - The token to divide this token by.
IllegalActionException - If this method is not
supported by the derived class.
protected BooleanToken _isCloseTo(Token rightArgument,
double epsilon)
throws IllegalActionException
_isCloseTo in class AbstractConvertibleTokenrightArgument - The token to add to this token.
IllegalActionException - If this method is not
supported by the derived class.
protected BooleanToken _isEqualTo(Token rightArgument)
throws IllegalActionException
_isEqualTo in class AbstractConvertibleTokenrightArgument - The token to add to this token.
IllegalActionException - If this method is not
supported by the derived class.
protected Token _modulo(Token rightArgument)
throws IllegalActionException
_modulo in class AbstractConvertibleTokenrightArgument - The token to modulo this token by.
IllegalActionException - If this method is not
supported by the derived class.
protected Token _multiply(Token rightArgument)
throws IllegalActionException
_multiply in class AbstractConvertibleTokenrightArgument - The token to multiply this token by.
IllegalActionException - If this method is not
supported by the derived class.
protected Token _subtract(Token rightArgument)
throws IllegalActionException
_subtract in class AbstractConvertibleTokenrightArgument - The token to subtract from this token.
IllegalActionException - If this method is not
supported by the derived class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||