|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractSet groovyx.gpars.extra166y.CustomConcurrentHashMap.KeySet
public static class CustomConcurrentHashMap.KeySet extends java.util.AbstractSet
A hash-based set with properties identical to those of
Collections.newSetFromMap
applied to a
CustomConcurrentHashMap
, but possibly more
space-efficient. The set does not permit null elements. The
set is serializable; however, serializing a set that uses soft
or weak references can give unpredictable results.
Field Summary | |
---|---|
CustomConcurrentHashMap |
cchm
|
Constructor Summary | |
CustomConcurrentHashMap.KeySet(Strength strength, Equivalence equivalence, int expectedSize)
Creates a set with the given parameters |
Method Summary | |
---|---|
boolean
|
add(java.lang.Object e)
Adds the specified element to this set if there is not already an element equivalent to the given element with respect to this set's Equivalence. |
void
|
clear()
Removes all of the elements from this set. |
boolean
|
contains(java.lang.Object o)
Returns true if this set contains an element equivalent to the given element with respect to this set's Equivalence. |
int
|
hashCode()
Returns the sum of the hash codes of each element, as computed by this set's Equivalence. |
java.lang.Object
|
intern(java.lang.Object e)
Returns an element equivalent to the given element with respect to this set's Equivalence, if such an element exists, else adds and returns the given element. |
boolean
|
isEmpty()
Returns true if this set contains no elements. |
java.util.Iterator
|
iterator()
Returns a weakly consistent iterator over the elements in this set, that may reflect some, all or none of the changes made to the set after the iterator was created. |
boolean
|
remove(java.lang.Object o)
Removes an element equivalent to the given element with respect to this set's Equivalence, if one is present. |
int
|
size()
Returns the number of elements in this set (its cardinality). |
Methods inherited from class java.util.AbstractSet | |
---|---|
java.util.AbstractSet#equals(java.lang.Object), java.util.AbstractSet#hashCode(), java.util.AbstractSet#removeAll(java.util.Collection), java.util.AbstractSet#add(java.lang.Object), java.util.AbstractSet#toString(), java.util.AbstractSet#clear(), java.util.AbstractSet#contains(java.lang.Object), java.util.AbstractSet#isEmpty(), java.util.AbstractSet#addAll(java.util.Collection), java.util.AbstractSet#iterator(), java.util.AbstractSet#size(), java.util.AbstractSet#toArray(), java.util.AbstractSet#toArray([Ljava.lang.Object;), java.util.AbstractSet#remove(java.lang.Object), java.util.AbstractSet#containsAll(java.util.Collection), java.util.AbstractSet#retainAll(java.util.Collection), java.util.AbstractSet#wait(long), java.util.AbstractSet#wait(), java.util.AbstractSet#wait(long, int), java.util.AbstractSet#getClass(), java.util.AbstractSet#notify(), java.util.AbstractSet#notifyAll(), java.util.AbstractSet#iterator(), java.util.AbstractSet#size() |
Methods inherited from class java.util.AbstractCollection | |
---|---|
java.util.AbstractCollection#add(java.lang.Object), java.util.AbstractCollection#toString(), java.util.AbstractCollection#clear(), java.util.AbstractCollection#contains(java.lang.Object), java.util.AbstractCollection#isEmpty(), java.util.AbstractCollection#addAll(java.util.Collection), java.util.AbstractCollection#iterator(), java.util.AbstractCollection#size(), java.util.AbstractCollection#toArray(), java.util.AbstractCollection#toArray([Ljava.lang.Object;), java.util.AbstractCollection#remove(java.lang.Object), java.util.AbstractCollection#containsAll(java.util.Collection), java.util.AbstractCollection#removeAll(java.util.Collection), java.util.AbstractCollection#retainAll(java.util.Collection), java.util.AbstractCollection#wait(long), java.util.AbstractCollection#wait(), java.util.AbstractCollection#wait(long, int), java.util.AbstractCollection#equals(java.lang.Object), java.util.AbstractCollection#hashCode(), java.util.AbstractCollection#getClass(), java.util.AbstractCollection#notify(), java.util.AbstractCollection#notifyAll() |
Field Detail |
---|
final CustomConcurrentHashMap cchm
Constructor Detail |
---|
public CustomConcurrentHashMap.KeySet(Strength strength, Equivalence equivalence, int expectedSize)
strength
- the strength of elementsequivalence
- the Equivalence to useexpectedSize
- an estimate of the number of elements
that will be held in the set. If no estimate is known, zero
is an acceptable value.
Method Detail |
---|
public boolean add(java.lang.Object e)
e
- element to be added to this set
public void clear()
public boolean contains(java.lang.Object o)
o
- element whose presence in this set is to be tested
public int hashCode()
public java.lang.Object intern(java.lang.Object e)
e
- the element
public boolean isEmpty()
public java.util.Iterator iterator()
public boolean remove(java.lang.Object o)
o
- object to be removed from this set, if present
public int size()
Copyright © 2008–2012 Václav Pech. All Rights Reserved.