com.caucho.quercus.env
Class ArgRef

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

public class ArgRef
extends Value
implements java.io.Serializable

Represents a reference to a PHP variable in a function call.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
ArgRef(Var var)
           
 
Method Summary
 Value abs()
          Absolute value.
 Value add(long rValue)
          Adds to the following value.
 Value add(Value rValue)
          Adds to the following value.
 Value append(Value index, Value value)
          Sets the array value, returning the new array, e.g.
 Value callMethod(Env env, StringValue methodName, int hash)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value[] args)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
          Evaluates a method with 3 args.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method with 4 args.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates a method with 5 args.
 Value callMethodRef(Env env, StringValue methodName, int hash)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value[] args)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
          Evaluates a method with 3 args.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method with 4 args.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates a method with 5 args.
 Value containsKey(Value key)
          Returns the corresponding value if this array contains the given key
 Value copy()
          Copy the value.
 Value copyArrayItem()
          Copy as an array item
 Value current()
          Returns the current value
 Value div(Value rValue)
          Divides the following value.
 boolean eql(Value rValue)
          Returns true for equality
 Value get(Value index)
          Returns the array ref.
 Value getArray()
          Returns the value for a field, creating an array if the field is unset.
 Value getArray(Value index)
          Returns the value for a field, creating an array if the field is unset.
 int getCount(Env env)
          Returns the count, as returned by the global php count() function
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator(Env env)
          Returns an iterator for the key => value pairs.
 Value[] getKeyArray(Env env)
          Returns the field keys.
 java.util.Iterator<Value> getKeyIterator(Env env)
          Returns an iterator for the field keys.
 int getSize()
          Returns the array/object size
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the field values.
 Var getVar(Value index)
          Returns the array ref.
 boolean hasCurrent()
          Returns true if there are more elements.
 Value increment(int incr)
          Increment the following value.
 boolean isA(java.lang.String name)
          Returns true for an implementation of a class
 boolean isArray()
          Returns true for an array.
 boolean isDouble()
          Returns true for a long-value.
 boolean isDoubleConvertible()
          True to a double.
 boolean isLong()
          Returns true for a long-value.
 boolean isLongConvertible()
          True for a long
 boolean isNumberConvertible()
          True for a number
 boolean isObject()
          Returns true for an object.
 Value key()
          Returns the current key
 Value lshift(Value rValue)
          Shifts left by the value.
 Value mul(long lValue)
          Multiplies to the following value.
 Value mul(Value rValue)
          Multiplies to the following value.
 Value neg()
          Negates the value.
 Value next()
          Returns the next value
 Value postincr(int incr)
          Post-increment the following value.
 Value preincr(int incr)
          Pre-increment the following value.
 void print(Env env)
          Prints the value.
protected  void printRImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 Value put(Value value)
          Returns the array ref.
 Value put(Value index, Value value)
          Returns the array ref.
 Value rshift(Value rValue)
          Shifts right by the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 void serialize(Env env, java.lang.StringBuilder sb, SerializeMap serializeMap)
          Serializes the value.
 Value sub(long rValue)
          Subtracts to the following value.
 Value sub(Value rValue)
          Subtracts to the following value.
 Value toArray()
          Converts to an array.
 ArrayValue toArrayValue(Env env)
          Casts to an array.
 Value toAutoArray()
          Converts to an array if null.
 StringValue toBinaryValue(Env env)
          Converts to a BinaryValue.
 boolean toBoolean()
          Converts to a boolean.
 double toDouble()
          Converts to a double.
 java.io.InputStream toInputStream()
          Returns a byteArrayInputStream for the value.
 java.lang.Object toJavaObject()
          Converts to an object.
 Value toLocalRef()
          Converts to an argument value.
 Value toLocalValue()
          Converts to an argument value.
 Value toLocalValueReadOnly()
          Converts to an argument value.
 Var toLocalVar()
          Converts to an argument value.
 Var toLocalVarDeclAsRef()
          Converts to a reference variable
 long toLong()
          Converts to a long.
 Value toObject(Env env)
          Converts to an object.
 Value toRefValue()
          Converts to an argument value.
 StringValue toString(Env env)
          Converts to a string.
 StringValue toStringBuilder()
          Converts to a string builder
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 StringValue toStringValue()
          Converts to a StringValue.
 StringValue toUnicodeValue(Env env)
          Converts to a UnicodeValue for marshaling, so it will create a UnicodeValue event when unicode.semantics=false.
 Value toValue()
          Converts to a raw value.
 Var toVar()
          Converts to a variable
 void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 java.lang.Object writeReplace()
           
 
Methods inherited from class com.caucho.quercus.env.Value
addOne, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, cmp, copy, copy, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, div, end, eq, eqValue, findFunction, generate, geq, getArg, getBaseIterator, getCallableName, getCalledClass, getClassName, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getObject, getObject, getQuercusClass, getRef, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getType, getValueArray, getValueType, gt, hashCode, initField, isA, isBinary, isBoolean, isCallable, isDefault, isEmpty, isFieldInit, isNull, isNumeric, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, jsonEncode, keyExists, length, leq, lt, mod, nextIndex, pop, pos, postdecr, postincr, predecr, preincr, prev, print, printDepth, printJavaChar, printJavaString, printR, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, subOne, toArgRef, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toKey, toLocalThis, toLongMarshalCost, toLongValue, toRef, toShortMarshalCost, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValueMarshalCost, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump, varExport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgRef

public ArgRef(Var var)
Method Detail

hasCurrent

public boolean hasCurrent()
Description copied from class: Value
Returns true if there are more elements.

Overrides:
hasCurrent in class Value

isA

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

Overrides:
isA in class Value

isLongConvertible

public boolean isLongConvertible()
True for a long

Overrides:
isLongConvertible in class Value

isDoubleConvertible

public boolean isDoubleConvertible()
True to a double.

Overrides:
isDoubleConvertible in class Value

isNumberConvertible

public boolean isNumberConvertible()
True for a number

Overrides:
isNumberConvertible in class Value

isLong

public boolean isLong()
Returns true for a long-value.

Overrides:
isLong in class Value

isDouble

public boolean isDouble()
Returns true for a long-value.

Overrides:
isDouble in class Value

toArrayValue

public ArrayValue toArrayValue(Env env)
Description copied from class: Value
Casts to an array.

Overrides:
toArrayValue in class Value

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean 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 StringValue toString(Env env)
Converts to a string.

Overrides:
toString in class Value
Parameters:
env -

toObject

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

Overrides:
toObject in class Value

toJavaObject

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

Overrides:
toJavaObject in class Value

toValue

public Value toValue()
Converts to a raw value.

Overrides:
toValue in class Value

isObject

public boolean isObject()
Returns true for an object.

Overrides:
isObject in class Value

isArray

public boolean isArray()
Returns true for an array.

Overrides:
isArray in class Value

copy

public Value copy()
Copy the value.

Overrides:
copy in class Value

toLocalValueReadOnly

public Value toLocalValueReadOnly()
Converts to an argument value.

Overrides:
toLocalValueReadOnly in class Value

toLocalValue

public Value toLocalValue()
Converts to an argument value.

Overrides:
toLocalValue in class Value

toLocalRef

public Value toLocalRef()
Converts to an argument value.

Overrides:
toLocalRef in class Value

toLocalVar

public Var toLocalVar()
Converts to an argument value.

Overrides:
toLocalVar in class Value

toRefValue

public Value toRefValue()
Converts to an argument value.

Overrides:
toRefValue in class Value

toVar

public Var toVar()
Converts to a variable

Overrides:
toVar in class Value

toLocalVarDeclAsRef

public Var toLocalVarDeclAsRef()
Converts to a reference variable

Overrides:
toLocalVarDeclAsRef in class Value

toStringValue

public StringValue toStringValue()
Description copied from class: Value
Converts to a StringValue.

Overrides:
toStringValue in class Value

toBinaryValue

public StringValue toBinaryValue(Env env)
Description copied from class: Value
Converts to a BinaryValue.

Overrides:
toBinaryValue in class Value

toUnicodeValue

public StringValue toUnicodeValue(Env env)
Description copied from class: Value
Converts to a UnicodeValue for marshaling, so it will create a UnicodeValue event when unicode.semantics=false.

Overrides:
toUnicodeValue in class Value

toStringBuilder

public StringValue toStringBuilder()
Description copied from class: Value
Converts to a string builder

Overrides:
toStringBuilder in class Value

toStringBuilder

public StringValue toStringBuilder(Env env)
Description copied from class: Value
Converts to a string builder

Overrides:
toStringBuilder in class Value

toInputStream

public java.io.InputStream toInputStream()
Description copied from class: Value
Returns a byteArrayInputStream for the value. See TempBufferStringValue for how this can be overriden

Overrides:
toInputStream in class Value
Returns:
InputStream

append

public Value append(Value index,
                    Value value)
Description copied from class: 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

containsKey

public Value containsKey(Value key)
Description copied from class: Value
Returns the corresponding value if this array contains the given key

Overrides:
containsKey in class Value
Parameters:
key - to search for in the array
Returns:
the value if it is found in the array, NULL otherwise

copyArrayItem

public Value copyArrayItem()
Description copied from class: Value
Copy as an array item

Overrides:
copyArrayItem in class Value

current

public Value current()
Description copied from class: Value
Returns the current value

Overrides:
current in class Value

getArray

public Value getArray()
Description copied from class: Value
Returns the value for a field, creating an array if the field is unset.

Overrides:
getArray in class Value

getArray

public Value getArray(Value index)
Description copied from class: Value
Returns the value for a field, creating an array if the field is unset.

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

getKeyArray

public Value[] getKeyArray(Env env)
Description copied from class: Value
Returns the field keys.

Overrides:
getKeyArray in class Value

key

public Value key()
Description copied from class: Value
Returns the current key

Overrides:
key in class Value

next

public Value next()
Description copied from class: Value
Returns the next value

Overrides:
next in class Value

toArray

public Value toArray()
Description copied from class: Value
Converts to an array.

Overrides:
toArray in class Value

toAutoArray

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

Overrides:
toAutoArray in class Value

neg

public Value neg()
Negates the value.

Overrides:
neg in class Value

add

public Value add(Value rValue)
Adds to the following value.

Overrides:
add in class Value

add

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

Overrides:
add in class Value

preincr

public Value preincr(int incr)
Pre-increment the following value.

Overrides:
preincr in class Value

postincr

public Value postincr(int incr)
Post-increment the following value.

Overrides:
postincr in class Value

increment

public Value increment(int incr)
Increment the following value.

Overrides:
increment in class Value

sub

public Value sub(Value rValue)
Subtracts to the following value.

Overrides:
sub in class Value

sub

public Value sub(long rValue)
Subtracts to the following value.

Overrides:
sub in class Value

mul

public Value mul(Value rValue)
Multiplies to the following value.

Overrides:
mul in class Value

mul

public Value mul(long lValue)
Multiplies to the following value.

Overrides:
mul in class Value

div

public Value div(Value rValue)
Divides the following value.

Overrides:
div in class Value

lshift

public Value lshift(Value rValue)
Shifts left by the value.

Overrides:
lshift in class Value

rshift

public Value rshift(Value rValue)
Shifts right by the value.

Overrides:
rshift in class Value

abs

public Value abs()
Absolute value.

Overrides:
abs in class Value

eql

public boolean eql(Value rValue)
Returns true for equality

Overrides:
eql in class Value

getSize

public int getSize()
Returns the array/object size

Overrides:
getSize in class Value

getIterator

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

Overrides:
getIterator in class Value

getKeyIterator

public java.util.Iterator<Value> getKeyIterator(Env env)
Description copied from class: Value
Returns an iterator for the field keys. The default implementation uses the Iterator returned by Value.getIterator(Env); derived classes may override and provide a more efficient implementation.

Overrides:
getKeyIterator in class Value

getValueIterator

public java.util.Iterator<Value> getValueIterator(Env env)
Description copied from class: Value
Returns an iterator for the field values. The default implementation uses the Iterator returned by Value.getIterator(Env); derived classes may override and provide a more efficient implementation.

Overrides:
getValueIterator in class Value

get

public Value get(Value index)
Returns the array ref.

Overrides:
get in class Value

getVar

public Var getVar(Value index)
Returns the array ref.

Overrides:
getVar in class Value

put

public Value put(Value index,
                 Value value)
Returns the array ref.

Overrides:
put in class Value

put

public Value put(Value value)
Returns the array ref.

Overrides:
put in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value[] args)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3)
Evaluates a method with 3 args.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4)
Evaluates a method with 4 args.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4,
                        Value a5)
Evaluates a method with 5 args.

Overrides:
callMethod in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value[] args)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3)
Evaluates a method with 3 args.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4)
Evaluates a method with 4 args.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4,
                           Value a5)
Evaluates a method with 5 args.

Overrides:
callMethodRef in class Value

serialize

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

Overrides:
serialize in class Value

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb,
                      SerializeMap serializeMap)
Description copied from class: Value
Serializes the value.

Overrides:
serialize in class Value
sb - holds result of serialization
serializeMap - holds reference indexes

print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

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

printRImpl

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

writeReplace

public java.lang.Object writeReplace()