Package eu.bandm.tools.umod.runtime
Class CheckedSet<T>
java.lang.Object
eu.bandm.tools.umod.runtime.CheckedSet<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,Set<T>
Implements a Set which is strict in all its elements.
The implementation is done by delegation to some peer object from a
predefined java runtime class. The kind of implementation (tree set or
hash set) can be selected by a parameter to the constructor.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCheckedSet(CheckedSet.implementations implementation) CheckedSet(Set<? extends T> prototype) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) asSorted()Returns a sorted, unmodifiable view IFF the backing peer is a sorted set.static <T> CheckedSet<T> voidclear()booleanbooleancontainsAll(Collection<?> c) booleaninthashCode()booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) static <T1> CheckedSet<T1> singleton(T1 x) intsize()Object[]toArray()<T1> T1[]toArray(T1[] a) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
spliterator
-
Field Details
-
peer
-
-
Constructor Details
-
CheckedSet
public CheckedSet() -
CheckedSet
-
CheckedSet
-
-
Method Details
-
check
-
toString
-
asSorted
Returns a sorted, unmodifiable view IFF the backing peer is a sorted set. This is currently only the case when theimplementstionhas been explicitly seelected astreeon creation.- Throws:
UnsupportedOperationException- if the backing peer does not offer a sorted view.
-
add
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
equals
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
iterator
-
remove
-
removeAll
-
retainAll
-
size
public int size() -
toArray
-
toArray
public <T1> T1[] toArray(T1[] a) -
singleton
-