|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoscript.data.Value
oscript.data.OObject
oscript.data.OString
oscript.data.Symbol
The Symbol is a type used internally by the scripting engine to represent identifiers, ie. variable or function names. Each symbol has a unique integer id. Furthermore, the mapping between symbols and ids is preserved in /cache so any cache entries (ie. compiled code, etc.) can assume that the same mapping between symbol and id exists as when it was created. (In other words, compiled code can discard the symbol object, and put the symbol's id in it's constant table.)
Field Summary |
Fields inherited from class oscript.data.OString |
MEMBER_NAMES, PARENT_TYPE_NAME, TYPE, TYPE_NAME |
Fields inherited from class oscript.data.OObject |
EMPTY_EXPR_LIST_EVALUATOR |
Fields inherited from class oscript.data.Value |
DEBUG, NULL, UNDEFINED |
Constructor Summary | |
Symbol()
|
Method Summary | |
int |
getId()
Get the unique id for this symbol. |
static Symbol |
getSymbol(int id)
Given a symbol id, return the symbol object. |
static Symbol |
getSymbol(java.lang.String str)
Given a string, return a symbol object. |
static Symbol |
getSymbol(Value val)
Given a script object, return a symbol object. |
void |
readExternal(java.io.ObjectInput in)
Derived class that implements Externalizable must
call this if it overrides it. |
void |
writeExternal(java.io.ObjectOutput out)
Derived class that implements Externalizable must
call this if it overrides it. |
Methods inherited from class oscript.data.OString |
_bopCast, bopEquals, bopEqualsR, bopGreaterThan, bopGreaterThanOrEquals, bopGreaterThanOrEqualsR, bopGreaterThanR, bopLessThan, bopLessThanOrEquals, bopLessThanOrEqualsR, bopLessThanR, bopNotEquals, bopNotEqualsR, bopPlus, bopPlusR, castToBoolean, castToExactNumber, castToInexactNumber, castToJavaObject, castToString, chop, elementAt, elementsAt, endsWith, equals, getTypeImpl, hashCode, indexOf, indexOf, intern, lastIndexOf, lastIndexOf, length, makeString, match, replace, search, startsWith, substring, substring, toLowerCase, toUpperCase, trim, value |
Methods inherited from class oscript.data.OObject |
getMember, populateMemberSet |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Symbol()
Method Detail |
public int getId()
OString.bopEquals(oscript.data.Value)
), then they will map to the same id,
and likewise the id will always map to symbols that are equal.
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
Externalizable
must
call this if it overrides it. It should override it to save/restore
it's own state.
readExternal
in interface java.io.Externalizable
readExternal
in class OString
java.io.IOException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Externalizable
must
call this if it overrides it. It should override it to save/restore
it's own state.
writeExternal
in interface java.io.Externalizable
writeExternal
in class OString
java.io.IOException
public static Symbol getSymbol(Value val)
OString.castToString()
) then they will
always map to the same symbol.
public static Symbol getSymbol(java.lang.String str)
public static Symbol getSymbol(int id)
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |