|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--anvil.core.Any
|
+--anvil.core.Array
| Nested Class Summary | |
class |
Array.Entry
Array collision list. |
| Field Summary | |
static NativeClass |
_class
|
protected Any |
_default
|
static java.lang.Object[] |
newInstance
|
static java.lang.Object[] |
p_append
|
static java.lang.Object[] |
p_both
|
static java.lang.Object[] |
p_concat
|
static java.lang.Object[] |
p_crop
|
static java.lang.Object[] |
p_cut
|
static java.lang.Object[] |
p_enqueue
|
static java.lang.Object[] |
p_find
|
static java.lang.Object[] |
p_findAll
|
static java.lang.Object[] |
p_get
|
static java.lang.Object[] |
p_grep
|
static java.lang.Object[] |
p_grepKeys
|
static java.lang.Object[] |
p_grepValues
|
static java.lang.Object[] |
p_insert
|
static java.lang.Object[] |
p_intersect
|
static java.lang.Object[] |
p_join
|
static java.lang.Object[] |
p_key
|
static java.lang.Object[] |
p_next
|
static java.lang.Object[] |
p_nextKey
|
static java.lang.Object[] |
p_nextValue
|
static java.lang.Object[] |
p_pop
|
static java.lang.Object[] |
p_pos
|
static java.lang.Object[] |
p_previous
|
static java.lang.Object[] |
p_previousKey
|
static java.lang.Object[] |
p_previousValue
|
static java.lang.Object[] |
p_push
|
static java.lang.Object[] |
p_select
|
static java.lang.Object[] |
p_set
|
static java.lang.Object[] |
p_setDefault
|
static java.lang.Object[] |
p_slice
|
static java.lang.Object[] |
p_sort
|
static java.lang.Object[] |
p_sortByKey
|
static java.lang.Object[] |
p_sortByValue
|
static java.lang.Object[] |
p_subtract
|
static java.lang.Object[] |
p_swap
|
static java.lang.Object[] |
p_swapOrder
|
static java.lang.Object[] |
p_union
|
static java.lang.Object[] |
p_unshift
|
static java.lang.Object[] |
p_value
|
| Fields inherited from class anvil.core.Any |
ARRAY0, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, EMPTY_STRING, EMPTY_TUPLE, FALSE, INF, IS_ARRAY, IS_BINARY, IS_BOOLEAN, IS_BUFFER, IS_CLASS, IS_DOUBLE, IS_ENUMERATION, IS_INF, IS_INT, IS_LIST, IS_MAP, IS_NEG_INF, IS_NULL, IS_PATTERN, IS_RANGE, IS_STRING, IS_TUPLE, IS_UNDEFINED, MINUS_ONE, NAN, NEG_INF, NULL, ONE, p_compareTo, p_each, p_equals, p_pipe, THREE, TRUE, TWO, UNDEFINED, ZERO |
| Constructor Summary | |
Array()
Constructs a new, empty hashlist with a default capacity and load factor. |
|
Array(int initialCapacity)
Constructs a new, empty hashlist with the specified initial capacity and default load factor. |
|
Array(int initialCapacity,
float loadFactor)
Constructs a new, empty hashlist with the specified initial capacity and the specified load factor. |
|
| Method Summary | |
Array |
append(Any value)
|
Array |
append(Any key,
Any value)
|
Array |
append(int index,
Any value)
|
Array |
append(java.lang.String index,
Any value)
|
Array |
attach(Any value)
|
ClassType |
classOf()
Returns the type of this Any. |
void |
clear()
Clears this hashlist so that it contains no keys. |
java.lang.Object |
clone()
Creates a shallow copy of this hashlist. |
protected int |
compare(Any other)
|
int |
compareTo(Array b)
|
boolean |
contains(Any value)
Tests if some key maps into the specified value in this hashlist. |
boolean |
containsKey(Any key)
Tests if the specified object is a key in this hashlist. |
boolean |
containsValue(Any value)
|
Any |
copy()
Creates a copy of this array. |
Array |
crop(int start,
int length)
|
boolean |
cut(Any start,
Any end)
|
boolean |
cut(int start,
int length)
|
boolean |
deleteAttribute(Context context,
java.lang.String attribute)
|
boolean |
deleteReference(Context context,
Any index)
|
Any |
elementAt(int index)
|
BindingIterator |
elements()
Returns an iterator of the values in this hashlist. |
Array.Entry |
entryAt(int index)
|
boolean |
equals(java.lang.Object obj)
Tests for equality. |
Any |
execute(Context context)
|
Any |
execute(Context context,
Any param1)
|
Any |
execute(Context context,
Any[] parameters)
|
Any |
execute(Context context,
Any param1,
Any param2)
|
Any |
execute(Context context,
Any param1,
Any param2,
Any param3)
|
Any |
execute(Context context,
Any param1,
Any param2,
Any param3,
Any param4)
|
Any |
get(Any key)
Returns the value to which the specified key is mapped in this hashlist. |
Any |
get(int index)
Returns the Any to which the specified index (Integer) is mapped in this hashlist. |
Any |
getAttribute(Context context,
java.lang.String attribute)
|
Array.Entry |
getEntry(Any key)
Returns the entry to which the specified key is mapped in this hashlist. |
Array.Entry |
getEntry(int index)
Returns the Entry to which the specified index (Integer)
is mapped in this hashlist. |
int |
getNextSequence()
Gets the next available integer slot. |
Any |
getReference(Context context,
Any index)
|
int |
hashCode()
|
int |
indexOf(Any key)
|
Array |
insert(Any value)
|
Array |
insert(Any key,
Any value)
|
Array |
insert(Any start,
Any end,
Any slice)
|
Array |
insert(int start,
int length,
Array array)
|
Array |
insertAt(int index,
Any value)
|
Array |
insertAt(int index,
Any key,
Any value)
|
Array |
intersect(Array set)
|
boolean |
isArray()
Checks if this any is array. |
boolean |
isEmpty()
Tests if this hashlist maps no keys to values. |
boolean |
isMutable()
|
protected boolean |
isReverseOrder(Array.Entry p,
Array.Entry q)
|
BindingIterator |
iterator()
|
Any |
keyAt(int index)
|
BindingIterator |
keys()
Returns an iterator of the keys in this hashlist. |
BindingIterator |
keysAndElements()
Returns an iterator of the values in this hashlist. |
Any |
m_append(Any element,
Any[] elements)
|
Any |
m_both(int index)
|
Any |
m_clear()
|
Any |
m_concat(Any value)
|
Any |
m_crop(int start,
int length)
|
Any |
m_cut(int start,
int length)
|
Any |
m_dequeue()
|
Any |
m_elements()
|
Any |
m_enqueue(Any p,
Any q)
|
Any |
m_find(Any value)
|
Any |
m_findAll(Any value)
|
Any |
m_first()
|
Any |
m_firstKey()
|
Any |
m_firstValue()
|
Any |
m_get(Any[] parameters)
|
Any |
m_getDefault()
|
Any |
m_getElements()
|
Any |
m_getKeys()
|
Any |
m_grep(Context context,
Any key,
Any value,
boolean both)
|
Any |
m_grepKeys(Context context,
Any pattern)
|
Any |
m_grepValues(Context context,
Any pattern)
|
Any |
m_insert(int start,
Any p,
Any insert)
|
Any |
m_intersect(Any array)
|
Any |
m_join(java.lang.String clue)
|
Any |
m_key(int index)
|
Any |
m_keys()
|
Any |
m_keysAndElements()
|
Any |
m_last()
|
Any |
m_lastKey()
|
Any |
m_lastValue()
|
Any |
m_minmax()
|
Any |
m_minmaxKeys()
|
Any |
m_next(Any key)
|
Any |
m_nextKey(Any key)
|
Any |
m_nextValue(Any key)
|
Any |
m_pop(Any index)
|
Any |
m_pos(Any key)
|
Any |
m_previous(Any key)
|
Any |
m_previousKey(Any key)
|
Any |
m_previousValue(Any key)
|
Any |
m_push(Any element,
Any[] elements)
|
Any |
m_reverse()
|
Any |
m_select(Context context,
Any selector)
|
Any |
m_set(Context context,
Any[] parameters)
|
Any |
m_setDefault(Any value)
|
Any |
m_shift()
|
Any |
m_size()
Exposed methods |
Any |
m_sizeOf()
|
Any |
m_slice(int start,
int length)
|
Any |
m_sort(Context context,
Any comparator_)
|
Any |
m_sortByKey(boolean ascending)
|
Any |
m_sortByValue(boolean ascending)
|
Any |
m_subtract(Any array)
|
Any |
m_swap(Any key1,
Any key2)
|
Any |
m_swapOrder(Any key1,
Any key2)
|
Any |
m_union(Any array)
|
Any |
m_unshift(Any[] elements)
|
Any |
m_value(int index)
|
static Any |
newInstance(Context context,
Any[] list)
|
Array.Entry |
nextOf(Any index)
|
Array.Entry |
previousOf(Any index)
|
Any |
put(Any key,
Any value)
Maps the specified key to the specified
value in this hashlist. |
Any |
put(int index,
Any value)
Maps the specified index to the specified
value in this hashlist. |
protected Any |
putBefore(Any key,
Any value,
Array.Entry before)
|
protected Any |
putBefore(Any value,
Array.Entry entry)
|
protected Any |
putBefore(int index,
Any value,
Array.Entry entry)
|
protected Array.Entry |
putEntry(Any key,
Any value)
Maps the specified key to the specified
value in this hashlist. |
Array.Entry |
putEntry(int index,
Any value)
Maps the specified index to the specified
value in this hashlist. |
protected void |
rehash()
Rehashes the contents of the hashlist into a hashlist with a larger capacity. |
Any |
remove(Any key)
Removes the key (and its corresponding value) from this hashlist. |
Any |
removeAt(int index)
|
Array |
reverse()
List operations |
void |
serialize(Serializer serializer)
Serializes this Array to OutputStream. |
Any |
setAt(int index,
Any value)
|
Any |
setAttribute(Context context,
java.lang.String attribute,
Any value)
|
Array |
setDefault(Any defaultValue)
|
Any |
setReference(Context context,
Any value)
|
Any |
setReference(Context context,
Any index,
Any value)
|
int |
size()
Returns the number of keys in this hashlist. |
int |
sizeOf()
Returns the logical size of this any. |
Array |
slice(Any start,
Any end)
|
Array |
slice(Array slice,
Any start,
Any end)
|
Array |
slice(Array array,
int start,
int length)
|
Array |
slice(int start,
int length)
|
Array |
sort(java.util.Comparator comparator,
boolean ascending)
|
Array |
subtract(Array set)
|
java.io.Writer |
toAnvil(java.io.Writer writer)
|
Array |
toArray()
Gets the contained vaelue as Array. |
Any[] |
toArray(boolean values)
|
boolean |
toBoolean()
Gets the contained value as boolean. |
Code |
toCode(Code code)
|
java.lang.Object |
toObject()
Gets the contained value as java.lang.Object. |
java.lang.String |
toString()
Returns a rather long string representation of this hashlist. |
int |
typeOf()
Returns the type of contained value. |
Array |
union(Array set)
|
static Array |
unserialize(Unserializer unserializer)
|
protected void |
updateSequence(Any key)
|
| Methods inherited from class anvil.core.Any |
_clone, _copy, _invoke, _invoke, _invoke, _invoke, _invoke, _invoke, _serialize, _unserialize, _wakeup, add, classNameOf, coerce, compareTo, concat, create, create, create, create, create, create, create, create, create, create, create, create, create, create, decrease, divide, getRef, has, increase, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, isBinary, isBoolean, isBuffer, isDefined, isDouble, isInstanceOf, isInt, isIterator, isList, isMap, isNull, isPattern, isRange, isRef, isSequence, isString, isTuple, isUndefined, m_clone, m_compareTo, m_copy, m_each, m_equals, m_hashCode, m_pipe, m_toBoolean, m_toString, minus, modulo, multiply, not, plus, setRef, subtract, toAnvil, toAnyBoolean, toAnyDouble, toAnyInt, toAnyString, toBinary, toBuffer, toByte, toChar, toDouble, toInt, toList, toLong, toMap, toPattern, toRange, toTuple, type |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.Object[] newInstance
protected Any _default
public static final java.lang.Object[] p_join
public static final java.lang.Object[] p_push
public static final java.lang.Object[] p_pop
public static final java.lang.Object[] p_unshift
public static final java.lang.Object[] p_select
public static final java.lang.Object[] p_slice
public static final java.lang.Object[] p_cut
public static final java.lang.Object[] p_crop
public static final java.lang.Object[] p_append
public static final java.lang.Object[] p_concat
public static final java.lang.Object[] p_insert
public static final java.lang.Object[] p_union
public static final java.lang.Object[] p_intersect
public static final java.lang.Object[] p_subtract
public static final java.lang.Object[] p_pos
public static final java.lang.Object[] p_key
public static final java.lang.Object[] p_value
public static final java.lang.Object[] p_both
public static final java.lang.Object[] p_next
public static final java.lang.Object[] p_nextKey
public static final java.lang.Object[] p_nextValue
public static final java.lang.Object[] p_previous
public static final java.lang.Object[] p_previousKey
public static final java.lang.Object[] p_previousValue
public static final java.lang.Object[] p_sortByKey
public static final java.lang.Object[] p_sortByValue
public static final java.lang.Object[] p_sort
public static final java.lang.Object[] p_find
public static final java.lang.Object[] p_findAll
public static final java.lang.Object[] p_grep
public static final java.lang.Object[] p_grepKeys
public static final java.lang.Object[] p_grepValues
public static final java.lang.Object[] p_setDefault
public static final java.lang.Object[] p_enqueue
public static final java.lang.Object[] p_get
public static final java.lang.Object[] p_set
public static final java.lang.Object[] p_swap
public static final java.lang.Object[] p_swapOrder
public static final NativeClass _class
| Constructor Detail |
public Array(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the hashlist.loadFactor - a number between 0.0 and 1.0.
java.lang.IllegalArgumentException - if the initial capacity is less
than or equal to zero, or if the load factor is less than
or equal to zero.public Array(int initialCapacity)
initialCapacity - the initial capacity of the hashlist.public Array()
| Method Detail |
public static final Any newInstance(Context context,
Any[] list)
protected void rehash()
protected void updateSequence(Any key)
public int size()
public boolean isEmpty()
true if this hashlist maps no keys to values;
false otherwise.public BindingIterator keys()
elements()public BindingIterator elements()
keys()public BindingIterator keysAndElements()
keys()public boolean containsValue(Any value)
public boolean contains(Any value)
containsKey
method.
contains in class Anyvalue - a value to search for.
true if some key maps to the
value argument in this hashlist;
false otherwise.
java.lang.NullPointerException - if the value is null.containsKey(anvil.core.Any)public boolean containsKey(Any key)
key - possible key.
true if the specified object is a key in this
hashlist; false otherwise.contains(anvil.core.Any)public Array.Entry getEntry(Any key)
key - a key in the hashlist.
null if the key is not mapped to any entry in
this hashlist.put(anvil.core.Any, anvil.core.Any)public Array.Entry getEntry(int index)
Entry to which the specified index (Integer)
is mapped in this hashlist.
Entry to which the index is mapped in this hashlist;
null if the index is not mapped to any Entry in
this hashlist.put(anvil.core.Any, anvil.core.Any)public Any get(Any key)
key - a key in the hashlist.
null if the key is not mapped to any value in
this hashlist.put(anvil.core.Any, anvil.core.Any)public Any get(int index)
Entry to which the index is mapped in this hashlist;
null if the index is not mapped to any entry in
this hashlist.put(anvil.core.Any, anvil.core.Any)
public Any put(Any key,
Any value)
key to the specified
value in this hashlist. Neither the key nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
key - the hashlist key.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is
null.get(anvil.core.Any)
protected Any putBefore(Any key,
Any value,
Array.Entry before)
protected Any putBefore(int index,
Any value,
Array.Entry entry)
protected Any putBefore(Any value,
Array.Entry entry)
protected Array.Entry putEntry(Any key,
Any value)
key to the specified
value in this hashlist. Neither the key nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
key - the hashlist key.value - the value.
java.lang.NullPointerException - if the key or value is
null.getEntry(anvil.core.Any)
public Any put(int index,
Any value)
index to the specified
value in this hashlist. Neither the index nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
index - the hashlist index.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the index or value is
null.get(int)
public Array.Entry putEntry(int index,
Any value)
index to the specified
value in this hashlist. Neither the index nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
index - the hashlist index.value - the value.
java.lang.NullPointerException - if the index or value is
null.anvil.core.Array#get(java.lang.Integer)public Any remove(Any key)
key - the key that needs to be removed.
null if the key did not have a mapping.public void clear()
public java.lang.Object clone()
clone in class Anypublic Any copy()
copy in class Anypublic java.lang.String toString()
toString in class Any
public java.io.Writer toAnvil(java.io.Writer writer)
throws java.io.IOException
toAnvil in class Anyjava.io.IOExceptionpublic Code toCode(Code code)
toCode in class Anypublic int getNextSequence()
public Array reverse()
public Array crop(int start,
int length)
public Array.Entry entryAt(int index)
public int indexOf(Any key)
public Any keyAt(int index)
public Any elementAt(int index)
public Array append(Any value)
public Array append(int index,
Any value)
public Array append(java.lang.String index,
Any value)
public Array append(Any key,
Any value)
public Array insert(Any value)
public Array insert(Any key,
Any value)
public Array insertAt(int index,
Any key,
Any value)
public Array insertAt(int index,
Any value)
public Any setAt(int index,
Any value)
public Any removeAt(int index)
public Array.Entry previousOf(Any index)
public Array.Entry nextOf(Any index)
public Any[] toArray(boolean values)
public Array slice(Any start,
Any end)
protected boolean isReverseOrder(Array.Entry p,
Array.Entry q)
public Array slice(Array slice,
Any start,
Any end)
public Array slice(int start,
int length)
public Array slice(Array array,
int start,
int length)
public boolean cut(int start,
int length)
public boolean cut(Any start,
Any end)
public Array insert(int start,
int length,
Array array)
public Array insert(Any start,
Any end,
Any slice)
public Array union(Array set)
public Array intersect(Array set)
public Array subtract(Array set)
public Array sort(java.util.Comparator comparator,
boolean ascending)
public void serialize(Serializer serializer)
throws java.io.IOException
serialize in class Anyjava.io.IOException - if something goes wrong
public static final Array unserialize(Unserializer unserializer)
throws UnserializationException
UnserializationExceptionpublic Array setDefault(Any defaultValue)
public ClassType classOf()
Any
classOf in class Anypublic int typeOf()
Any
typeOf in class Anypublic int sizeOf()
Any
sizeOf in class Any