|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<K> groovyx.gpars.extra166y.CustomConcurrentHashMap.KeySet<K>
public static class CustomConcurrentHashMap.KeySet<K>
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 | |
---|---|
(package private) CustomConcurrentHashMap<K,K> |
cchm
|
Constructor Summary | |
---|---|
CustomConcurrentHashMap.KeySet(CustomConcurrentHashMap.Strength strength,
CustomConcurrentHashMap.Equivalence<? super K> equivalence,
int expectedSize)
Creates a set with the given parameters |
Method Summary | |
---|---|
boolean |
add(K 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. |
K |
intern(K 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<K> |
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 |
---|
equals, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, 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 |
---|
addAll, containsAll, equals, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
final CustomConcurrentHashMap<K,K> cchm
Constructor Detail |
---|
public CustomConcurrentHashMap.KeySet(CustomConcurrentHashMap.Strength strength, CustomConcurrentHashMap.Equivalence<? super K> 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 K intern(K e)
e
- the element
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<K>
contains
in interface java.util.Set<K>
contains
in class java.util.AbstractCollection<K>
o
- element whose presence in this set is to be tested
public java.util.Iterator<K> iterator()
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in interface java.util.Set<K>
iterator
in class java.util.AbstractCollection<K>
public boolean add(K e)
add
in interface java.util.Collection<K>
add
in interface java.util.Set<K>
add
in class java.util.AbstractCollection<K>
e
- element to be added to this set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<K>
remove
in interface java.util.Set<K>
remove
in class java.util.AbstractCollection<K>
o
- object to be removed from this set, if present
public boolean isEmpty()
isEmpty
in interface java.util.Collection<K>
isEmpty
in interface java.util.Set<K>
isEmpty
in class java.util.AbstractCollection<K>
public int size()
size
in interface java.util.Collection<K>
size
in interface java.util.Set<K>
size
in class java.util.AbstractCollection<K>
public void clear()
clear
in interface java.util.Collection<K>
clear
in interface java.util.Set<K>
clear
in class java.util.AbstractCollection<K>
public int hashCode()
hashCode
in interface java.util.Collection<K>
hashCode
in interface java.util.Set<K>
hashCode
in class java.util.AbstractSet<K>
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |