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 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(java.util.Collection<? extends E> coll)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> coll)
boolean
retainAll(java.util.Collection<?> coll)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
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:
toString
in classjava.lang.Object
-
-