public interface CacheSet<V extends java.io.Serializable> extends GroupCacheable
isCacheDisabled
限定符和类型 | 方法和说明 |
---|---|
int |
add(V o)
Adds the specified element to this set if it is not already present
(optional operation).
|
int |
addAll(java.util.Collection<? extends V> c)
Adds all of the elements in the specified collection to this set if
they're not already present (optional operation).
|
int |
clearAndAddAll(java.util.Collection<? extends V> set)
清除缓存并将Map中的所有项目设置到缓存中。
|
boolean |
contains(V o)
Returns true if this set contains the specified element.
|
java.util.Iterator<V> |
iterator()
Returns an iterator over the elements in this set.
|
default V |
pop()
remove and return the random value in the Set.
|
int |
remove(V o)
Removes the specified element from this set if it is present (optional
operation).
|
int |
removeAll(java.util.Collection<? extends V> c)
Removes from this set all of its elements that are contained in the
specified collection (optional operation).
|
java.util.Set<V> |
toSet()
将缓存转化为Set表示。
|
allowRedisFlush, clear, getFullName, getGroup, getName, getStatistics, isEmpty, needConsistent, size
boolean contains(V o)
e
such that (o==null ? e==null :
o.equals(e))
.o
- element whose presence in this set is to be tested.java.lang.ClassCastException
- if the type of the specified element is incompatible with
this set (optional).java.lang.NullPointerException
- if the specified element is null and this set does not
support null elements (optional).java.util.Iterator<V> iterator()
java.util.Set<V> toSet()
int add(V o)
o
, to this set if this set contains no element
e
such that (o==null ? e==null :
o.equals(e))
. If this set already contains the specified element,
the call leaves this set unchanged and returns false. In
combination with the restriction on constructors, this ensures that sets
never contain duplicate elements.
The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throwing an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.
o
- element to be added to this set.java.lang.UnsupportedOperationException
- if the add method is not supported by this set.java.lang.ClassCastException
- if the class of the specified element prevents it from being
added to this set.java.lang.NullPointerException
- if the specified element is null and this set does not
support null elements.java.lang.IllegalArgumentException
- if some aspect of the specified element prevents it from
being added to this set.int remove(V o)
e
such that
(o==null ? e==null : o.equals(e))
, if the set contains such
an element. Returns true if the set contained the specified
element (or equivalently, if the set changed as a result of the call).
(The set will not contain the specified element once the call returns.)o
- object to be removed from this set, if present.java.lang.ClassCastException
- if the type of the specified element is incompatible with
this set (optional).java.lang.NullPointerException
- if the specified element is null and this set does not
support null elements (optional).java.lang.UnsupportedOperationException
- if the remove method is not supported by this set.int addAll(java.util.Collection<? extends V> c)
c
- collection whose elements are to be added to this set.java.lang.UnsupportedOperationException
- if the addAll method is
not supported by this set.java.lang.ClassCastException
- if the class of some element of the
specified collection prevents it from being added to this
set.java.lang.NullPointerException
- if the specified collection contains one
or more null elements and this set does not support null
elements, or if the specified collection is null.java.lang.IllegalArgumentException
- if some aspect of some element of the
specified collection prevents it from being added to this
set.int clearAndAddAll(java.util.Collection<? extends V> set)
set
- Java Setint removeAll(java.util.Collection<? extends V> c)
c
- collection that defines which elements will be removed from
this set.java.lang.UnsupportedOperationException
- if the removeAll
method is not supported by this Collection.java.lang.ClassCastException
- if the types of one or more elements in this
set are incompatible with the specified collection
(optional).java.lang.NullPointerException
- if this set contains a null element and
the specified collection does not support null elements
(optional).java.lang.NullPointerException
- if the specified collection is
null.default V pop()