java.util.Set , but for its size method
| Modifier and Type | Class and Description |
|---|---|
| private class | CacheKeySet.KeySetIterator
An iterator that will iterate over all keySets, avoiding duplicate entries |
| Modifier and Type | Field and Description |
|---|---|
| private static final Iterator | |
| private final Collection |
| Access | Constructor and Description |
|---|---|
| public | CacheKeySet(final Collection<E>...
an array of keySets keySets)Create a new Set for all tiers in the cache. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(final Object
element to be added to this set o)Implements java. |
| public boolean | addAll(final Collection<E>
collection containing elements to be added to this set c)Implements java. |
| public void | |
| public boolean | contains(final Object
element whose presence in this set is to be tested o)Implements java. true if this set contains the specified element.
|
| public boolean | containsAll(final Collection<?>
collection to be checked for containment in this set c)Implements java. true if this set contains all of the elements of the
specified collection.
|
| public boolean | |
| public Iterator | |
| public boolean | remove(final Object
object to be removed from this set, if present o)Implements java. |
| public boolean | removeAll(final Collection<?>
collection containing elements to be removed from this set c)Implements java. |
| public boolean | retainAll(final Collection<?>
collection containing elements to be retained in this set c)Implements java. |
| public int | Returns: the sum of all keySet sizesImplements java. |
| public Object[] | toArray()
Implements java. |
| public <T> T[] | toArray(final T[]
the array into which the elements of this set are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. a)Implements java. |
| EMPTY_ITERATOR | back to summary |
|---|---|
| private static final Iterator<E> EMPTY_ITERATOR | |
| keySets | back to summary |
|---|---|
| private final Collection<E>[] keySets | |
| CacheKeySet | back to summary |
|---|---|
| public CacheKeySet(final Collection<E>... keySets) Create a new Set for all tiers in the cache. Generally, you'd pass the authority's keySet, and higher layer pinned keySets
| |
| add | back to summary |
|---|---|
| public boolean add(final Object o) Implements java. You can't add to this set, will throw!
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<E> c) Implements java. You can't add to this set, will throw!
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. You can't remove from this set, will throw!
| |
| contains | back to summary |
|---|---|
| public boolean contains(final Object o) Implements java. Doc from java. Returns
| |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(final Collection<?> c) Implements java. Doc from java. Returns
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object o) Implements java. You can't remove from this set, will throw!
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> c) Implements java. You can't remove from this set, will throw!
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> c) Implements java. You can't remove from this set, will throw!
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Sums the size of all sets wrapped by this one, so this will not account for duplicated keys. Like for in-memory pinned keys, that might also present in lower tiers: e.g. DiskStore when its capacity isn't reached.
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array will be "safe" in that no references to it are maintained by this set. (In other words, this method must allocate a new array even if this set is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs.
| |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(final T[] a) Implements java. Doc from java. Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. If the set fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this set. If this set fits in the specified array with room to spare
(i.e., the array has more elements than this set), the element in
the array immediately following the end of the set is set to
If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. Like the Suppose
String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to
toArray().
| |
| Modifier and Type | Field and Description |
|---|---|
| private E | |
| private Iterator | |
| private int | |
| private E |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | |
| public E | |
| public void | remove()
Overrides default java. |
| current | back to summary |
|---|---|
| private E current | |
| currentIterator | back to summary |
|---|---|
| private Iterator<E> currentIterator | |
| index | back to summary |
|---|---|
| private int index | |
| next | back to summary |
|---|---|
| private E next | |
| KeySetIterator | back to summary |
|---|---|
| private KeySetIterator() | |
| advance | back to summary |
|---|---|
| private void advance() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |