com.caucho.quercus.env
Class NullValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.NullValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultValue, NullThisValue, QuercusClass, UnexpectedValue, UnsetValue

public class NullValue
extends Value
implements java.io.Serializable

Represents a PHP null value.

See Also:
Serialized Form

Field Summary
static NullValue NULL
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
protected NullValue()
           
 
Method Summary
 Value add(long lLong)
          Adds to the following value.
 Value append(Value index, Value value)
          Sets the array value, returning the new array, e.g.
 StringValue appendTo(BinaryBuilderValue sb)
          Append to a binary builder.
 StringValue appendTo(LargeStringBuilderValue sb)
          Append to a string builder.
 StringValue appendTo(StringBuilderValue sb)
          Append to a string builder.
 StringValue appendTo(UnicodeBuilderValue sb)
          Append to a unicode builder.
 int cmp(Value rValue)
          Returns true for equality
static NullValue create()
          Returns the null value singleton.
 boolean eq(Value rValue)
          Returns true for equality
 boolean eql(Value rValue)
          Returns true for equality
 void generate(java.io.PrintWriter out)
          Generates code to recreate the expression.
 Value getArray()
          Returns a new array.
 int getCount(Env env)
          Returns the count, as returned by the global php count() function
 Value getObject(Env env)
          Returns a new object.
 int getSize()
          Returns the array size.
 java.lang.String getType()
          Returns the type.
 ValueType getValueType()
          Returns the ValueType.
 int hashCode()
           
 boolean isEmpty()
          Returns true if the value is empty
 boolean isNull()
          Returns true for a null.
 boolean isset()
          Returns true for a set type.
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
 void print(Env env)
          Prints the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 Value sub(long rLong)
          Subtracts the following value.
 Value toArgRef()
          Converts to a reference variable
 Value toArray()
          Converts to an array
 ArrayValue toArrayValue(Env env)
          Casts to an array.
 Value toAutoArray()
          Converts to an array if null.
 Value toAutoObject(Env env)
          Converts to an object if null.
 java.math.BigDecimal toBigDecimal()
          Converts to a Java BigDecimal.
 java.math.BigInteger toBigInteger()
          Converts to a Java BigInteger.
 boolean toBoolean()
          Converts to a boolean.
 int toBooleanMarshalCost()
          Cost to convert to a boolean
 int toByteMarshalCost()
          Cost to convert to a byte
 java.lang.String toDebugString()
           
 double toDouble()
          Converts to a double.
 int toDoubleMarshalCost()
          Cost to convert to a double
 int toIntegerMarshalCost()
          Cost to convert to an integer
 java.lang.Boolean toJavaBoolean()
          Converts to a java boolean object.
 java.lang.Byte toJavaByte()
          Converts to a java Byte object.
 java.util.Calendar toJavaCalendar()
          Converts to a Java Calendar.
 java.lang.Character toJavaCharacter()
          Converts to a java Character object.
 java.util.Collection toJavaCollection(Env env, java.lang.Class type)
          Converts to a java object.
 java.util.Date toJavaDate()
          Converts to a Java Date.
 java.lang.Double toJavaDouble()
          Converts to a java Double object.
 java.lang.Float toJavaFloat()
          Converts to a java Float object.
 java.lang.Integer toJavaInteger()
          Converts to a java Integer object.
 java.util.List toJavaList(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Long toJavaLong()
          Converts to a java Long object.
 java.util.Map toJavaMap(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Object toJavaObject()
          Converts to an object.
 java.lang.Object toJavaObject(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Object toJavaObjectNotNull(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Short toJavaShort()
          Converts to a java Short object.
 java.lang.String toJavaString()
          Converts to a java String object.
 java.net.URL toJavaURL(Env env)
          Converts to a Java URL.
 Value toKey()
          Converts to a key.
 long toLong()
          Converts to a long.
 int toLongMarshalCost()
          Cost to convert to a long
 Value toObject(Env env)
          Converts to an object.
 int toShortMarshalCost()
          Cost to convert to a short
 java.lang.String toString()
          Converts to a string.
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 StringValue toStringValue()
          Converts to a StringValue.
 java.lang.Object valuesToArray(Env env, java.lang.Class elementType)
          Takes the values of this array, unmarshalls them to objects of type elementType, and puts them in a java array.
 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, addOne, 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, eqValue, findFunction, geq, get, getArg, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getQuercusClass, getRef, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getVar, gt, hasCurrent, increment, initField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, isDouble, isDoubleConvertible, isFieldInit, isLong, isLongConvertible, isNumberConvertible, isNumeric, isObject, isResource, isset, issetField, issetThisField, isString, isUnicode, isVar, key, keyExists, length, 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, subOne, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toByteArrayMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toInternString, toJavaObjectMarshalCost, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongValue, toRef, toRefValue, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, varDump
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final NullValue NULL
Constructor Detail

NullValue

protected NullValue()
Method Detail

create

public static NullValue create()
Returns the null value singleton.


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

isset

public boolean isset()
Returns true for a set type.

Overrides:
isset in class Value

isEmpty

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

Overrides:
isEmpty in class Value

toDoubleMarshalCost

public int toDoubleMarshalCost()
Cost to convert to a double

Overrides:
toDoubleMarshalCost in class Value

toLongMarshalCost

public int toLongMarshalCost()
Cost to convert to a long

Overrides:
toLongMarshalCost in class Value

toIntegerMarshalCost

public int toIntegerMarshalCost()
Cost to convert to an integer

Overrides:
toIntegerMarshalCost in class Value

toShortMarshalCost

public int toShortMarshalCost()
Cost to convert to a short

Overrides:
toShortMarshalCost in class Value

toByteMarshalCost

public int toByteMarshalCost()
Cost to convert to a byte

Overrides:
toByteMarshalCost in class Value

toBooleanMarshalCost

public int toBooleanMarshalCost()
Cost to convert to a boolean

Overrides:
toBooleanMarshalCost in class Value

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class Value

isNull

public boolean isNull()
Returns true for a null.

Overrides:
isNull 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
Parameters:
env -

toStringBuilder

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

Overrides:
toStringBuilder in class Value

toJavaObject

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

Overrides:
toJavaObject in class Value

toJavaObject

public java.lang.Object toJavaObject(Env env,
                                     java.lang.Class type)
Converts to a java object.

Overrides:
toJavaObject in class Value

toJavaObjectNotNull

public java.lang.Object toJavaObjectNotNull(Env env,
                                            java.lang.Class type)
Converts to a java object.

Overrides:
toJavaObjectNotNull in class Value

toJavaBoolean

public java.lang.Boolean toJavaBoolean()
Converts to a java boolean object.

Overrides:
toJavaBoolean in class Value

toJavaByte

public java.lang.Byte toJavaByte()
Converts to a java Byte object.

Overrides:
toJavaByte in class Value

toJavaShort

public java.lang.Short toJavaShort()
Converts to a java Short object.

Overrides:
toJavaShort in class Value

toJavaInteger

public java.lang.Integer toJavaInteger()
Converts to a java Integer object.

Overrides:
toJavaInteger in class Value

toJavaLong

public java.lang.Long toJavaLong()
Converts to a java Long object.

Overrides:
toJavaLong in class Value

toJavaFloat

public java.lang.Float toJavaFloat()
Converts to a java Float object.

Overrides:
toJavaFloat in class Value

toJavaDouble

public java.lang.Double toJavaDouble()
Converts to a java Double object.

Overrides:
toJavaDouble in class Value

toJavaCharacter

public java.lang.Character toJavaCharacter()
Converts to a java Character object.

Overrides:
toJavaCharacter in class Value

toJavaString

public java.lang.String toJavaString()
Converts to a java String object.

Overrides:
toJavaString in class Value

toJavaCollection

public java.util.Collection toJavaCollection(Env env,
                                             java.lang.Class type)
Converts to a java object.

Overrides:
toJavaCollection in class Value

toJavaList

public java.util.List toJavaList(Env env,
                                 java.lang.Class type)
Converts to a java object.

Overrides:
toJavaList in class Value

toJavaMap

public java.util.Map toJavaMap(Env env,
                               java.lang.Class type)
Converts to a java object.

Overrides:
toJavaMap in class Value

toJavaCalendar

public java.util.Calendar toJavaCalendar()
Converts to a Java Calendar.

Overrides:
toJavaCalendar in class Value

toJavaDate

public java.util.Date toJavaDate()
Converts to a Java Date.

Overrides:
toJavaDate in class Value

toJavaURL

public java.net.URL toJavaURL(Env env)
Converts to a Java URL.

Overrides:
toJavaURL in class Value

toBigDecimal

public java.math.BigDecimal toBigDecimal()
Converts to a Java BigDecimal.

Overrides:
toBigDecimal in class Value

toBigInteger

public java.math.BigInteger toBigInteger()
Converts to a Java BigInteger.

Overrides:
toBigInteger in class Value

valuesToArray

public java.lang.Object valuesToArray(Env env,
                                      java.lang.Class elementType)
Takes the values of this array, unmarshalls them to objects of type elementType, and puts them in a java array.

Overrides:
valuesToArray in class Value

toObject

public Value toObject(Env env)
Converts to an object.

Overrides:
toObject in class Value

toArray

public Value toArray()
Converts to an array

Overrides:
toArray in class Value

toAutoArray

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

Overrides:
toAutoArray 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

toArrayValue

public ArrayValue toArrayValue(Env env)
Casts to an array.

Overrides:
toArrayValue in class Value

toStringValue

public StringValue toStringValue()
Converts to a StringValue.

Overrides:
toStringValue in class Value

getCount

public int getCount(Env env)
Description copied from class: Value
Returns the count, as returned by the global php count() function

Overrides:
getCount in class Value

getSize

public int getSize()
Returns the array size.

Overrides:
getSize in class Value

toAutoObject

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

Overrides:
toAutoObject in class Value

toArgRef

public Value toArgRef()
Converts to a reference variable

Overrides:
toArgRef in class Value

toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class Value

eql

public boolean eql(Value rValue)
Returns true for equality

Overrides:
eql in class Value

add

public Value add(long lLong)
Adds to the following value.

Overrides:
add in class Value

sub

public Value sub(long rLong)
Subtracts the following value.

Overrides:
sub 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

print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

serialize

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

Overrides:
serialize in class Value

varExport

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

Overrides:
varExport in class Value

jsonEncode

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

Overrides:
jsonEncode in class Value

getArray

public Value getArray()
Returns a new array.

Overrides:
getArray in class Value

appendTo

public StringValue appendTo(BinaryBuilderValue sb)
Append to a binary builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(UnicodeBuilderValue sb)
Append to a unicode builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(StringBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(LargeStringBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class Value

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

getObject

public Value getObject(Env env)
Returns a new object.

Overrides:
getObject in class Value

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

hashCode

public int hashCode()
Overrides:
hashCode in class Value