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 class
SetView.SetViewIterator<E>
Iterator.
-
Constructor Summary
Constructors Constructor Description SetView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(Collection<? extends E> coll)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object obj)
int
hashCode()
boolean
isEmpty()
Iterator<E>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> coll)
boolean
retainAll(Collection<?> coll)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] a)
String
toString()
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:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in 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)
-
-