Package com.networknt.schema.utils
Class SetView<E>
java.lang.Object
com.networknt.schema.utils.SetView<E>
- Type Parameters:
E
- the type contains in the set
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
View of a list of sets.
This is used for performance to reduce copies but breaks the semantics of the set where the elements must all be unique.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> coll) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> coll) boolean
retainAll
(Collection<?> coll) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Adds a set to the view.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
-
Constructor Details
-
SetView
public SetView()
-
-
Method Details
-
union
Adds a set to the view.- Parameters:
set
- to add to the view- Returns:
- the view
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
add
-
remove
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
hashCode
public int hashCode() -
equals
-
toString
-