|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.ArrayList | +--magi.toolkit.util.MagiList
A List (or Collection) that enhances the functionality of a standard List, also supporting "immutable".
Field Summary | |
static int |
ADD_MAP_KEYS
|
static int |
ADD_MAP_VALUES
|
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
MagiList()
Default constructor. |
|
MagiList(java.util.Collection collection)
Creates a List and pre-populates this List with elements from the Collection object, eg another List, or Set, Vector, etc. |
|
MagiList(int initialCapacity)
Creates a List with the initial capacity specified here. |
|
MagiList(java.util.Map map,
int addType)
Creates a List and pre-populates this List with elements from the Map provided. |
|
MagiList(java.lang.Object[] objects)
Creates a List and pre-populates this List with elements from the object array provided. |
Method Summary | |
boolean |
add(int index,
java.util.Map map,
java.lang.Object key)
Adds a "value" element from the Map provided, which matches the key passed in. |
boolean |
add(java.util.Map map,
java.lang.Object key)
Adds a "value" element from the Map provided, which matches the key passed in. |
boolean |
addAll(int index,
java.util.Map map,
int addType)
Populates this List with elements from the Map provided. |
boolean |
addAll(int index,
java.lang.Object[] objects)
Populates this List with elements from the object array provided. |
boolean |
addAll(java.util.Map map,
int addType)
Populates this List with elements from the Map provided. |
boolean |
addAll(java.lang.Object[] objects)
Populates this List with elements from the object array provided. |
IList |
asImmutable()
Returns the "immutable" list for this object. |
void |
reverse()
Reverses the order of all elements in this List. |
void |
sort()
Sorts elements in this List into ascending order. |
void |
sort(java.util.Comparator comparator)
Sorts elements in this List in the order defined by the Comparator. |
void |
sortAscending()
Sorts elements in this List into ascending order. |
void |
sortDescending()
Sorts elements in this List into ascending order. |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, remove, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Methods inherited from interface magi.toolkit.util.IList |
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, size, subList, toArray, toArray |
Field Detail |
public static final int ADD_MAP_KEYS
public static final int ADD_MAP_VALUES
Constructor Detail |
public MagiList()
public MagiList(int initialCapacity)
initialCapacity
- the initial size of the List array.public MagiList(java.util.Collection collection)
collection
- a Collection of objects to pre-populate.public MagiList(java.lang.Object[] objects)
objects
- an array of object elements to pre-populate.public MagiList(java.util.Map map, int addType)
map
- the Map object to pre-populate this List from.addType
- the type of objects to add, either keys or values, see
ADD_MAP constants defined by this class for possible
values.Method Detail |
public boolean addAll(java.lang.Object[] objects)
objects
- an array of object elements to populate.
public boolean addAll(int index, java.lang.Object[] objects)
objects
- an array of object elements to populate.
public boolean addAll(java.util.Map map, int addType)
map
- the Map object to populate this List from.addType
- the type of objects to add, either keys or values, see
ADD_MAP constants defined by this class for possible
values.public boolean addAll(int index, java.util.Map map, int addType)
index
- the index to begin adding elements in this List.map
- the Map object to populate this List from.addType
- the type of objects to add, either keys or values, see
ADD_MAP constants defined by this class for possible
values.public boolean add(java.util.Map map, java.lang.Object key)
map
- a Map object to extract a value from.key
- the "key" of the value to add to this List.
public boolean add(int index, java.util.Map map, java.lang.Object key)
index
- the index to add this element at.map
- a Map object to extract a value from.key
- the "key" of the value to add to this List.
public void sort()
Arrays.sort(Object[])
public void sort(java.util.Comparator comparator)
Arrays.sort(Object[],Comparator)
public void sortAscending()
Arrays.sort(Object[])
public void sortDescending()
Arrays.sort(Object[])
public void reverse()
public IList asImmutable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |