Interface ExtendedReorderableList<T>

Type Parameters:
T - the member type.
All Superinterfaces:
Collection<T>, ExtendedList<T>, Iterable<T>, List<T>, RandomAccess
All Known Subinterfaces:
ExtendedWritableList<T>, TransformedList<I,O>
All Known Implementing Classes:
DefaultTransformedList, ExtendedArrayList

public interface ExtendedReorderableList<T>
extends ExtendedList<T>, RandomAccess

An extended interface, random access list permitting element reordering, but not neccessarily inserting/removing elements.

Adrian Moos (AMS)
Last check-in date:
2009-08-04 14:35:53 +0200 (Di, 04. Aug 2009) by swismer for revision 3875

Method Summary
 void orderLike(List<? extends T> example)
          Reorders this list's elements by example.
 void swap(int i, int j)
          exchanges the elements located at indices i and j.
Methods inherited from interface ch.elca.el4j.util.collections.ExtendedList
filtered, mapped, toArray
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

Method Detail


void swap(int i,
          int j)
exchanges the elements located at indices i and j.

i - ...
j - ...


void orderLike(List<? extends T> example)
               throws NoSuchElementException
Reorders this list's elements by example. This method makes sure that the result will start with the sublist 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.

example - a list whose elements are in the descired order
NoSuchElementException - if the example's order can not be duplicated by reordering alone.

Copyright © 2005-2011 ELCA. All Rights Reserved.