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
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCheckedSet
(CheckedSet.implementations implementation) CheckedSet
(Set<? extends T> prototype) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) asSorted()
Returns a sorted, unmodifiable view IFF the backing peer is a sorted set.static <T> CheckedSet<T>
void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) static <T1> CheckedSet<T1>
singleton
(T1 x) int
size()
Object[]
toArray()
<T1> T1[]
toArray
(T1[] a) 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
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 theimplementstion
has been explicitly seelected astree
on creation.- Throws:
UnsupportedOperationException
- if the backing peer does not offer a sorted view.
-
add
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in 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
-