| java.lang.Object oscript.data.Value oscript.data.Reference
Reference | final public class Reference extends Value (Code) | | A reference forwards all method calls to the object it is a reference
for, but additionally a reference is assignable. It is used when a
variable (or array element) is looked up within a scope, and can be
used as either an lval or rval.
When a property of an object (ie a scope) has attributes associated
with it, those attributes are attributes of the reference. The
attributes are partially enforced by this class (in the case of
"const"), and by ScriptObject (in the case of "public").
Note that this could extends
AbstractReference , but doesn't
because I think that would have a performance impact... one of these
days I should actually verify that...
author: Rob Clark (rob@ti.com) |
Method Summary | |
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. | public Value | callAsExtends(StackFrame sf, Scope scope, MemberTable args) Call this object as a parent class constructor. | public Value | callAsFunction(StackFrame sf, MemberTable args) Call this object as a function. | 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. | public boolean | equals(Object obj) Compare two objects for equality. | int | getAttr() Get access to this reference's attributes. | public Value | getMember(int id, boolean exception) Get a member of this object. | public Object | getMonitor() Return the object used for implementing synchronized. | public Value | getType() Get the type of this object. | protected Value | getTypeImpl() Get the type of this object. | protected Value | getTypeMember(Value obj, int id) Get a member of this type. | public int | hashCode() Return a hash code value for this object. | 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. | boolean | isPublic() Determine if this reference is public. | public int | length() For types that implement elementAt , this returns the
number of elements. | final public java.util.Set | memberSet() Returns the names of the members of this object. | public void | opAssign(Value val) Perform assignment. | final void | reset(int attr) | final public void | reset(Value val) | final public void | reset() | 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. |
ATTR_CONST | final public static int ATTR_CONST(Code) | | |
ATTR_INVALID | final public static int ATTR_INVALID(Code) | | |
ATTR_PRIVATE | final public static int ATTR_PRIVATE(Code) | | |
ATTR_PROTECTED | final public static int ATTR_PROTECTED(Code) | | |
ATTR_PUBLIC | final public static int ATTR_PUBLIC(Code) | | |
ATTR_STATIC | final public static int ATTR_STATIC(Code) | | |
Reference | public Reference()(Code) | | Class Constructor. Create a reference with the default attributes.
|
Reference | public Reference(int attr)(Code) | | Class Constructor. Create a reference with the specified attributes.
Parameters: attr - attribute bitmask |
getAttr | int getAttr()(Code) | | Get access to this reference's attributes.
|
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. A reference doesn't actually have a type,
but instead is the type of whatever it contains... really I am not sure
if a reference is a first class type, or perhaps could be implemented
as an inner-class for OArray and ScriptObject. Perhaps Value should be
an interface, and what is now Value becomes some sort of adapter
class?
the object's type |
getTypeImpl | 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
Reference.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 |
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) |
isPublic | boolean isPublic()(Code) | | Determine if this reference is public. This is used by ScriptObject to
determine if it should restrict access to this reference.
true if public, else false |
memberSet | final 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 |
reset | final void reset(int attr)(Code) | | Reset this reference, which is used when the reference is re-used (in-
stead of re-allocating)
|
reset | final public void reset()(Code) | | |
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 |
Methods inherited from oscript.data.Value | public static Value _getTypeMember(Value type, Value obj, int id)(Code)(Java Doc) public static void _populateTypeMemberSet(Value type, java.util.Set s, boolean d)(Code)(Java Doc) public Value bopBitwiseAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseXor(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseXorR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopCast(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopCastR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopDivide(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopDivideR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopInstanceOf(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopInstanceOfR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLeftShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLeftShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMinus(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMinusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMultiply(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMultiplyR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopNotEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopNotEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopPlus(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopPlusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopRemainder(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopRemainderR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopSignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopSignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopUnsignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopUnsignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value callAsConstructor(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsConstructor(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsConstructor(StackFrame sf, Value[] args)(Code)(Java Doc) public Value callAsExtends(StackFrame sf, Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsExtends(Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsExtends(StackFrame sf, Scope scope, Value[] args)(Code)(Java Doc) public Value callAsFunction(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsFunction(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsFunction(StackFrame sf, Value[] args)(Code)(Java Doc) public boolean castToBoolean() throws PackagedScriptObjectException(Code)(Java Doc) public long castToExactNumber() throws PackagedScriptObjectException(Code)(Java Doc) public double castToInexactNumber() throws PackagedScriptObjectException(Code)(Java Doc) public Object castToJavaObject() throws PackagedScriptObjectException(Code)(Java Doc) public String castToString() throws PackagedScriptObjectException(Code)(Java Doc) public Value elementAt(Value idx) throws PackagedScriptObjectException(Code)(Java Doc) public Value elementsAt(Value idx1, Value idx2) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(String name) throws PackagedScriptObjectException(Code)(Java Doc) public Value getMember(Value name) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(int id) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(String name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(Value name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) public Value getMember(int id, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) public Object getMonitor()(Code)(Java Doc) public Value getType()(Code)(Java Doc) abstract protected Value getTypeImpl()(Code)(Java Doc) protected Value getTypeMember(Value obj, int id)(Code)(Java Doc) final protected Value getTypeMember(Value obj, Value name)(Code)(Java Doc) public boolean isA(Value type)(Code)(Java Doc) public int length() throws PackagedScriptObjectException(Code)(Java Doc) public java.util.Set memberSet()(Code)(Java Doc) protected PackagedScriptObjectException noSuchMember(String member)(Code)(Java Doc) public void opAssign(Value val) throws PackagedScriptObjectException(Code)(Java Doc) protected void populateMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc) protected void populateTypeMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc) public void readExternal(java.io.ObjectInput in) throws ClassNotFoundException, java.io.IOException(Code)(Java Doc) public String toString()(Code)(Java Doc) public Value unhand()(Code)(Java Doc) public Value uopBitwiseNot() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopDecrement() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopIncrement() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopLogicalNot() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopMinus() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopPlus() throws PackagedScriptObjectException(Code)(Java Doc) public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException(Code)(Java Doc)
|
|
|