com.caucho.quercus.env
Class ObjectValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ObjectValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CompiledObjectValue, JavaValue, ObjectExtValue

public abstract class ObjectValue
extends Value

Represents a Quercus object value.

See Also:
Serialized Form

Field Summary
protected  java.lang.String _className
           
protected  java.lang.String _incompleteObjectName
           
protected  QuercusClass _quercusClass
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
protected ObjectValue()
           
protected ObjectValue(QuercusClass quercusClass)
           
 
Method Summary
 Value append(Value index, Value value)
          Sets the array value, returning the new array, e.g.
 Value call(Env env, Value[] args)
          Call for callable.
 int cmpObject(ObjectValue rValue)
          Compare two objects
abstract  java.util.Set<? extends java.util.Map.Entry<Value,Value>> entrySet()
          Returns a Set of entries.
 boolean eq(Value rValue)
          Returns true for equality
 Value get(Value key)
          Returns the array value with the given key.
 java.lang.String getClassName()
          Returns the value's class name.
 int getCount(Env env)
          Returns the count value with the given key.
 java.lang.String getIncompleteObjectName()
           
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator(Env env)
          Returns an iterator for the key => value pairs.
 java.util.Iterator<Value> getKeyIterator(Env env)
          Returns an iterator for the keys.
 java.lang.String getName()
          Returns the class name.
 java.lang.String getParentClassName()
          Returns the parent class
 QuercusClass getQuercusClass()
          Returns the backing QuercusClass.
 java.lang.String getType()
          Returns the type.
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the values.
 void initField(StringValue key, Value value, FieldVisibility visibility)
          Initializes a new field, does not call __set if it is defined.
 void initObject(Env env, QuercusClass cls)
           
 boolean isA(java.lang.String name)
          Returns true for an implementation of a class
 boolean isCallable(Env env)
          The object is callable if it has an __invoke method
 boolean isIncompleteObject()
           
 boolean isObject()
          Returns true for an object.
 boolean isset(Value key)
          Return true if set
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
 Value put(Value value)
          Appends a new array value
 Value put(Value key, Value value)
          Sets the array value with the given key.
 Value putField(Env env, java.lang.String key, long value)
          Adds a new value.
 Value putField(Env env, java.lang.String key, java.lang.String value)
          Adds a new value.
 Value putField(Env env, java.lang.String key, Value value)
          Adds a new value.
 Value putField(java.lang.String key, double value)
          Adds a new value.
 Value putField(java.lang.String key, long value)
          Adds a new value.
 Value putField(java.lang.String key, java.lang.String value)
          Adds a new value.
 Value remove(Value key)
          Unsets the array value
 void setIncompleteObjectName(java.lang.String name)
           
protected  void setQuercusClass(QuercusClass cl)
           
 Value toAutoArray()
          Converts to an array if null.
 boolean toBoolean()
          Converts to a boolean.
 double toDouble()
          Converts to a double.
 long toLong()
          Converts to a long.
 void varDumpObject(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 
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, 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, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eql, eqValue, findFunction, generate, geq, getArg, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getKeyArray, getObject, getObject, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueType, getVar, gt, hasCurrent, hashCode, increment, isA, isArray, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isEmpty, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, 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, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, putField, putField, putObject, putThisField, putThisField, putVar, reset, rshift, serialize, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toKey, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump, varDumpImpl, varExport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_quercusClass

protected transient QuercusClass _quercusClass

_className

protected java.lang.String _className

_incompleteObjectName

protected java.lang.String _incompleteObjectName
Constructor Detail

ObjectValue

protected ObjectValue()

ObjectValue

protected ObjectValue(QuercusClass quercusClass)
Method Detail

setQuercusClass

protected void setQuercusClass(QuercusClass cl)

getQuercusClass

public QuercusClass getQuercusClass()
Description copied from class: Value
Returns the backing QuercusClass.

Overrides:
getQuercusClass in class Value

isIncompleteObject

public boolean isIncompleteObject()

getIncompleteObjectName

public java.lang.String getIncompleteObjectName()

setIncompleteObjectName

public void setIncompleteObjectName(java.lang.String name)

initObject

public void initObject(Env env,
                       QuercusClass cls)

getClassName

public java.lang.String getClassName()
Returns the value's class name.

Overrides:
getClassName in class Value

entrySet

public abstract java.util.Set<? extends java.util.Map.Entry<Value,Value>> entrySet()
Returns a Set of entries.


getName

public java.lang.String getName()
Returns the class name.


getParentClassName

public java.lang.String getParentClassName()
Returns the parent class


isObject

public boolean isObject()
Returns true for an object.

Overrides:
isObject in class Value

isCallable

public boolean isCallable(Env env)
The object is callable if it has an __invoke method

Overrides:
isCallable in class Value

getType

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

Overrides:
getType in class Value

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class Value

isA

public boolean isA(java.lang.String name)
Returns true for an implementation of a class

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

toAutoArray

public Value toAutoArray()
Description copied from class: Value
Converts to an array if null.

Overrides:
toAutoArray in class Value

get

public Value get(Value key)
Returns the array value with the given key.

Overrides:
get in class Value

put

public Value put(Value key,
                 Value value)
Sets the array value with the given key.

Overrides:
put in class Value

put

public Value put(Value value)
Appends a new array value

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

isset

public boolean isset(Value key)
Return true if set

Overrides:
isset in class Value

remove

public Value remove(Value key)
Unsets the array value

Overrides:
remove in class Value

getIterator

public java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator(Env env)
Returns an iterator for the key => value pairs.

Overrides:
getIterator in class Value

getKeyIterator

public java.util.Iterator<Value> getKeyIterator(Env env)
Returns an iterator for the keys.

Overrides:
getKeyIterator in class Value

getValueIterator

public java.util.Iterator<Value> getValueIterator(Env env)
Returns an iterator for the values.

Overrides:
getValueIterator in class Value

getCount

public int getCount(Env env)
Returns the count value with the given key.

Overrides:
getCount in class Value

putField

public Value putField(java.lang.String key,
                      java.lang.String value)
Adds a new value.


putField

public Value putField(Env env,
                      java.lang.String key,
                      java.lang.String value)
Adds a new value.


putField

public Value putField(java.lang.String key,
                      long value)
Adds a new value.


putField

public Value putField(Env env,
                      java.lang.String key,
                      long value)
Adds a new value.


putField

public Value putField(Env env,
                      java.lang.String key,
                      Value value)
Adds a new value.

Overrides:
putField in class Value

initField

public void initField(StringValue key,
                      Value value,
                      FieldVisibility visibility)
Initializes a new field, does not call __set if it is defined.

Overrides:
initField in class Value

putField

public Value putField(java.lang.String key,
                      double value)
Adds a new value.


eq

public boolean eq(Value rValue)
Returns true for equality

Overrides:
eq in class Value

cmpObject

public int cmpObject(ObjectValue rValue)
Compare two objects


call

public Value call(Env env,
                  Value[] args)
Call for callable.

Overrides:
call in class Value

varDumpObject

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

jsonEncode

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

Overrides:
jsonEncode in class Value