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 TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> coll) voidclear()booleanbooleancontainsAll(Collection<?> c) booleaninthashCode()booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> coll) booleanretainAll(Collection<?> coll) intsize()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, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
add
-
remove
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
hashCode
public int hashCode() -
equals
-
toString
-