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:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
public class SetView<E> extends java.lang.Object implements java.util.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(java.util.Collection<? extends E> coll)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object obj)inthashCode()booleanisEmpty()java.util.Iterator<E>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> coll)booleanretainAll(java.util.Collection<?> coll)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()SetView<E>union(java.util.Set<E> set)Adds a set to the view.
-
-
-
Field Detail
-
sets
private final java.util.List<java.util.Set<E>> sets
-
-
Method Detail
-
union
public SetView<E> union(java.util.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(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
-
clear
public void clear()
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-