oscript.data
Class OBoolean

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

public class OBoolean
extends OObject
implements java.io.Externalizable

A boolean type, can have either the value true or false.

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

Field Summary
static OBoolean FALSE
           
static java.lang.String[] MEMBER_NAMES
           
static java.lang.String PARENT_TYPE_NAME
           
static OBoolean TRUE
           
static Value TYPE
          The type object for an instance of Boolean.
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
OBoolean()
           
OBoolean(boolean booleanVal)
          Class Constructor
OBoolean(MemberTable args)
          Class Constructor.
 
Method Summary
 Value bopEquals(Value val)
          Perform the "==" operation.
 Value bopEqualsR(Value val, PackagedScriptObjectException e)
           
 Value bopLogicalAnd(Value val)
          Perform the logical AND operation.
 Value bopLogicalAndR(Value val, PackagedScriptObjectException e)
           
 Value bopLogicalOr(Value val)
          Perform the logical OR operation.
 Value bopLogicalOrR(Value val, PackagedScriptObjectException e)
           
 Value bopNotEquals(Value val)
          Perform the "!=" operation.
 Value bopNotEqualsR(Value val, PackagedScriptObjectException e)
           
 boolean castToBoolean()
          Convert this object to a native java boolean 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.
protected  Value getTypeImpl()
          Get the type of this object.
static OBoolean makeBoolean(boolean booleanVal)
           
 void readExternal(java.io.ObjectInput in)
          Derived class that implements Externalizable must call this if it overrides it.
 Value uopLogicalNot()
          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, bopBitwiseAnd, bopBitwiseAndR, bopBitwiseOr, bopBitwiseOrR, bopBitwiseXor, bopBitwiseXorR, bopCast, bopCastR, bopDivide, bopDivideR, bopGreaterThan, bopGreaterThanOrEquals, bopGreaterThanOrEqualsR, bopGreaterThanR, bopInstanceOf, bopInstanceOfR, bopLeftShift, bopLeftShiftR, bopLessThan, bopLessThanOrEquals, bopLessThanOrEqualsR, bopLessThanR, bopMinus, bopMinusR, bopMultiply, bopMultiplyR, bopPlus, bopPlusR, bopRemainder, bopRemainderR, bopSignedRightShift, bopSignedRightShiftR, bopUnsignedRightShift, bopUnsignedRightShiftR, callAsConstructor, callAsConstructor, callAsConstructor, callAsExtends, callAsExtends, callAsExtends, callAsFunction, callAsFunction, callAsFunction, castToExactNumber, castToInexactNumber, elementAt, elementsAt, getMember, getMember, getMember, getMember, getMember, getMonitor, getType, getTypeMember, getTypeMember, isA, length, memberSet, noSuchMember, opAssign, populateTypeMemberSet, toString, unhand, uopBitwiseNot, uopDecrement, uopIncrement, uopMinus, uopPlus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Value TYPE
The type object for an instance of Boolean.


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

TRUE

public static final OBoolean TRUE

FALSE

public static final OBoolean FALSE
Constructor Detail

OBoolean

public OBoolean()

OBoolean

public OBoolean(boolean booleanVal)
Class Constructor

Parameters:
booleanVal - the value of this boolean

OBoolean

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

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

makeBoolean

public static final OBoolean makeBoolean(boolean booleanVal)

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

castToBoolean

public boolean castToBoolean()
                      throws PackagedScriptObjectException
Convert this object to a native java boolean value.

Overrides:
castToBoolean in class Value
Returns:
a boolean value
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 OObject
Returns:
a String 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

bopLogicalOr

public Value bopLogicalOr(Value val)
                   throws PackagedScriptObjectException
Perform the logical OR operation.

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

bopLogicalOrR

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

bopLogicalAnd

public Value bopLogicalAnd(Value val)
                    throws PackagedScriptObjectException
Perform the logical AND operation.

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

bopLogicalAndR

public Value bopLogicalAndR(Value val,
                            PackagedScriptObjectException e)
                     throws PackagedScriptObjectException
Overrides:
bopLogicalAndR 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

uopLogicalNot

public Value uopLogicalNot()
                    throws PackagedScriptObjectException
Perform the "!" operation.

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