public abstract class JavaAdapter extends ArrayValue implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
JavaAdapter.KeySet |
ArrayValue.AbstractGet, ArrayValue.Entry, ArrayValue.EntryIterator, ArrayValue.EntrySet, ArrayValue.GetKey, ArrayValue.GetValue, ArrayValue.KeyComparator, ArrayValue.KeyIterator, ArrayValue.ValueCollection, ArrayValue.ValueComparator, ArrayValue.ValueIterator
L, NULL_ARGS, NULL_VALUE_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
JavaAdapter(java.lang.Object object,
JavaClassDef def) |
Modifier and Type | Method and Description |
---|---|
ArrayValue |
append(Value key,
Value value)
Appends as an argument - only called from compiled code
XXX: change name to appendArg
|
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.
|
Value |
callMethod(Env env,
StringValue methodName,
int hash,
Value a1,
Value a2,
Value a3,
Value a4)
Evaluates a method.
|
Value |
callMethod(Env env,
StringValue methodName,
int hash,
Value a1,
Value a2,
Value a3,
Value a4,
Value a5)
Evaluates a method.
|
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.
|
Value |
callMethodRef(Env env,
StringValue methodName,
int hash,
Value a1,
Value a2,
Value a3,
Value a4)
Evaluates a method.
|
Value |
callMethodRef(Env env,
StringValue methodName,
int hash,
Value a1,
Value a2,
Value a3,
Value a4,
Value a5)
Evaluates a method.
|
abstract void |
clear()
Clears the array
|
Value |
contains(Value value)
Returns the corresponding key if this array contains the given value
|
Value |
containsKey(Value key)
Returns the corresponding valeu if this array contains the given key
|
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
|
abstract Value |
createTailKey()
Creatse a tail index.
|
Value |
current()
Returns the current value.
|
Value |
each()
The each iterator
|
Value |
end()
Returns the last value.
|
abstract java.util.Set<java.util.Map.Entry<Value,Value>> |
entrySet()
Returns a set of all the entries.
|
AbstractFunction |
findFunction(StringValue methodName)
Returns the method.
|
abstract 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.
|
JavaClassDef |
getClassDef() |
Env |
getEnv() |
Value |
getField(Env env,
StringValue name)
Returns the field value
|
ArrayValue.Entry |
getHead()
Returns the head.
|
java.util.Collection<Value> |
getIndices()
Returns the field values.
|
java.lang.String |
getName()
Returns the class name.
|
abstract int |
getSize()
Returns the size.
|
protected ArrayValue.Entry |
getTail()
Returns the tail.
|
Var |
getVar(Value index)
Returns the array ref.
|
boolean |
hasCurrent()
Returns true if there are more elements.
|
boolean |
isA(Env env,
java.lang.String name)
Returns true for an implementation of a class
|
Value |
key()
Returns the current key
|
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 |
next()
Returns the next value.
|
abstract java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> |
objectEntrySet()
Returns a java object set of all the entries.
|
Value |
pop(Env env)
Pops the top value.
|
Value |
prev()
Returns the previous value.
|
protected void |
printRImpl(Env env,
WriteStream out,
int depth,
java.util.IdentityHashMap<Value,java.lang.String> valueSet) |
Value |
put(Value value)
Adds a new value.
|
Value |
put(Value key,
Value value)
Adds a new value.
|
Value |
putField(Env env,
StringValue name,
Value value)
Returns the field ref.
|
abstract Value |
putImpl(Value key,
Value value)
Adds a new value.
|
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)
Serializes the value.
|
Value |
shuffle()
Shuffles the array
|
void |
sort(java.util.Comparator<java.util.Map.Entry<Value,Value>> comparator,
boolean resetKeys,
boolean strict)
Sorts this array based using the passed Comparator
|
ArrayValue |
splice(int begin,
int end,
ArrayValue replace)
Splices.
|
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.
|
java.lang.Object |
toJavaObjectNotNull(Env env,
java.lang.Class type)
Converts to a java object.
|
java.lang.Object |
toObject()
Converts to an object.
|
Value |
toObject(Env env)
Converts to an object.
|
java.lang.String |
toString()
Converts to a string.
|
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, unmarshalls them to objects of type
elementType, and puts them in a java array.
|
void |
varDumpImpl(Env env,
WriteStream out,
int depth,
java.util.IdentityHashMap<Value,java.lang.String> valueSet) |
protected void |
varExportImpl(StringValue sb,
int level)
Exports the value.
|
Value |
wrapJava(java.lang.Object obj) |
add, append, callCallback, callCallback, callCallback, cmp, copyReturn, eq, eql, geq, getArray, getBaseIterator, getCount, getCountRecursive, getCurrent, getIterator, getKeyArray, getKeyIterator, getKeys, getObject, getRaw, getType, getValueArray, getValueIterator, getValues, getValueType, gt, isArray, isCallable, isEmpty, isEmpty, isset, jsonEncode, jsonEncodeAssociative, 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
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, findQuercusClass, generate, get, getArgTail, getArray, getCallableName, getCalledClass, getClassName, getDirty, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getObject, getObjectHash, getQuercusClass, getRef, getResourceType, getStaticFieldValue, getStaticFieldVar, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, hashCode, increment, initField, initField, initField, initIncompleteField, isA, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isFieldExists, 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, putArray, putField, putField, putObject, putThisField, putThisField, putThisFieldArray, rshift, set, setCharValueAt, setFieldInit, setJavaObject, setStaticFieldRef, sub_rev, sub, sub, subOne, toArgRef, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toChar, toCharArrayMarshalCost, toDebugString, toDouble, toDouble, toDouble, toDouble, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaDate, toJavaDouble, toJavaEnum, toJavaFloat, toJavaInteger, toJavaLong, toJavaObject, toJavaObjectMarshalCost, toJavaShort, toJavaString, toJavaURL, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLong, toLong, toLong, toLongMarshalCost, toLongValue, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringValue, toStringValue, toUnicode, toUnicodeValue, toUnicodeValue, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, unsetThisPrivateField, varDump, varExport
protected JavaAdapter(java.lang.Object object, JavaClassDef def)
public JavaClassDef getClassDef()
public Env getEnv()
public Value wrapJava(java.lang.Object obj)
public java.lang.Object toObject()
toObject
in class ArrayValue
public java.lang.Object toJavaObject()
toJavaObject
in class ArrayValue
public java.lang.Object toJavaObjectNotNull(Env env, java.lang.Class type)
toJavaObjectNotNull
in class Value
public Value toObject(Env env)
toObject
in class ArrayValue
public java.util.Collection toJavaCollection(Env env, java.lang.Class type)
toJavaCollection
in class ArrayValue
public java.util.List toJavaList(Env env, java.lang.Class type)
toJavaList
in class ArrayValue
public java.util.Map toJavaMap(Env env, java.lang.Class type)
toJavaMap
in class ArrayValue
public abstract Value copy()
copy
in class ArrayValue
public abstract Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
copy
in class ArrayValue
public abstract int getSize()
getSize
in class ArrayValue
public abstract void clear()
clear
in class ArrayValue
public final Value put(Value value)
put
in class ArrayValue
public final Value put(Value key, Value value)
put
in class ArrayValue
public ArrayValue unshift(Value value)
unshift
in class ArrayValue
public ArrayValue splice(int begin, int end, ArrayValue replace)
splice
in class ArrayValue
public Value getArg(Value index, boolean isTop)
getArg
in class ArrayValue
public Var putVar()
putVar
in class ArrayValue
public abstract Value createTailKey()
createTailKey
in class ArrayValue
public java.util.Collection<Value> getIndices()
public abstract Value get(Value key)
get
in class ArrayValue
public abstract Value remove(Value key)
remove
in class ArrayValue
public Var getVar(Value index)
getVar
in class ArrayValue
public java.util.Set<Value> keySet()
keySet
in class ArrayValue
public abstract java.util.Set<java.util.Map.Entry<Value,Value>> entrySet()
entrySet
in class ArrayValue
public abstract java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> objectEntrySet()
public java.util.Collection<Value> values()
values
in class ArrayValue
public ArrayValue append(Value key, Value value)
append
in class ArrayValue
public Value pop(Env env)
pop
in class ArrayValue
public Value shuffle()
shuffle
in class ArrayValue
public ArrayValue.Entry getHead()
getHead
in class ArrayValue
protected ArrayValue.Entry getTail()
getTail
in class ArrayValue
public Value current()
current
in class ArrayValue
public Value key()
key
in class ArrayValue
public boolean hasCurrent()
hasCurrent
in class ArrayValue
public Value next()
next
in class ArrayValue
public Value prev()
prev
in class ArrayValue
public Value each()
each
in class ArrayValue
public Value reset()
reset
in class ArrayValue
public Value end()
end
in class ArrayValue
public Value contains(Value value)
contains
in class ArrayValue
value
- to search for in the arrayjava.lang.NullPointerException
public Value containsStrict(Value value)
containsStrict
in class ArrayValue
value
- to search for in the arraypublic Value containsKey(Value key)
containsKey
in class ArrayValue
key
- to search for in the arraypublic java.util.Map.Entry<Value,Value>[] toEntryArray()
toEntryArray
in class ArrayValue
public void sort(java.util.Comparator<java.util.Map.Entry<Value,Value>> comparator, boolean resetKeys, boolean strict)
sort
in class ArrayValue
comparator
- the comparator for sorting the arrayresetKeys
- true if the keys should not be preservedstrict
- true if alphabetic keys should not be preservedpublic void serialize(Env env, java.lang.StringBuilder sb)
protected void varExportImpl(StringValue sb, int level)
varExportImpl
in class ArrayValue
public boolean keyReset(long base, boolean strict)
keyReset
in class ArrayValue
base
- the initial indexstrict
- if true, string keys are also resetpublic Value[] valuesToArray()
valuesToArray
in class ArrayValue
public java.lang.Object valuesToArray(Env env, java.lang.Class elementType)
valuesToArray
in class ArrayValue
public Value getField(Env env, StringValue name)
Value
public Value putField(Env env, StringValue name, Value value)
Value
public java.lang.String getName()
public boolean isA(Env env, java.lang.String name)
Value
public AbstractFunction findFunction(StringValue methodName)
findFunction
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value[] args)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value a1)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
callMethod
in class Value
public Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
callMethod
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value[] args)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value a1)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
callMethodRef
in class Value
public Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
callMethodRef
in class Value
public void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet) throws java.io.IOException
varDumpImpl
in class ArrayValue
java.io.IOException
protected void printRImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet) throws java.io.IOException
printRImpl
in class ArrayValue
java.io.IOException
public java.lang.String toString()
toString
in class ArrayValue