oscript.data
Class JavaMethodWrapper

java.lang.Object
  extended byoscript.data.Value
      extended byoscript.data.JavaMethodWrapper
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class JavaMethodWrapper
extends Value
implements java.lang.Runnable

A wrapper for a method of a java object. Because the method that is called is determined by the arguments to the method when it is called, rather than when it is dereferenced, this is actually a wrapper for an array of all methods in a class with a certain name.

Author:
Rob Clark (rob@ti.com)
See Also:
Serialized Form

Field Summary
static java.lang.String[] MEMBER_NAMES
           
static java.lang.String PARENT_TYPE_NAME
           
static Value TYPE
          The type object for an script java method.
static java.lang.String TYPE_NAME
           
 
Fields inherited from class oscript.data.Value
DEBUG, NULL, UNDEFINED
 
Method Summary
 Value bopEquals(Value val)
          Perform the "==" operation.
 Value bopNotEquals(Value val)
          Perform the "!=" operation.
 Value callAsFunction(StackFrame sf, MemberTable args)
          Call this object as a function.
 java.lang.String castToString()
          Convert this object to a native java String value.
 boolean equals(java.lang.Object obj)
          Compare two objects for equality.
protected  Value getTypeImpl()
          Get the type of this object.
 int hashCode()
          Return a hash code value for this object.
 void run()
          Implementing the runnable interface.
 
Methods inherited from class oscript.data.Value
_getTypeMember, _populateTypeMemberSet, bopBitwiseAnd, bopBitwiseAndR, bopBitwiseOr, bopBitwiseOrR, bopBitwiseXor, bopBitwiseXorR, bopCast, bopCastR, bopDivide, bopDivideR, bopEqualsR, bopGreaterThan, bopGreaterThanOrEquals, bopGreaterThanOrEqualsR, bopGreaterThanR, bopInstanceOf, bopInstanceOfR, bopLeftShift, bopLeftShiftR, bopLessThan, bopLessThanOrEquals, bopLessThanOrEqualsR, bopLessThanR, bopLogicalAnd, bopLogicalAndR, bopLogicalOr, bopLogicalOrR, bopMinus, bopMinusR, bopMultiply, bopMultiplyR, bopNotEqualsR, bopPlus, bopPlusR, bopRemainder, bopRemainderR, bopSignedRightShift, bopSignedRightShiftR, bopUnsignedRightShift, bopUnsignedRightShiftR, callAsConstructor, callAsConstructor, callAsConstructor, callAsExtends, callAsExtends, callAsExtends, callAsFunction, callAsFunction, castToBoolean, castToExactNumber, castToInexactNumber, castToJavaObject, elementAt, elementsAt, getMember, getMember, getMember, getMember, getMember, getMember, getMonitor, getType, getTypeMember, getTypeMember, isA, length, memberSet, noSuchMember, opAssign, populateMemberSet, populateTypeMemberSet, readExternal, toString, unhand, uopBitwiseNot, uopDecrement, uopIncrement, uopLogicalNot, uopMinus, uopPlus, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Value TYPE
The type object for an script java method.


PARENT_TYPE_NAME

public static final java.lang.String PARENT_TYPE_NAME
See Also:
Constant Field Values

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

MEMBER_NAMES

public static final java.lang.String[] MEMBER_NAMES
Method Detail

getTypeImpl

protected Value getTypeImpl()
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().

Specified by:
getTypeImpl in class Value
Returns:
the object's type

run

public void run()
Implementing the runnable interface.

Specified by:
run in interface java.lang.Runnable

hashCode

public int hashCode()
Return a hash code value for this object.

Returns:
a hash code value
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Compare two objects for equality.

Parameters:
obj - the object to compare to this object
Returns:
true if equals, else false
See Also:
Object.equals(java.lang.Object)

bopEquals

public Value bopEquals(Value val)
                throws PackagedScriptObjectException
Perform the "==" operation.

Overrides:
bopEquals in class Value
Parameters:
val - the other value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

bopNotEquals

public Value bopNotEquals(Value val)
                   throws PackagedScriptObjectException
Perform the "!=" operation.

Overrides:
bopNotEquals in class Value
Parameters:
val - the other value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

castToString

public java.lang.String castToString()
                              throws PackagedScriptObjectException
Convert this object to a native java String value.

Overrides:
castToString in class Value
Returns:
a String value
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

callAsFunction

public Value callAsFunction(StackFrame sf,
                            MemberTable args)
                     throws PackagedScriptObjectException
Call this object as a function.

Overrides:
callAsFunction in class Value
Parameters:
sf - the current stack frame
args - the arguments to the function, or null if none
Returns:
the value returned by the function
Throws:
PackagedScriptObjectException
See Also:
Function