| java.lang.Object oscript.data.Value
All known Subclasses: oscript.data.Scope, oscript.data.JavaObjectWrapper, oscript.data.JavaMethodWrapper, oscript.data.ComMethod, oscript.data.XmlRpcMethod, oscript.data.OSpecial, oscript.data.Reference, oscript.data.AbstractReference, oscript.data.Type, oscript.data.Debugger, oscript.data.OObject,
Value | abstract public class Value implements java.io.Serializable(Code) | | The base class of all values in the interpreter. This class provides
methods (which throw script-exceptions if not overloaded), so that the
interpreter has a handy way of calling the methods needed to evaluate
a program. This methods can be overloaded by built-in (ie native java)
methods for the built-in types, or via ScriptObject for
script types.
author: Rob Clark (rob@ti.com) |
Constructor Summary | |
public | Value() Class Constructor. |
Method Summary | |
public static Value | _getTypeMember(Value type, Value obj, int id) | public static void | _populateTypeMemberSet(Value type, java.util.Set s, boolean d) | public Value | bopBitwiseAnd(Value val) Perform the bitwise AND operation. | public Value | bopBitwiseAndR(Value val, PackagedScriptObjectException e) | public Value | bopBitwiseOr(Value val) Perform the bitwise OR operation. | public Value | bopBitwiseOrR(Value val, PackagedScriptObjectException e) | public Value | bopBitwiseXor(Value val) Perform the bitwise XOR operation. | public Value | bopBitwiseXorR(Value val, PackagedScriptObjectException e) | public Value | bopCast(Value val) | public Value | bopCastR(Value val, PackagedScriptObjectException e) | public Value | bopDivide(Value val) Perform the "/" operation. | public Value | bopDivideR(Value val, PackagedScriptObjectException e) | public Value | bopEquals(Value val) Perform the "==" operation. | public Value | bopEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopGreaterThan(Value val) Perform the ">" operation. | public Value | bopGreaterThanOrEquals(Value val) Perform the ">=" operation. | public Value | bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopGreaterThanR(Value val, PackagedScriptObjectException e) | public Value | bopInstanceOf(Value val) Perform the instanceof operation. | public Value | bopInstanceOfR(Value val, PackagedScriptObjectException e) | public Value | bopLeftShift(Value val) Perform the "<<" operation. | public Value | bopLeftShiftR(Value val, PackagedScriptObjectException e) | public Value | bopLessThan(Value val) Perform the "<" operation. | public Value | bopLessThanOrEquals(Value val) Perform the "<=" operation. | public Value | bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopLessThanR(Value val, PackagedScriptObjectException e) | public Value | bopLogicalAnd(Value val) Perform the logical AND operation. | public Value | bopLogicalAndR(Value val, PackagedScriptObjectException e) | public Value | bopLogicalOr(Value val) Perform the logical OR operation. | public Value | bopLogicalOrR(Value val, PackagedScriptObjectException e) | public Value | bopMinus(Value val) Perform the "-" operation. | public Value | bopMinusR(Value val, PackagedScriptObjectException e) | public Value | bopMultiply(Value val) Perform the "*" operation. | public Value | bopMultiplyR(Value val, PackagedScriptObjectException e) | public Value | bopNotEquals(Value val) Perform the "!=" operation. | public Value | bopNotEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopPlus(Value val) Perform the "+" operation. | public Value | bopPlusR(Value val, PackagedScriptObjectException e) | public Value | bopRemainder(Value val) Perform the "%" operation. | public Value | bopRemainderR(Value val, PackagedScriptObjectException e) | public Value | bopSignedRightShift(Value val) Perform the ">>" operation. | public Value | bopSignedRightShiftR(Value val, PackagedScriptObjectException e) | public Value | bopUnsignedRightShift(Value val) Perform the ">>>" operation. | public Value | bopUnsignedRightShiftR(Value val, PackagedScriptObjectException e) | public Value | callAsConstructor(StackFrame sf, MemberTable args) Call this object as a constructor. | final public Value | callAsConstructor(Value[] args) | final public Value | callAsConstructor(StackFrame sf, Value[] args) | public Value | callAsExtends(StackFrame sf, Scope scope, MemberTable args) Call this object as a parent class constructor. | final public Value | callAsExtends(Scope scope, MemberTable args) | final public Value | callAsExtends(StackFrame sf, Scope scope, Value[] args) | public Value | callAsFunction(StackFrame sf, MemberTable args) Call this object as a function. | final public Value | callAsFunction(Value[] args) | final public Value | callAsFunction(StackFrame sf, Value[] args) | public boolean | castToBoolean() Convert this object to a native java boolean value. | public long | castToExactNumber() Convert this object to a native java long value. | public double | castToInexactNumber() Convert this object to a native java double value. | public Object | castToJavaObject() Convert this object to a native java Object value. | public String | castToString() Convert this object to a native java String value. | public Value | elementAt(Value idx) Get the specified index of this object, if this object is an array. | public Value | elementsAt(Value idx1, Value idx2) Get the specified range of this object, if this object is an array. | final public Value | getMember(String name) Get a member of this object. | public Value | getMember(Value name) Get a member of this object. | final public Value | getMember(int id) Get a member of this object. | final public Value | getMember(String name, boolean exception) This isn't really part of the public interface, but is provided for
the generated wrapper classes. | final public Value | getMember(Value name, boolean exception) | public Value | getMember(int id, boolean exception) | public Object | getMonitor() Return the object used for implementing synchronized. | public Value | getType() Get the type of this object. | abstract protected Value | getTypeImpl() Get the type of this object. | protected Value | getTypeMember(Value obj, int id) Get a member of this type. | final protected Value | getTypeMember(Value obj, Value name) | public boolean | isA(Value type) If this object is a type, determine if an instance of this type is
an instance of the specified type, ie. | public int | length() For types that implement elementAt , this returns the
number of elements. | public java.util.Set | memberSet() Returns the names of the members of this object. | protected PackagedScriptObjectException | noSuchMember(String member) | public void | opAssign(Value val) Perform assignment. | protected void | populateMemberSet(java.util.Set s, boolean debugger) Derived classes that implement
Value.getMember should also
implement this. | protected void | populateTypeMemberSet(java.util.Set s, boolean debugger) Derived classes that implement
Value.getTypeMember should also
implement this. | public void | readExternal(java.io.ObjectInput in) Derived class that implements
java.io.Externalizable must
call this if it overrides it, or call
Value._externalInit from the
Value.readExternal method. | public String | toString() Convert this value to a string, for the benefit of java code. | public Value | unhand() For references to an object (ie variables), this returns the actual
value this is a reference to, otherwise this return this . | public Value | uopBitwiseNot() Perform the "~" operation. | public Value | uopDecrement() Perform the "--" operation. | public Value | uopIncrement() Perform the "++" operation. | public Value | uopLogicalNot() Perform the "!" operation. | public Value | uopMinus() Perform the "-" operation. | public Value | uopPlus() Perform the "+" operation. | public void | writeExternal(java.io.ObjectOutput out) Derived class that implements
java.io.Externalizable must
call this if it overrides it, or call
Value.setType from the
Value.readExternal method. |
DEBUG | final public static boolean DEBUG(Code) | | |
PARENT_TYPE_NAME | final public static String PARENT_TYPE_NAME(Code) | | |
TYPE | final public static BuiltinType TYPE(Code) | | The type object for an instance of Value... value can't really be
instantiated, but this is needed internally.
|
UNDEFINED | final public static Value UNDEFINED(Code) | | Various and asundry special values. UNDEFINED is different from
NULL in that it is used for un-initialized variables or array
entries. A variable or array entry cannot be given the value
UNDEFINED, but can be assigned the value NULL.
|
Value | public Value()(Code) | | Class Constructor.
Parameters: type - the type of this object |
getMonitor | public Object getMonitor()(Code) | | Return the object used for implementing synchronized. For a
normal script object, the object is it's own monitor. For a java
object, it is the java object rather than the
JavaObjectWrapper .
the object to synchronize on |
getType | public Value getType()(Code) | | Get the type of this object.
the object's type |
getTypeImpl | abstract protected Value getTypeImpl()(Code) | | Get the type of this object. The returned type doesn't have to take
into account the possibility of a script type extending a built-in
type, since that is handled by
Value.getType .
the object's type |
getTypeMember | protected Value getTypeMember(Value obj, int id)(Code) | | Get a member of this type. This is used to interface to the java
method of having members be attributes of a type. Regular object-
script object's members are attributes of the object, but in the
case of java types (including built-in types), the members are
attributes of the type.
Parameters: obj - an object of this type Parameters: id - the id of the symbol that maps to the member a reference to the member, or null See Also: Value.populateTypeMemberSet |
isA | public boolean isA(Value type)(Code) | | If this object is a type, determine if an instance of this type is
an instance of the specified type, ie. if this is type ,
or a subclass.
Parameters: type - the type to compare this type to true or false throws: PackagedScriptObjectException - (NoSuchMemberException) |
memberSet | public java.util.Set memberSet()(Code) | | Returns the names of the members of this object.
a collection view of the names of the members of this object |
populateMemberSet | protected void populateMemberSet(java.util.Set s, boolean debugger)(Code) | | Derived classes that implement
Value.getMember should also
implement this.
Parameters: s - the set to populate Parameters: debugger - true if being used by debugger, inwhich case both public and private/protected field names should be returned See Also: Value.getMember |
populateTypeMemberSet | protected void populateTypeMemberSet(java.util.Set s, boolean debugger)(Code) | | Derived classes that implement
Value.getTypeMember should also
implement this.
Parameters: s - the set to populate Parameters: debugger - true if being used by debugger, inwhich case both public and private/protected field names should be returned See Also: Value.getTypeMember |
toString | public String toString()(Code) | | Convert this value to a string, for the benefit of java code.
a string |
unhand | public Value unhand()(Code) | | For references to an object (ie variables), this returns the actual
value this is a reference to, otherwise this return this .
the actual object |
|
|