public interface CacheSet<E extends Serializable> extends GroupCacheable
限定符和类型 | 方法和说明 |
---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already present
(optional operation).
|
boolean |
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this set if
they're not already present (optional operation).
|
boolean |
contains(E o)
Returns true if this set contains the specified element.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
void |
notifyUpdate(E e)
通知缓存项改变,需要更新。
|
boolean |
remove(E o)
Removes the specified element from this set if it is present (optional
operation).
|
boolean |
removeAll(Collection<? extends E> c)
Removes from this set all of its elements that are contained in the
specified collection (optional operation).
|
void |
replaceAll(Collection<? extends E> set)
清除缓存并将Map中的所有项目设置到缓存中。
|
Set<E> |
toSet()
将缓存转化为Set表示。
|
clear, getGroup, getName, getStatistics, isEmpty, size
boolean contains(E o)
e
such that (o==null ? e==null :
o.equals(e))
.o
- element whose presence in this set is to be tested.ClassCastException
- if the type of the specified element is incompatible with
this set (optional).NullPointerException
- if the specified element is null and this set does not
support null elements (optional).Iterator<E> iterator()
boolean add(E 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.UnsupportedOperationException
- if the add method is not supported by this set.ClassCastException
- if the class of the specified element prevents it from being
added to this set.NullPointerException
- if the specified element is null and this set does not
support null elements.IllegalArgumentException
- if some aspect of the specified element prevents it from
being added to this set.boolean remove(E 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.ClassCastException
- if the type of the specified element is incompatible with
this set (optional).NullPointerException
- if the specified element is null and this set does not
support null elements (optional).UnsupportedOperationException
- if the remove method is not supported by this set.boolean addAll(Collection<? extends E> c)
c
- collection whose elements are to be added to this set.UnsupportedOperationException
- if the addAll method is
not supported by this set.ClassCastException
- if the class of some element of the
specified collection prevents it from being added to this
set.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.IllegalArgumentException
- if some aspect of some element of the
specified collection prevents it from being added to this
set.#add(Object)
void replaceAll(Collection<? extends E> set)
set
- Java Setboolean removeAll(Collection<? extends E> c)
c
- collection that defines which elements will be removed from
this set.UnsupportedOperationException
- if the removeAll
method is not supported by this Collection.ClassCastException
- if the types of one or more elements in this
set are incompatible with the specified collection
(optional).NullPointerException
- if this set contains a null element and
the specified collection does not support null elements
(optional).NullPointerException
- if the specified collection is
null.#remove(Object)
void notifyUpdate(E e)
e
- 缓存的对象Copyright © 2016–2018. All rights reserved.