com.caucho.quercus.env
Class CopyArrayValue

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

public class CopyArrayValue
extends ArrayValue

Represents a PHP array value.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.caucho.quercus.env.ArrayValue
ArrayValue.AbstractGet, ArrayValue.Entry, ArrayValue.EntryIterator, ArrayValue.EntrySet, ArrayValue.GetKey, ArrayValue.GetValue, ArrayValue.KeyComparator, ArrayValue.KeyIterator, ArrayValue.KeySet, ArrayValue.ValueCollection, ArrayValue.ValueComparator, ArrayValue.ValueIterator
 
Field Summary
 
Fields inherited from class com.caucho.quercus.env.ArrayValue
ARRAY, GET_KEY, GET_VALUE, KEY, VALUE
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
CopyArrayValue(ConstArrayValue constArray)
           
 
Method Summary
 ArrayValue append(Value value)
          Add
 ArrayValue append(Value key, Value value)
          Add
 void clear()
          Clears the array
 int cmp(Value rValue)
          Returns a negative/positive integer if this Value is lessthan/greaterthan rValue.
 Value contains(Value value)
          Returns the corresponding key if this array contains the given value
 Value containsKey(Value key)
          Returns the corresponding value if this array contains the given key
 Value containsStrict(Value value)
          Returns the corresponding key if this array contains the given value
 Value copy()
          Copy for assignment.
 Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
          Copy for serialization
 Value copySaveFunArg()
          Copy for saving a function arguments.
 Value createTailKey()
          Pops the top value.
 boolean eq(Value rValue)
          Test for equality
 boolean eql(Value rValue)
          Test for ===
 boolean equals(java.lang.Object o)
           
 Value get(Value key)
          Gets a new value.
 Value getArg(Value index, boolean isTop)
          Returns the value as an argument which may be a reference.
 Value getArray(Value fieldName)
          Returns the value as an array.
 ArrayValue.Entry getHead()
          Returns the head.
 Value getObject(Env env, Value fieldName)
          Returns the field value, creating an object if it's unset.
 int getSize()
          Returns the size.
protected  ArrayValue.Entry getTail()
          Returns the tail.
 Var getVar(Value index)
          Returns the array ref.
 int hashCode()
           
 Value pop(Env env)
          Pops the top value.
 Value put(Value value)
          Add
 Value put(Value key, Value value)
          Adds a new value.
 Var putVar()
          Sets the array ref.
 Value remove(Value key)
          Removes a value.
 Value shuffle()
          Shuffles the array
 ArrayValue slice(Env env, int start, int end, boolean isPreserveKeys)
          Slices.
 ArrayValue splice(int start, int end, ArrayValue replace)
          Splices.
 boolean toBoolean()
          Converts to a boolean.
 Value toLocalValue()
          Convert to an argument value.
 Value toValue()
          Converts to a raw value.
 ArrayValue unshift(Value value)
          Add
 
Methods inherited from class com.caucho.quercus.env.ArrayValue
add, callCallback, callCallback, callCallback, copyReturn, current, each, end, entrySet, geq, getBaseIterator, getCount, getCountRecursive, getCurrent, getIterator, getKeyArray, getKeyIterator, getKeys, getRaw, getType, getValueArray, getValueIterator, getValues, getValueType, gt, hasCurrent, isArray, isCallable, isEmpty, isset, jsonEncode, key, keyExists, keyReset, keySet, keysToArray, leq, lt, next, prev, print, printREntry, printRImpl, put, put, put, put, put, put, put, put, put, put, put, putAll, reset, serialize, setCurrent, sort, toArray, toArray, toArrayValue, toAutoArray, toBinaryValueMarshalCost, toCallable, toCharMarshalCost, toDouble, toEntryArray, toJavaCollection, toJavaList, toJavaMap, toJavaObject, toKey, toLocalRef, toLong, toObject, toObject, toString, toStringMarshalCost, toStringValueMarshalCost, toUnicodeValueMarshalCost, values, valuesToArray, valuesToArray, varDumpEntry, varDumpImpl, varExport
 
Methods inherited from class com.caucho.quercus.env.Value
abs, 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, copy, copyArrayItem, copyStringBuilder, copyTree, div, div, eqValue, findFunction, generate, getArray, getCallableName, getCalledClass, getClassName, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getObject, getQuercusClass, getRef, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, increment, initField, isA, isA, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isObject, isResource, isset, issetField, issetThisField, isString, isUnicode, isVar, length, lshift, mod, mul, mul, neg, nextIndex, pos, postdecr, postincr, postincr, predecr, preincr, preincr, print, printDepth, printJavaChar, printJavaString, printR, put, putField, putField, putField, putObject, putThisField, putThisField, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, sub_rev, sub, sub, subOne, toArgRef, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toChar, toCharArrayMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaLong, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalThis, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringValue, toStringValue, toUnicode, toUnicodeValue, toUnicodeValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, varDump
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopyArrayValue

public CopyArrayValue(ConstArrayValue constArray)
Method Detail

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class ArrayValue

copy

public Value copy()
Copy for assignment.

Specified by:
copy in class ArrayValue

copy

public Value copy(Env env,
                  java.util.IdentityHashMap<Value,Value> map)
Copy for serialization

Specified by:
copy in class ArrayValue

copySaveFunArg

public Value copySaveFunArg()
Copy for saving a function arguments.

Overrides:
copySaveFunArg in class Value

getSize

public int getSize()
Returns the size.

Specified by:
getSize in class ArrayValue

clear

public void clear()
Clears the array

Specified by:
clear in class ArrayValue

put

public Value put(Value key,
                 Value value)
Adds a new value.

Overrides:
put in class ArrayValue

put

public Value put(Value value)
Add

Specified by:
put in class ArrayValue

unshift

public ArrayValue unshift(Value value)
Add

Specified by:
unshift in class ArrayValue

splice

public ArrayValue splice(int start,
                         int end,
                         ArrayValue replace)
Splices.

Specified by:
splice in class ArrayValue

slice

public ArrayValue slice(Env env,
                        int start,
                        int end,
                        boolean isPreserveKeys)
Slices.

Overrides:
slice in class ArrayValue

getArray

public Value getArray(Value fieldName)
Returns the value as an array.

Overrides:
getArray in class ArrayValue

getArg

public Value getArg(Value index,
                    boolean isTop)
Returns the value as an argument which may be a reference.

Specified by:
getArg in class ArrayValue

toLocalValue

public Value toLocalValue()
Convert to an argument value.

Overrides:
toLocalValue in class Value

getObject

public Value getObject(Env env,
                       Value fieldName)
Returns the field value, creating an object if it's unset.

Overrides:
getObject in class ArrayValue

putVar

public Var putVar()
Sets the array ref.

Specified by:
putVar in class ArrayValue

append

public ArrayValue append(Value key,
                         Value value)
Add

Specified by:
append in class ArrayValue

append

public ArrayValue append(Value value)
Add

Overrides:
append in class ArrayValue

get

public Value get(Value key)
Gets a new value.

Specified by:
get in class ArrayValue

contains

public Value contains(Value value)
Returns the corresponding key if this array contains the given value

Specified by:
contains in class ArrayValue
Parameters:
value - to search for in the array
Returns:
the key if it is found in the array, NULL otherwise

containsStrict

public Value containsStrict(Value value)
Returns the corresponding key if this array contains the given value

Specified by:
containsStrict in class ArrayValue
Parameters:
value - to search for in the array
Returns:
the key if it is found in the array, NULL otherwise

containsKey

public Value containsKey(Value key)
Returns the corresponding value if this array contains the given key

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

remove

public Value remove(Value key)
Removes a value.

Specified by:
remove in class ArrayValue

getVar

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

Specified by:
getVar in class ArrayValue

pop

public Value pop(Env env)
Pops the top value.

Specified by:
pop in class ArrayValue

createTailKey

public Value createTailKey()
Pops the top value.

Specified by:
createTailKey in class ArrayValue

shuffle

public Value shuffle()
Shuffles the array

Specified by:
shuffle in class ArrayValue

getHead

public ArrayValue.Entry getHead()
Description copied from class: ArrayValue
Returns the head.

Specified by:
getHead in class ArrayValue

getTail

protected ArrayValue.Entry getTail()
Description copied from class: ArrayValue
Returns the tail.

Specified by:
getTail in class ArrayValue

cmp

public int cmp(Value rValue)
Description copied from class: Value
Returns a negative/positive integer if this Value is lessthan/greaterthan rValue.

Overrides:
cmp in class ArrayValue

eq

public boolean eq(Value rValue)
Description copied from class: ArrayValue
Test for equality

Overrides:
eq in class ArrayValue
Parameters:
rValue - rhs ArrayValue to compare to
Returns:
true if this is equal to rValue, false otherwise

eql

public boolean eql(Value rValue)
Description copied from class: ArrayValue
Test for ===

Overrides:
eql in class ArrayValue
Parameters:
rValue - rhs ArrayValue to compare to
Returns:
true if this is equal to rValue, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class Value

toValue

public Value toValue()
Description copied from class: Value
Converts to a raw value.

Overrides:
toValue in class Value

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object