oscript.data
Class OExactNumber

java.lang.Object
  extended byoscript.data.Value
      extended byoscript.data.OObject
          extended byoscript.data.OExactNumber
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class OExactNumber
extends OObject
implements java.io.Externalizable

An exact number. An OExactNumber is immutable, meaning once the instance is constructed, it won't change.

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 instance of ExactNumber.
static java.lang.String 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
OExactNumber()
           
OExactNumber(long longVal)
          Class Constructor.
OExactNumber(MemberTable args)
          Class Constructor.
 
Method Summary
static Value _bopCast(Value val)
           
 Value bopBitwiseAnd(Value val)
          Perform the bitwise AND operation.
 Value bopBitwiseAndR(Value val, PackagedScriptObjectException e)
           
 Value bopBitwiseOr(Value val)
          Perform the bitwise OR operation.
 Value bopBitwiseOrR(Value val, PackagedScriptObjectException e)
           
 Value bopBitwiseXor(Value val)
          Perform the bitwise XOR operation.
 Value bopBitwiseXorR(Value val, PackagedScriptObjectException e)
           
 Value bopDivide(Value val)
          Perform the "/" operation.
 Value bopDivideR(Value val, PackagedScriptObjectException e)
           
 Value bopEquals(Value val)
          Perform the "==" operation.
 Value bopEqualsR(Value val, PackagedScriptObjectException e)
           
 Value bopGreaterThan(Value val)
          Perform the ">" operation.
 Value bopGreaterThanOrEquals(Value val)
          Perform the ">=" operation.
 Value bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e)
           
 Value bopGreaterThanR(Value val, PackagedScriptObjectException e)
           
 Value bopLeftShift(Value val)
          Perform the "<<" operation.
 Value bopLeftShiftR(Value val, PackagedScriptObjectException e)
           
 Value bopLessThan(Value val)
          Perform the "<" operation.
 Value bopLessThanOrEquals(Value val)
          Perform the "<=" operation.
 Value bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e)
           
 Value bopLessThanR(Value val, PackagedScriptObjectException e)
           
 Value bopMinus(Value val)
          Perform the "-" operation.
 Value bopMinusR(Value val, PackagedScriptObjectException e)
           
 Value bopMultiply(Value val)
          Perform the "*" operation.
 Value bopMultiplyR(Value val, PackagedScriptObjectException e)
           
 Value bopNotEquals(Value val)
          Perform the "!=" operation.
 Value bopNotEqualsR(Value val, PackagedScriptObjectException e)
           
 Value bopPlus(Value val)
          Perform the "+" operation.
 Value bopPlusR(Value val, PackagedScriptObjectException e)
           
 Value bopRemainder(Value val)
          Perform the "%" operation.
 Value bopRemainderR(Value val, PackagedScriptObjectException e)
           
 Value bopSignedRightShift(Value val)
          Perform the ">>" operation.
 Value bopSignedRightShiftR(Value val, PackagedScriptObjectException e)
           
 Value bopUnsignedRightShift(Value val)
          Perform the ">>>" operation.
 Value bopUnsignedRightShiftR(Value val, PackagedScriptObjectException e)
           
 byte byteValue()
           
 long castToExactNumber()
          Convert this object to a native java long value.
 double castToInexactNumber()
          Convert this object to a native java double value.
 java.lang.Object castToJavaObject()
          Convert this object to a native java Object value.
 java.lang.String castToString()
          Convert this object to a native java String value.
 char charValue()
           
 boolean equals(java.lang.Object obj)
          Compare two objects for equality.
 float floatValue()
           
protected  Value getTypeImpl()
          Get the type of this object.
 int hashCode()
          Return a hash code value for this object.
 int intValue()
           
static OExactNumber makeExactNumber(long longVal)
           
 void readExternal(java.io.ObjectInput in)
          Derived class that implements Externalizable must call this if it overrides it.
 short shortValue()
           
 Value uopBitwiseNot()
          Perform the "~" operation.
 Value uopDecrement()
          Perform the "--" operation.
 Value uopIncrement()
          Perform the "++" operation.
 Value uopMinus()
          Perform the "-" operation.
 Value uopPlus()
          Perform the "+" operation.
 void writeExternal(java.io.ObjectOutput out)
          Derived class that implements Externalizable must call this if it overrides it.
 
Methods inherited from class oscript.data.OObject
getMember, populateMemberSet
 
Methods inherited from class oscript.data.Value
_getTypeMember, _populateTypeMemberSet, bopCast, bopCastR, bopInstanceOf, bopInstanceOfR, bopLogicalAnd, bopLogicalAndR, bopLogicalOr, bopLogicalOrR, callAsConstructor, callAsConstructor, callAsConstructor, callAsExtends, callAsExtends, callAsExtends, callAsFunction, callAsFunction, callAsFunction, castToBoolean, elementAt, elementsAt, getMember, getMember, getMember, getMember, getMember, getMonitor, getType, getTypeMember, getTypeMember, isA, length, memberSet, noSuchMember, opAssign, populateTypeMemberSet, toString, unhand, uopLogicalNot
 
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 instance of ExactNumber.


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
Constructor Detail

OExactNumber

public OExactNumber()

OExactNumber

public OExactNumber(long longVal)
Class Constructor.

Parameters:
longVal - the longeger value corresponding to this number

OExactNumber

public OExactNumber(MemberTable args)
Class Constructor. This is the constructor that is called via a BuiltinType instance.

Parameters:
args - arguments to this constructor
Throws:
PackagedScriptObjectException(Exception) - if wrong number of args
Method Detail

makeExactNumber

public static final OExactNumber makeExactNumber(long longVal)

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Derived class that implements Externalizable must call this if it overrides it. It should override it to save/restore it's own state.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Value
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Derived class that implements Externalizable must call this if it overrides it. It should override it to save/restore it's own state.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Value
Throws:
java.io.IOException

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().

Overrides:
getTypeImpl in class OObject
Returns:
the object's type

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)

castToString

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

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

castToExactNumber

public long castToExactNumber()
                       throws PackagedScriptObjectException
Convert this object to a native java long value.

Overrides:
castToExactNumber in class Value
Returns:
a long value
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

_bopCast

public static Value _bopCast(Value val)

castToInexactNumber

public double castToInexactNumber()
                           throws PackagedScriptObjectException
Convert this object to a native java double value.

Overrides:
castToInexactNumber in class Value
Returns:
a double value
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

castToJavaObject

public java.lang.Object castToJavaObject()
                                  throws PackagedScriptObjectException
Convert this object to a native java Object value.

Overrides:
castToJavaObject in class Value
Returns:
a java object
Throws:
PackagedScriptObjectException(NoSuchMemberException)
PackagedScriptObjectException

intValue

public int intValue()

floatValue

public float floatValue()

shortValue

public short shortValue()

charValue

public char charValue()

byteValue

public byte byteValue()

bopBitwiseOr

public Value bopBitwiseOr(Value val)
                   throws PackagedScriptObjectException
Perform the bitwise OR operation.

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

bopBitwiseOrR

public Value bopBitwiseOrR(Value val,
                           PackagedScriptObjectException e)
                    throws PackagedScriptObjectException
Overrides:
bopBitwiseOrR in class Value
Throws:
PackagedScriptObjectException

bopBitwiseXor

public Value bopBitwiseXor(Value val)
                    throws PackagedScriptObjectException
Perform the bitwise XOR operation.

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

bopBitwiseXorR

public Value bopBitwiseXorR(Value val,
                            PackagedScriptObjectException e)
                     throws PackagedScriptObjectException
Overrides:
bopBitwiseXorR in class Value
Throws:
PackagedScriptObjectException

bopBitwiseAnd

public Value bopBitwiseAnd(Value val)
                    throws PackagedScriptObjectException
Perform the bitwise AND operation.

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

bopBitwiseAndR

public Value bopBitwiseAndR(Value val,
                            PackagedScriptObjectException e)
                     throws PackagedScriptObjectException
Overrides:
bopBitwiseAndR in class Value
Throws:
PackagedScriptObjectException

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

bopEqualsR

public Value bopEqualsR(Value val,
                        PackagedScriptObjectException e)
                 throws PackagedScriptObjectException
Overrides:
bopEqualsR in class Value
Throws:
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

bopNotEqualsR

public Value bopNotEqualsR(Value val,
                           PackagedScriptObjectException e)
                    throws PackagedScriptObjectException
Overrides:
bopNotEqualsR in class Value
Throws:
PackagedScriptObjectException

bopLessThan

public Value bopLessThan(Value val)
                  throws PackagedScriptObjectException
Perform the "<" operation.

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

bopLessThanR

public Value bopLessThanR(Value val,
                          PackagedScriptObjectException e)
                   throws PackagedScriptObjectException
Overrides:
bopLessThanR in class Value
Throws:
PackagedScriptObjectException

bopGreaterThan

public Value bopGreaterThan(Value val)
                     throws PackagedScriptObjectException
Perform the ">" operation.

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

bopGreaterThanR

public Value bopGreaterThanR(Value val,
                             PackagedScriptObjectException e)
                      throws PackagedScriptObjectException
Overrides:
bopGreaterThanR in class Value
Throws:
PackagedScriptObjectException

bopLessThanOrEquals

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

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

bopLessThanOrEqualsR

public Value bopLessThanOrEqualsR(Value val,
                                  PackagedScriptObjectException e)
                           throws PackagedScriptObjectException
Overrides:
bopLessThanOrEqualsR in class Value
Throws:
PackagedScriptObjectException

bopGreaterThanOrEquals

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

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

bopGreaterThanOrEqualsR

public Value bopGreaterThanOrEqualsR(Value val,
                                     PackagedScriptObjectException e)
                              throws PackagedScriptObjectException
Overrides:
bopGreaterThanOrEqualsR in class Value
Throws:
PackagedScriptObjectException

bopLeftShift

public Value bopLeftShift(Value val)
                   throws PackagedScriptObjectException
Perform the "<<" operation.

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

bopLeftShiftR

public Value bopLeftShiftR(Value val,
                           PackagedScriptObjectException e)
                    throws PackagedScriptObjectException
Overrides:
bopLeftShiftR in class Value
Throws:
PackagedScriptObjectException

bopSignedRightShift

public Value bopSignedRightShift(Value val)
                          throws PackagedScriptObjectException
Perform the ">>" operation.

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

bopSignedRightShiftR

public Value bopSignedRightShiftR(Value val,
                                  PackagedScriptObjectException e)
                           throws PackagedScriptObjectException
Overrides:
bopSignedRightShiftR in class Value
Throws:
PackagedScriptObjectException

bopUnsignedRightShift

public Value bopUnsignedRightShift(Value val)
                            throws PackagedScriptObjectException
Perform the ">>>" operation.

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

bopUnsignedRightShiftR

public Value bopUnsignedRightShiftR(Value val,
                                    PackagedScriptObjectException e)
                             throws PackagedScriptObjectException
Overrides:
bopUnsignedRightShiftR in class Value
Throws:
PackagedScriptObjectException

bopPlus

public Value bopPlus(Value val)
              throws PackagedScriptObjectException
Perform the "+" operation.

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

bopPlusR

public Value bopPlusR(Value val,
                      PackagedScriptObjectException e)
               throws PackagedScriptObjectException
Overrides:
bopPlusR in class Value
Throws:
PackagedScriptObjectException

bopMinus

public Value bopMinus(Value val)
               throws PackagedScriptObjectException
Perform the "-" operation.

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

bopMinusR

public Value bopMinusR(Value val,
                       PackagedScriptObjectException e)
                throws PackagedScriptObjectException
Overrides:
bopMinusR in class Value
Throws:
PackagedScriptObjectException

bopMultiply

public Value bopMultiply(Value val)
                  throws PackagedScriptObjectException
Perform the "*" operation.

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

bopMultiplyR

public Value bopMultiplyR(Value val,
                          PackagedScriptObjectException e)
                   throws PackagedScriptObjectException
Overrides:
bopMultiplyR in class Value
Throws:
PackagedScriptObjectException

bopDivide

public Value bopDivide(Value val)
                throws PackagedScriptObjectException
Perform the "/" operation.

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

bopDivideR

public Value bopDivideR(Value val,
                        PackagedScriptObjectException e)
                 throws PackagedScriptObjectException
Overrides:
bopDivideR in class Value
Throws:
PackagedScriptObjectException

bopRemainder

public Value bopRemainder(Value val)
                   throws PackagedScriptObjectException
Perform the "%" operation.

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

bopRemainderR

public Value bopRemainderR(Value val,
                           PackagedScriptObjectException e)
                    throws PackagedScriptObjectException
Overrides:
bopRemainderR in class Value
Throws:
PackagedScriptObjectException

uopIncrement

public Value uopIncrement()
                   throws PackagedScriptObjectException
Perform the "++" operation.

Overrides:
uopIncrement in class Value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

uopDecrement

public Value uopDecrement()
                   throws PackagedScriptObjectException
Perform the "--" operation.

Overrides:
uopDecrement in class Value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

uopPlus

public Value uopPlus()
              throws PackagedScriptObjectException
Perform the "+" operation.

Overrides:
uopPlus in class Value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

uopMinus

public Value uopMinus()
               throws PackagedScriptObjectException
Perform the "-" operation.

Overrides:
uopMinus in class Value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException

uopBitwiseNot

public Value uopBitwiseNot()
                    throws PackagedScriptObjectException
Perform the "~" operation.

Overrides:
uopBitwiseNot in class Value
Returns:
the result
Throws:
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException