Package nl.vpro.util
Class ResortedSortedSet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
nl.vpro.util.ResortedSortedSet<T>
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,Set<T>
,SortedSet<T>
A modifiable SortedSet, that wraps another collection (changes are reflected), with an explicit sort order.
- Since:
- 2.1
- Author:
- Michiel Meeuwissen
- See Also:
-
Constructor Summary
ConstructorDescriptionResortedSortedSet
(Collection<T> wrapped, Comparator<T> comparator, Consumer<T>... addListeners) ResortedSortedSet
(SortedSet<T> set, Collection<T> wrapped, Consumer<T>... addListeners) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Comparator<? super T>
first()
iterator()
last()
static <S extends Comparable<?>>
ResortedSortedSet<S>of
(Collection<S> wrapped, Consumer<S>... addListener) int
size()
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
Methods inherited from interface java.util.SortedSet
spliterator
-
Constructor Details
-
ResortedSortedSet
@SafeVarargs public ResortedSortedSet(Collection<T> wrapped, Comparator<T> comparator, Consumer<T>... addListeners) -
ResortedSortedSet
@SafeVarargs public ResortedSortedSet(SortedSet<T> set, Collection<T> wrapped, Consumer<T>... addListeners)
-
-
Method Details
-
of
public static <S extends Comparable<?>> ResortedSortedSet<S> of(Collection<S> wrapped, Consumer<S>... addListener) -
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceSet<T>
- Specified by:
size
in classAbstractCollection<T>
-
add
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceSet<T>
- Overrides:
add
in classAbstractCollection<T>
-
comparator
- Specified by:
comparator
in interfaceSortedSet<T>
-
subSet
-
headSet
-
tailSet
-
first
-
last
-