|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<T> ch.elca.el4j.util.collections.impl.ExtendedArrayList<T>
T
- the member typepublic class ExtendedArrayList<T>
A default implementation of the ExtendedWritableList interface.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
ExtendedArrayList()
creates an empty list. |
|
ExtendedArrayList(Iterable<T> iter)
Creates a list by shallow-copying iter . |
|
ExtendedArrayList(T... ts)
creates a list containing the arguments. |
Method Summary | ||
---|---|---|
void |
add(T... ts)
equivalent to calling add for each argument, in order. |
|
FilteredList<T> |
filtered(Filter<? super T> filter)
Convenience method returning a filtered view on this collection. |
|
|
mapped(Function<? super T,O> function)
Convenience method returning a TransformedList view to this
list. |
|
void |
orderLike(List<? extends T> example)
Reorders this list's elements by example. |
|
void |
remove(T... ts)
equivalent to calling remove for each argument, in order. |
|
void |
swap(int i,
int j)
exchanges the elements located at indices i and j . |
|
T[] |
toArray(Class<T> c)
|
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, 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, 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 |
Constructor Detail |
---|
public ExtendedArrayList()
public ExtendedArrayList(T... ts)
ts
- .public ExtendedArrayList(Iterable<T> iter)
iter
.
iter
- the iterable to copy.Method Detail |
---|
public void add(T... ts)
add
for each argument, in order.
add
in interface ExtendedWritableList<T>
ts
- the objects to be addedpublic void remove(T... ts)
remove
for each argument, in order.
remove
in interface ExtendedWritableList<T>
ts
- the objects to be addedpublic void swap(int i, int j)
i
and j
.
swap
in interface ExtendedReorderableList<T>
i
- ...j
- ...public void orderLike(List<? extends T> example) throws NoSuchElementException
example
as far as
element equality is concerned, or throws
a NoSuchElementException
if this is not possible.
In either case, the order of the remaining elements may be affected.
This method may require quadratic time.
Formally, if this method completes normally, the condition
∀ i < example.size();
c.apply(this.get(i)).equals(example.get(i))
is true.
orderLike
in interface ExtendedReorderableList<T>
example
- a list whose elements are in the descired order
NoSuchElementException
- if the example's order can not be
duplicated by reordering alone.public T[] toArray(Class<T> c)
toArray
in interface ExtendedList<T>
c
- the element type for the new array
public <O> TransformedList<T,O> mapped(Function<? super T,O> function)
TransformedList
view to this
list.
mapped
in interface ExtendedList<T>
function
- the transformation function to apply to each element
public FilteredList<T> filtered(Filter<? super T> filter)
filtered
in interface ExtendedList<T>
filter
- the filter deciding which elements are included
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |