|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.molae.pipe.basic.ObjectProxy<B> net.sf.molae.pipe.basic.CollectionProxy<B,E> net.sf.molae.pipe.basic.CollectionAsSet<B,E> net.sf.molae.pipe.sorted.SetAsSortedSet<Set<E>,E> net.sf.molae.pipe.genimpl.SortedListAsSortedSet<E>
public class SortedListAsSortedSet<E>
Sorted list backed implementation of the SortedSet
interface.
Nested Class Summary | |
---|---|
protected static class |
SortedListAsSortedSet.SortedListAsSet<E>
Sorted list backed implementation of the Set interface. |
Constructor Summary | |
---|---|
SortedListAsSortedSet()
Creates a new sorted set based on a Vector and
natural ordering. |
|
SortedListAsSortedSet(List<E> base)
Creates a new sorted list based sorted set with the specified base list and natural ordering. |
|
SortedListAsSortedSet(List<E> base,
Comparator<? super E> comparator)
Creates a new sorted list based sorted set with the specified base list and comparator. |
Method Summary | ||
---|---|---|
E |
first()
Returns the first (lowest) element currently in this sorted set. |
|
protected List<E> |
getList()
Returns the backing list of this sorted set. |
|
E |
last()
Returns the last (highest) element currently in this sorted set. |
|
static
|
newInstance(Collection<? extends E> c)
Creates a new sorted set based on a Vector and
natural ordering
containing the elements in the specified collection. |
Methods inherited from class net.sf.molae.pipe.sorted.SetAsSortedSet |
---|
comparator, compare, containsAll, getBoundComparator, getFromElement, getSubSet, getToElement, headSet, newInstance, removeAll, retainAll, setConsistent, subSet, tailSet, useMerge |
Methods inherited from class net.sf.molae.pipe.basic.CollectionAsSet |
---|
equals, hashCode, isSet, newInstance |
Methods inherited from class net.sf.molae.pipe.basic.CollectionProxy |
---|
add, addAll, clear, contains, isEmpty, iterator, remove, size, toArray, toArray |
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy |
---|
assertNotNull, getBase, toString, toVerboseString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, equals, hashCode, isEmpty, iterator, remove, size, toArray, toArray |
Constructor Detail |
---|
public SortedListAsSortedSet(List<E> base, Comparator<? super E> comparator)
base
- the list where the set elements are stored.
If the list is not empty its elements must be sorted by the
specified comparatorcomparator
- determines the sorting in the base list
NullPointerException
- if the specified list is
null
.public SortedListAsSortedSet(List<E> base)
base
- the list where the set elements are stored.
If the list is not empty its elements must be sorted.
NullPointerException
- if the specified list is
null
.public SortedListAsSortedSet()
Vector
and
natural ordering.
Method Detail |
---|
protected final List<E> getList()
public static <E extends Comparable<? super E>> SortedSet<E> newInstance(Collection<? extends E> c)
Vector
and
natural ordering
containing the elements in the specified collection.
c
- the collection whose elements are to be placed into this set.public E first()
first
in interface SortedSet<E>
first
in class SetAsSortedSet<Set<E>,E>
NoSuchElementException
- sorted set is empty.public E last()
last
in interface SortedSet<E>
last
in class SetAsSortedSet<Set<E>,E>
NoSuchElementException
- sorted set is empty.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |