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>
public class SetView<E> extends Object implements 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 Modifier and Type Class Description static classSetView.SetViewIterator<E>Iterator.
-
Constructor Summary
Constructors Constructor Description SetView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(Collection<? extends E> coll)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object obj)inthashCode()booleanisEmpty()Iterator<E>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> coll)booleanretainAll(Collection<?> coll)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()SetView<E>union(Set<E> set)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
-
-
-
-
Method Detail
-
union
public SetView<E> union(Set<E> set)
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
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
add
public boolean add(E e)
-
remove
public boolean remove(Object o)
-
addAll
public boolean addAll(Collection<? extends E> coll)
-
removeAll
public boolean removeAll(Collection<?> coll)
-
retainAll
public boolean retainAll(Collection<?> coll)
-
clear
public void clear()
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
-