com.caucho.quercus.env
Class BooleanValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.BooleanValue
All Implemented Interfaces:
java.io.Serializable

public class BooleanValue
extends Value
implements java.io.Serializable

Represents a PHP boolean value.

See Also:
Serialized Form

Field Summary
static BooleanValue FALSE
           
static BooleanValue TRUE
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Method Summary
 Value append(Value index, Value value)
          Sets the array value, returning the new array, e.g.
 int cmp(Value rValue)
          Returns true for equality
static BooleanValue create(boolean value)
           
static Value create(java.lang.Boolean value)
           
 boolean eq(Value rValue)
          Returns true for equality
 boolean equals(java.lang.Object o)
          Compare for equality.
 void generate(java.io.PrintWriter out)
          Generates code to recreate the expression.
 void generateBoolean(java.io.PrintWriter out)
          Generates code to recreate the expression.
 java.lang.String getType()
          Returns the type.
 ValueType getValueType()
          Returns the ValueType.
 int hashCode()
          Returns the hash code
 boolean isBoolean()
          Returns true for a BooleanValue
 boolean isEmpty()
          Returns true if the value is empty
 boolean isScalar()
          Returns true for a scalar
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
 int length()
          Return the length as a string.
 void print(Env env)
          Prints the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 Value toAutoArray()
          Converts to an array if null.
 Value toAutoObject(Env env)
          Converts to an object if null.
 boolean toBoolean()
          Converts to a boolean.
 int toBooleanMarshalCost()
          Cost to convert to a boolean
 java.lang.String toDebugString()
           
 double toDouble()
          Converts to a double.
 java.lang.Object toJavaObject()
          Converts to a java object.
 Value toKey()
          Converts to a key.
 long toLong()
          Converts to a long.
 java.lang.Object toObject()
          Converts to an object.
 java.lang.String toString()
          Converts to a string.
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 void varExport(java.lang.StringBuilder sb)
          Exports the value.
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, add, addOne, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eql, eqValue, findFunction, geq, get, getArg, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getQuercusClass, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getVar, gt, hasCurrent, increment, initField, isA, isA, isArray, isBinary, isCallable, isDefault, isDouble, isDoubleConvertible, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isObject, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, key, keyExists, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final BooleanValue TRUE

FALSE

public static final BooleanValue FALSE
Method Detail

create

public static BooleanValue create(boolean value)

create

public static Value create(java.lang.Boolean value)

getType

public java.lang.String getType()
Returns the type.

Overrides:
getType in class Value

getValueType

public ValueType getValueType()
Returns the ValueType.

Overrides:
getValueType in class Value

isBoolean

public boolean isBoolean()
Returns true for a BooleanValue

Overrides:
isBoolean in class Value

isScalar

public boolean isScalar()
Returns true for a scalar


toBoolean

public final boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class Value

isEmpty

public boolean isEmpty()
Returns true if the value is empty

Overrides:
isEmpty in class Value

toBooleanMarshalCost

public int toBooleanMarshalCost()
Cost to convert to a boolean

Overrides:
toBooleanMarshalCost in class Value

toLong

public long toLong()
Converts to a long.

Overrides:
toLong in class Value

toDouble

public double toDouble()
Converts to a double.

Overrides:
toDouble in class Value

toString

public java.lang.String toString()
Converts to a string.

Overrides:
toString in class java.lang.Object

toStringBuilder

public StringValue toStringBuilder(Env env)
Converts to a string builder

Overrides:
toStringBuilder in class Value

toObject

public java.lang.Object toObject()
Converts to an object.


toJavaObject

public java.lang.Object toJavaObject()
Converts to a java object.

Overrides:
toJavaObject in class Value

toAutoArray

public Value toAutoArray()
Converts to an array if null.

Overrides:
toAutoArray in class Value

toAutoObject

public Value toAutoObject(Env env)
Converts to an object if null.

Overrides:
toAutoObject in class Value

append

public Value append(Value index,
                    Value value)
Sets the array value, returning the new array, e.g. to handle string update ($a[0] = 'A'). Creates an array automatically if necessary.

Overrides:
append in class Value

toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class Value

eq

public boolean eq(Value rValue)
Returns true for equality

Overrides:
eq in class Value

cmp

public int cmp(Value rValue)
Returns true for equality

Overrides:
cmp in class Value

length

public int length()
Return the length as a string.

Overrides:
length in class Value

print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

generate

public void generate(java.io.PrintWriter out)
              throws java.io.IOException
Generates code to recreate the expression.

Overrides:
generate in class Value
Parameters:
out - the writer to the Java source code.
Throws:
java.io.IOException

generateBoolean

public void generateBoolean(java.io.PrintWriter out)
                     throws java.io.IOException
Generates code to recreate the expression.

Parameters:
out - the writer to the Java source code.
Throws:
java.io.IOException

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb)
Serializes the value.

Overrides:
serialize in class Value

jsonEncode

public void jsonEncode(Env env,
                       StringValue sb)
Encodes the value in JSON.

Overrides:
jsonEncode in class Value

varExport

public void varExport(java.lang.StringBuilder sb)
Exports the value.

Overrides:
varExport in class Value

hashCode

public int hashCode()
Returns the hash code

Overrides:
hashCode in class Value

equals

public boolean equals(java.lang.Object o)
Compare for equality.

Overrides:
equals in class java.lang.Object

toDebugString

public java.lang.String toDebugString()
Overrides:
toDebugString in class Value

varDumpImpl

public void varDumpImpl(Env env,
                        WriteStream out,
                        int depth,
                        java.util.IdentityHashMap<Value,java.lang.String> valueSet)
                 throws java.io.IOException
Overrides:
varDumpImpl in class Value
Throws:
java.io.IOException