com.caucho.quercus.env
Class RefVar

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

public class RefVar
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
RefVar(Var var)
           
 
Method Summary
 Value add(long rValue)
          Adds to the following value.
 Value add(Value rValue)
          Adds to the following value.
 Value callClassMethod(Env env, AbstractFunction fun, Value[] args)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Expr[] args)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value a0)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value[] args)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value a0, Value a1)
          Evaluates a method.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2)
          Evaluates a method with 3 args.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2, Value a3)
          Evaluates a method with 4 args.
 Value callMethod(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method with 5 args.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen)
          Evaluates a method.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Expr[] args)
          Evaluates a method.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value a0)
          Evaluates a method.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value[] args)
          Evaluates a method.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value a0, Value a1)
          Evaluates a method.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2)
          Evaluates a method with 3 args.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2, Value a3)
          Evaluates a method with 4 args.
 Value callMethodRef(Env env, int hash, char[] name, int nameLen, Value a0, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method with 5 args.
 Value copy()
          Copy the 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.
 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 field keys.
 Value getRef(Value index)
          Returns the array ref.
 int getSize()
          Returns the array/object size
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the field values.
 boolean isA(java.lang.String name)
          Returns true for an implementation of a class
 boolean isArray()
          Returns true for an array.
 boolean isDoubleConvertible()
          True to a double.
 boolean isLongConvertible()
          True for a long
 boolean isNumberConvertible()
          True for a number
 boolean isObject()
          Returns true for an object.
 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 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)
           
 Value sub(long rValue)
          Subtracts to the following value.
 Value sub(Value rValue)
          Subtracts to the following value.
 Value toArgValue()
          Converts to an argument value.
 Value toArgValueReadOnly()
          Converts to an argument value.
 boolean toBoolean()
          Converts to a boolean.
 double toDouble()
          Converts to a double.
 java.lang.Object toJavaObject()
          Converts to an object.
 long toLong()
          Converts to a long.
 Value toObject(Env env)
          Converts to an object.
 Value toRefValue()
          Converts to an argument value.
 Var toRefVar()
          Converts to a reference variable
 StringValue toString(Env env)
          Converts to a string.
 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
appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, charValueAt, checkPrivate, checkProtected, clone, cmp, copy, copy, copyArrayItem, copyReturn, copyTree, current, div, eq, eqValue, findFunction, generate, geq, getArg, getArray, getArray, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldRef, getKeyArray, getObject, getObject, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldRef, getType, getValueArray, getValueType, gt, hasCurrent, isBinary, isBoolean, isDefault, isEmpty, isNull, isNumeric, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, key, length, leq, lt, mod, next, nextIndex, pos, print, printDepth, printJavaString, printR, putArray, putField, putField, putObject, putRef, putThisField, remove, set, setCharValueAt, sub_rev, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toChar, toDebugString, toDoubleValue, toException, toInputStream, toInt, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toKey, toLongValue, toRef, toStringBuilder, toStringBuilder, toStringValue, toUnicodeValue, toUnicodeValue, unsetField, unsetThisField, valuesToArray, varDump, varExport
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefVar

public RefVar(Var var)
Method Detail

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

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

toArgValueReadOnly

public Value toArgValueReadOnly()
Converts to an argument value.

Overrides:
toArgValueReadOnly in class Value

toArgValue

public Value toArgValue()
Converts to an argument value.

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

toRefVar

public Var toRefVar()
Converts to a reference variable

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

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

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

getRef

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

Overrides:
getRef 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,
                        int hash,
                        char[] name,
                        int nameLen,
                        Expr[] args)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value[] args)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value a0)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value a0,
                        Value a1)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value a0,
                        Value a1,
                        Value a2)
Evaluates a method with 3 args.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value a0,
                        Value a1,
                        Value a2,
                        Value a3)
Evaluates a method with 4 args.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        int hash,
                        char[] name,
                        int nameLen,
                        Value a0,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4)
Evaluates a method with 5 args.

Overrides:
callMethod in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Expr[] args)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value[] args)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value a0)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value a0,
                           Value a1)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value a0,
                           Value a1,
                           Value a2)
Evaluates a method with 3 args.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value a0,
                           Value a1,
                           Value a2,
                           Value a3)
Evaluates a method with 4 args.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           int hash,
                           char[] name,
                           int nameLen,
                           Value a0,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4)
Evaluates a method with 5 args.

Overrides:
callMethodRef in class Value

callClassMethod

public Value callClassMethod(Env env,
                             AbstractFunction fun,
                             Value[] args)
Evaluates a method.

Overrides:
callClassMethod 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)
Overrides:
serialize in class Value

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()