|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
com.google.common.collect.Sets.SetView<E>
public abstract static class Sets.SetView<E>
An unmodifiable view of a set which may be backed by other sets; this view
will change as the backing sets do. Contains methods to copy the data into
a new set which will then remain stable. There is usually no reason to
retain a reference of type SetView
; typically, you either use it
as a plain Set
, or immediately invoke immutableCopy()
or
copyInto(S)
and forget the SetView
itself.
Method Summary | ||
---|---|---|
|
copyInto(S set)
Copies the current contents of this set view into an existing set. |
|
ImmutableSet<E> |
immutableCopy()
Returns an immutable copy of the current contents of this set view. |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray |
Method Detail |
---|
public ImmutableSet<E> immutableCopy()
Warning: this may have unexpected results if a backing set of
this view uses a nonstandard notion of equivalence, for example if it is
a TreeSet
using a comparator that is inconsistent with Object.equals(Object)
.
public <S extends java.util.Set<E>> S copyInto(S set)
set.addAll(this)
, assuming that
all the sets involved are based on the same notion of equivalence.
set
, for convenience
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |