com.caucho.quercus.env
Class ArrayValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ArrayValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArrayValueImpl, ArrayValueWrapper, CopyArrayValue, JavaAdapter

public abstract class ArrayValue
extends Value

Represents a PHP array value.

See Also:
Serialized Form

Nested Class Summary
static class ArrayValue.AbstractGet
           
static class ArrayValue.Entry
           
static class ArrayValue.EntryIterator
           
 class ArrayValue.EntrySet
           
static class ArrayValue.GetKey
           
static class ArrayValue.GetValue
           
static class ArrayValue.KeyComparator
           
static class ArrayValue.KeyIterator
           
 class ArrayValue.KeySet
           
 class ArrayValue.ValueCollection
           
static class ArrayValue.ValueComparator
           
static class ArrayValue.ValueIterator
           
 
Field Summary
static StringValue ARRAY
           
static ArrayValue.GetKey GET_KEY
           
static ArrayValue.GetValue GET_VALUE
           
protected static StringValue KEY
           
protected static StringValue VALUE
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
protected ArrayValue()
           
 
Method Summary
 Value add(Value rValue)
          Returns a union of this array and the rValue as array.
 ArrayValue append(Value value)
          Appends as an argument - only called from compiled code XXX: change name to appendArg
abstract  ArrayValue append(Value key, Value value)
          Appends as an argument - only called from compiled code XXX: change name to appendArg
 Value callCallback(Env env, Callable callback, Value key)
           
 Value callCallback(Env env, Callable callback, Value key, Value a2)
           
 Value callCallback(Env env, Callable callback, Value key, Value a2, Value a3)
           
abstract  void clear()
          Clears the array
 int cmp(Value rValue)
          Returns a negative/positive integer if this Value is lessthan/greaterthan rValue.
abstract  Value contains(Value value)
          Returns the corresponding key if this array contains the given value
abstract  Value containsKey(Value key)
          Returns the corresponding value if this array contains the given key
abstract  Value containsStrict(Value value)
          Returns the corresponding key if this array contains the given value
abstract  Value copy()
          Copy for assignment.
abstract  Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
          Copy for serialization
 Value copyReturn()
          Copy as a return value
abstract  Value createTailKey()
          Creatse a tail index.
 Value current()
          Returns the current value.
 Value each()
          The each iterator
 Value end()
          Returns the last value.
 java.util.Set<java.util.Map.Entry<Value,Value>> entrySet()
          Returns a set of all the of the entries.
 boolean eq(Value rValue)
          Test for equality
 boolean eql(Value rValue)
          Test for ===
 boolean geq(Value rValue)
          Returns true for greater than or equal to
abstract  Value get(Value key)
          Gets a new value.
abstract  Value getArg(Value index, boolean isTop)
          Returns the value as an argument which may be a reference.
 Value getArray(Value index)
          Returns the value as an array.
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getBaseIterator(Env env)
          Returns an iterator for the key => value pairs.
 int getCount(Env env)
          Returns the count().
 int getCountRecursive(Env env)
          Returns the count().
protected  ArrayValue.Entry getCurrent()
           
abstract  ArrayValue.Entry getHead()
          Returns the head.
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator()
           
 Value[] getKeyArray(Env env)
          Returns the field keys.
 java.util.Iterator<Value> getKeyIterator(Env env)
          Returns an iterator for the field keys.
 Value getKeys()
          Returns the keys.
 Value getObject(Env env, Value fieldName)
          Returns the field value, creating an object if it's unset.
 Value getRaw(Value key)
          Returns the value in the array as-is.
abstract  int getSize()
          Returns the size.
protected abstract  ArrayValue.Entry getTail()
          Returns the tail.
 java.lang.String getType()
          Returns the type.
 Value[] getValueArray(Env env)
          Returns the field values.
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the field values.
 Value getValues()
          Returns the keys.
 ValueType getValueType()
          Returns the ValueType.
abstract  Var getVar(Value index)
          Returns the array ref.
 boolean gt(Value rValue)
          Returns true for greater than
 boolean hasCurrent()
          Returns true if there are more elements.
 boolean isArray()
          Returns true for an array.
 boolean isCallable(Env env)
          Returns true for a callable object.
 boolean isEmpty()
          Returns true if the value is empty
 boolean isset(Value key)
          Returns true if the value is set.
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
 Value key()
          Returns the current key
 boolean keyExists(Value key)
          Returns true if the key exists in the array.
 boolean keyReset(long base, boolean strict)
          Resets all numerical keys with the first index as base
 java.util.Set<Value> keySet()
          Returns an iterator of the entries.
 Value[] keysToArray()
          Takes the values of this array and puts them in a java array
 boolean leq(Value rValue)
          Returns true for less than or equal to
 boolean lt(Value rValue)
          Returns true for less than
 Value next()
          Returns the next value.
abstract  Value pop(Env env)
          Pops the top value.
 Value prev()
          Returns the previous value.
 void print(Env env)
          Prints the value.
protected  void printREntry(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet, java.util.Map.Entry<Value,Value> mapEntry)
           
protected  void printRImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 void put(Env env, java.lang.String key, boolean value)
          Convenience for lib.
 void put(Env env, java.lang.String key, long value)
          Convenience for lib.
 void put(Env env, java.lang.String key, java.lang.String value)
          Convenience for lib.
 void put(long value)
          Convenience for lib.
 void put(java.lang.String value)
          Convenience for lib.
 void put(java.lang.String key, boolean value)
          Convenience for lib.
 void put(java.lang.String key, char value)
          Convenience for lib.
 void put(java.lang.String key, double value)
          Convenience for lib.
 void put(java.lang.String key, long value)
          Convenience for lib.
 void put(java.lang.String key, java.lang.String value)
          Convenience for lib.
 void put(StringValue keyBinary, StringValue keyUnicode, Value value, boolean isUnicode)
          Adds a new value.
abstract  Value put(Value value)
          Add
 Value put(Value key, Value value)
          Adds a new value.
 void putAll(ArrayValue array)
          Puts all of the arg elements into this array.
abstract  Var putVar()
          Sets the array ref.
abstract  Value remove(Value key)
          Removes a value.
 Value reset()
          Returns the first value.
 void serialize(Env env, java.lang.StringBuilder sb, SerializeMap serializeMap)
          Serializes the value.
protected  void setCurrent(ArrayValue.Entry entry)
           
abstract  Value shuffle()
          Shuffles the array
 ArrayValue slice(Env env, int start, int end, boolean isPreserveKeys)
          Slices.
 void sort(java.util.Comparator<java.util.Map.Entry<Value,Value>> comparator, boolean resetKeys, boolean strict)
          Sorts this array based using the passed Comparator
abstract  ArrayValue splice(int begin, int end, ArrayValue replace)
          Splices.
 Value toArray()
          Converts to an object.
static Value toArray(Value value)
          Convert to an array.
 ArrayValue toArrayValue(Env env)
          Converts to an array value
 Value toAutoArray()
          Converts to an array if null.
 int toBinaryValueMarshalCost()
          Cost to convert to a binary value
 boolean toBoolean()
          Converts to a boolean.
 Callable toCallable(Env env)
          Converts to a callable object.
 int toCharMarshalCost()
          Cost to convert to a character
 double toDouble()
          Converts to a double.
 java.util.Map.Entry<Value,Value>[] toEntryArray()
          Returns an object array of this array.
 java.util.Collection toJavaCollection(Env env, java.lang.Class type)
          Converts to a java List object.
 java.util.List toJavaList(Env env, java.lang.Class type)
          Converts to a java List object.
 java.util.Map toJavaMap(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Object toJavaObject()
          Converts to a java object.
 Value toKey()
          Converts to a key.
 Value toLocalRef()
          Convert to a function argument value, e.g.
 long toLong()
          Converts to a long.
 java.lang.Object toObject()
          Converts to an object.
 Value toObject(Env env)
          Converts to an object.
 java.lang.String toString()
          Converts to a string.
 int toStringMarshalCost()
          Cost to convert to a string
 int toStringValueMarshalCost()
          Cost to convert to a StringValue
 int toUnicodeValueMarshalCost()
          Cost to convert to a UnicodeValue
abstract  ArrayValue unshift(Value value)
          Add to front.
 java.util.Collection<Value> values()
          Returns a collection of the values.
 Value[] valuesToArray()
          Takes the values of this array and puts them in a java array
 java.lang.Object valuesToArray(Env env, java.lang.Class elementType)
          Takes the values of this array, unmarshals them to objects of type elementType, and puts them in a java array.
protected  void varDumpEntry(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet, java.util.Map.Entry<Value,Value> mapEntry)
           
 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, 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, copySaveFunArg, 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, hashCode, 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, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringValue, toStringValue, toUnicode, toUnicodeValue, toUnicodeValue, 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

KEY

protected static final StringValue KEY

VALUE

protected static final StringValue VALUE

GET_KEY

public static final ArrayValue.GetKey GET_KEY

GET_VALUE

public static final ArrayValue.GetValue GET_VALUE

ARRAY

public static final StringValue ARRAY
Constructor Detail

ArrayValue

protected ArrayValue()
Method Detail

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

toCharMarshalCost

public int toCharMarshalCost()
Cost to convert to a character

Overrides:
toCharMarshalCost in class Value

toStringMarshalCost

public int toStringMarshalCost()
Cost to convert to a string

Overrides:
toStringMarshalCost in class Value

toBinaryValueMarshalCost

public int toBinaryValueMarshalCost()
Cost to convert to a binary value

Overrides:
toBinaryValueMarshalCost in class Value

toStringValueMarshalCost

public int toStringValueMarshalCost()
Cost to convert to a StringValue

Overrides:
toStringValueMarshalCost in class Value

toUnicodeValueMarshalCost

public int toUnicodeValueMarshalCost()
Cost to convert to a UnicodeValue

Overrides:
toUnicodeValueMarshalCost 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 java.lang.String toString()
Converts to a string.

Overrides:
toString in class java.lang.Object

toObject

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


toAutoArray

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

Overrides:
toAutoArray in class Value

toJavaObject

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

Overrides:
toJavaObject in class Value

getCurrent

protected ArrayValue.Entry getCurrent()

setCurrent

protected void setCurrent(ArrayValue.Entry entry)

toArray

public Value toArray()
Converts to an object.

Overrides:
toArray in class Value

toArrayValue

public ArrayValue toArrayValue(Env env)
Converts to an array value

Overrides:
toArrayValue in class Value

toObject

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

Overrides:
toObject in class Value

toJavaCollection

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

Overrides:
toJavaCollection in class Value

toJavaList

public java.util.List toJavaList(Env env,
                                 java.lang.Class type)
Converts to a java List 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

isCallable

public boolean isCallable(Env env)
Description copied from class: Value
Returns true for a callable object.

Overrides:
isCallable in class Value

toCallable

public Callable toCallable(Env env)
Converts to a callable object.

Overrides:
toCallable in class Value

callCallback

public final Value callCallback(Env env,
                                Callable callback,
                                Value key)

callCallback

public final Value callCallback(Env env,
                                Callable callback,
                                Value key,
                                Value a2)

callCallback

public final Value callCallback(Env env,
                                Callable callback,
                                Value key,
                                Value a2,
                                Value a3)

isArray

public boolean isArray()
Returns true for an array.

Overrides:
isArray in class Value

copyReturn

public Value copyReturn()
Copy as a return value

Overrides:
copyReturn in class Value

copy

public abstract Value copy()
Copy for assignment.

Overrides:
copy in class Value

toLocalRef

public Value toLocalRef()
Description copied from class: Value
Convert to a function argument value, e.g. for function foo($a) where $a may be assigned.

Overrides:
toLocalRef in class Value

copy

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

Overrides:
copy in class Value

getSize

public abstract int getSize()
Returns the size.

Overrides:
getSize in class Value

getCount

public int getCount(Env env)
Returns the count().

Overrides:
getCount in class Value

getCountRecursive

public int getCountRecursive(Env env)
Returns the count().

Overrides:
getCountRecursive in class Value

isEmpty

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

Overrides:
isEmpty in class Value

clear

public abstract void clear()
Clears the array


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 Value

lt

public boolean lt(Value rValue)
Returns true for less than

Overrides:
lt in class Value

leq

public boolean leq(Value rValue)
Returns true for less than or equal to

Overrides:
leq in class Value

gt

public boolean gt(Value rValue)
Returns true for greater than

Overrides:
gt in class Value

geq

public boolean geq(Value rValue)
Returns true for greater than or equal to

Overrides:
geq in class Value

put

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

Overrides:
put in class Value

put

public final void put(StringValue keyBinary,
                      StringValue keyUnicode,
                      Value value,
                      boolean isUnicode)
Adds a new value.


put

public abstract Value put(Value value)
Add

Overrides:
put in class Value

unshift

public abstract ArrayValue unshift(Value value)
Add to front.


splice

public abstract ArrayValue splice(int begin,
                                  int end,
                                  ArrayValue replace)
Splices.


slice

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


getArray

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

Overrides:
getArray in class Value

getArg

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

Overrides:
getArg 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 Value

putVar

public abstract Var putVar()
Sets the array ref.

Overrides:
putVar in class Value

createTailKey

public abstract Value createTailKey()
Creatse a tail index.


add

public Value add(Value rValue)
Returns a union of this array and the rValue as array. If the rValue is not an array, the returned union contains the elements of this array only. To append a value to this ArrayValue use the put(Value) method.

Overrides:
add in class Value

getBaseIterator

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

Overrides:
getBaseIterator in class Value

getIterator

public java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator()

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 abstract Value get(Value key)
Gets a new value.

Overrides:
get in class Value

getRaw

public Value getRaw(Value key)
Returns the value in the array as-is. (i.e. without calling toValue() on it).


isset

public boolean isset(Value key)
Returns true if the value is set.

Overrides:
isset in class Value

keyExists

public boolean keyExists(Value key)
Returns true if the key exists in the array.

Overrides:
keyExists in class Value

remove

public abstract Value remove(Value key)
Removes a value.

Overrides:
remove in class Value

getVar

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

Overrides:
getVar in class Value

keySet

public java.util.Set<Value> keySet()
Returns an iterator of the entries.


entrySet

public java.util.Set<java.util.Map.Entry<Value,Value>> entrySet()
Returns a set of all the of the entries.


values

public java.util.Collection<Value> values()
Returns a collection of the values.


put

public void put(java.lang.String key,
                java.lang.String value)
Convenience for lib.


put

public void put(Env env,
                java.lang.String key,
                java.lang.String value)
Convenience for lib.


put

public void put(java.lang.String key,
                char value)
Convenience for lib.


put

public void put(java.lang.String key,
                long value)
Convenience for lib.


put

public void put(Env env,
                java.lang.String key,
                long value)
Convenience for lib.


put

public void put(java.lang.String key,
                double value)
Convenience for lib.


put

public void put(java.lang.String key,
                boolean value)
Convenience for lib.


put

public void put(Env env,
                java.lang.String key,
                boolean value)
Convenience for lib.


put

public void put(java.lang.String value)
Convenience for lib.


put

public void put(long value)
Convenience for lib.


append

public abstract ArrayValue append(Value key,
                                  Value value)
Appends as an argument - only called from compiled code XXX: change name to appendArg

Overrides:
append in class Value

append

public ArrayValue append(Value value)
Appends as an argument - only called from compiled code XXX: change name to appendArg


putAll

public void putAll(ArrayValue array)
Puts all of the arg elements into this array.


toArray

public static Value toArray(Value value)
Convert to an array.


print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

pop

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

Overrides:
pop in class Value

shuffle

public abstract Value shuffle()
Shuffles the array

Overrides:
shuffle in class Value

getHead

public abstract ArrayValue.Entry getHead()
Returns the head.


getTail

protected abstract ArrayValue.Entry getTail()
Returns the tail.


current

public Value current()
Returns the current value.

Overrides:
current in class Value

key

public Value key()
Returns the current key

Overrides:
key in class Value

hasCurrent

public boolean hasCurrent()
Returns true if there are more elements.

Overrides:
hasCurrent in class Value

next

public Value next()
Returns the next value.

Overrides:
next in class Value

prev

public Value prev()
Returns the previous value.

Overrides:
prev in class Value

each

public Value each()
The each iterator


reset

public Value reset()
Returns the first value.

Overrides:
reset in class Value

end

public Value end()
Returns the last value.

Overrides:
end in class Value

contains

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

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

containsStrict

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

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

containsKey

public abstract Value containsKey(Value key)
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

toEntryArray

public java.util.Map.Entry<Value,Value>[] toEntryArray()
Returns an object array of this array. This is a copy of this object's backing structure. Null elements are not included.

Returns:
an object array of this array

sort

public void sort(java.util.Comparator<java.util.Map.Entry<Value,Value>> comparator,
                 boolean resetKeys,
                 boolean strict)
Sorts this array based using the passed Comparator

Parameters:
comparator - the comparator for sorting the array
resetKeys - true if the keys should not be preserved
strict - true if alphabetic keys should not be preserved

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

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

keyReset

public boolean keyReset(long base,
                        boolean strict)
Resets all numerical keys with the first index as base

Parameters:
base - the initial index
strict - if true, string keys are also reset

eq

public boolean eq(Value rValue)
Test for equality

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

eql

public boolean eql(Value rValue)
Test for ===

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

toKey

public Value toKey()
Converts to a key.

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

varDumpEntry

protected void varDumpEntry(Env env,
                            WriteStream out,
                            int depth,
                            java.util.IdentityHashMap<Value,java.lang.String> valueSet,
                            java.util.Map.Entry<Value,Value> mapEntry)
                     throws java.io.IOException
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

printREntry

protected void printREntry(Env env,
                           WriteStream out,
                           int depth,
                           java.util.IdentityHashMap<Value,java.lang.String> valueSet,
                           java.util.Map.Entry<Value,Value> mapEntry)
                    throws java.io.IOException
Throws:
java.io.IOException

getKeyArray

public Value[] getKeyArray(Env env)
Returns the field keys.

Overrides:
getKeyArray in class Value

getValueArray

public Value[] getValueArray(Env env)
Returns the field values.

Overrides:
getValueArray in class Value

keysToArray

public Value[] keysToArray()
Takes the values of this array and puts them in a java array


valuesToArray

public Value[] valuesToArray()
Takes the values of this array and puts them in a java array


getKeys

public Value getKeys()
Returns the keys.


getValues

public Value getValues()
Returns the keys.


valuesToArray

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

Overrides:
valuesToArray in class Value