Package org.apache.hadoop.util
Class GSetByHashMap<K,E extends K>
java.lang.Object
org.apache.hadoop.util.GSetByHashMap<K,E>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the set.booleanDoes this set contain an element corresponding to the given key?Return the stored element which is equal to the given key.iterator()Add/replace an element.Remove the element corresponding to the given key.intsize()values()Returns aCollectionview of the values contained in this set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GSetByHashMap
public GSetByHashMap(int initialCapacity, float loadFactor)
-
-
Method Details
-
size
public int size() -
contains
Description copied from interface:GSetDoes this set contain an element corresponding to the given key? -
get
Description copied from interface:GSetReturn the stored element which is equal to the given key. This operation is similar toMap.get(Object). -
put
Description copied from interface:GSetAdd/replace an element. If the element does not exist, add it to the set. Otherwise, replace the existing element. Note that this operation is similar toMap.put(Object, Object)but is different fromSet.add(Object)which does not replace the existing element if there is any. -
remove
Description copied from interface:GSetRemove the element corresponding to the given key. This operation is similar toMap.remove(Object). -
iterator
-
clear
public void clear()Description copied from interface:GSetClear the set. -
values
Description copied from interface:GSetReturns aCollectionview of the values contained in this set. The collection is backed by the set, so changes to the set are reflected in the collection, and vice-versa.
-