com.caucho.quercus.env
Class JavaMapAdapter

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

public class JavaMapAdapter
extends JavaAdapter

Represents a marshalled Map argument.

See Also:
Serialized Form

Nested Class Summary
 class JavaMapAdapter.KeyIterator
           
 class JavaMapAdapter.MapIterator
           
 class JavaMapAdapter.MapSet
           
 class JavaMapAdapter.ValueCollection
           
 class JavaMapAdapter.ValueIterator
           
 
Nested classes/interfaces inherited from class com.caucho.quercus.env.JavaAdapter
JavaAdapter.KeySet
 
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.ValueComparator
 
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
JavaMapAdapter(Env env, java.util.Map map)
           
JavaMapAdapter(java.util.Map map, JavaClassDef def)
           
 
Method Summary
 void clear()
          Clears the array
 Value containsKey(Value key)
          Returns the corresponding valeu if this array contains the given key
 Value copy()
          Copy for assignment.
 Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
          Copy for serialization
 Value createTailKey()
          Creatse a tail index.
 java.util.Set<java.util.Map.Entry<Value,Value>> entrySet()
          Returns a set of all the of the entries.
 Value get(Value key)
          Gets a new value.
 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.
 int getSize()
          Returns the size.
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the field values.
 java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> objectEntrySet()
          Returns a collection of the values.
 Value putImpl(Value key, Value value)
          Adds a new value.
 Value remove(Value key)
          Removes a value.
 int size()
           
 java.lang.Object toJavaObject(Env env, java.lang.Class type)
          Converts to a java object.
 java.util.Collection<Value> values()
          Returns a collection of the values.
 
Methods inherited from class com.caucho.quercus.env.JavaAdapter
append, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, contains, containsStrict, current, each, end, findFunction, getArg, getClassDef, getEnv, getField, getHead, getIndices, getName, getTail, getVar, hasCurrent, isA, key, keyReset, keySet, next, pop, prev, printRImpl, put, put, putField, putVar, reset, serialize, shuffle, sort, splice, toEntryArray, toJavaCollection, toJavaList, toJavaMap, toJavaObject, toJavaObjectNotNull, toObject, toObject, toString, unshift, valuesToArray, valuesToArray, varDumpImpl, varExport, wrapJava
 
Methods inherited from class com.caucho.quercus.env.ArrayValue
add, append, callCallback, callCallback, callCallback, cmp, copyReturn, eq, eql, geq, getArray, getBaseIterator, getCount, getCountRecursive, getCurrent, getIterator, getKeyArray, getKeys, getObject, getRaw, getType, getValueArray, getValues, getValueType, gt, isArray, isCallable, isEmpty, isset, jsonEncode, keyExists, keysToArray, leq, lt, print, printREntry, put, put, put, put, put, put, put, put, put, put, put, putAll, serialize, setCurrent, slice, toArray, toArray, toArrayValue, toAutoArray, toBinaryValueMarshalCost, toBoolean, toCallable, toCharMarshalCost, toDouble, toKey, toLocalRef, toLong, toStringMarshalCost, toStringValueMarshalCost, toUnicodeValueMarshalCost, varDumpEntry
 
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, 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, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getObject, getQuercusClass, getRef, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, hashCode, increment, initField, 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, putObject, putThisField, putThisField, rshift, 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, toJavaObjectMarshalCost, 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
 

Constructor Detail

JavaMapAdapter

public JavaMapAdapter(Env env,
                      java.util.Map map)

JavaMapAdapter

public JavaMapAdapter(java.util.Map map,
                      JavaClassDef def)
Method Detail

clear

public void clear()
Clears the array

Specified by:
clear in class JavaAdapter

size

public int size()

toJavaObject

public java.lang.Object toJavaObject(Env env,
                                     java.lang.Class type)
Converts to a java object.

Overrides:
toJavaObject in class Value

copy

public Value copy()
Copy for assignment.

Specified by:
copy in class JavaAdapter

copy

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

Specified by:
copy in class JavaAdapter

getSize

public int getSize()
Returns the size.

Specified by:
getSize in class JavaAdapter

get

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

Specified by:
get in class JavaAdapter

remove

public Value remove(Value key)
Removes a value.

Specified by:
remove in class JavaAdapter

createTailKey

public Value createTailKey()
Creatse a tail index.

Specified by:
createTailKey in class JavaAdapter

putImpl

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

Specified by:
putImpl in class JavaAdapter

containsKey

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

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

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 ArrayValue

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 ArrayValue

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

entrySet

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

Specified by:
entrySet in class JavaAdapter

objectEntrySet

public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> objectEntrySet()
Returns a collection of the values.

Specified by:
objectEntrySet in class JavaAdapter

values

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

Overrides:
values in class JavaAdapter