|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.util.GSetByHashMap<K,E>
@InterfaceAudience.Private public class GSetByHashMap<K,E extends K>
A GSet
implementation by HashMap
.
Constructor Summary | |
---|---|
GSetByHashMap(int initialCapacity,
float loadFactor)
|
Method Summary | |
---|---|
boolean |
contains(K k)
Does this set contain an element corresponding to the given key? |
E |
get(K k)
Return the stored element which is equal to the given key. |
Iterator<E> |
iterator()
|
E |
put(E element)
Add/replace an element. |
E |
remove(K k)
Remove the element corresponding to the given key. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GSetByHashMap(int initialCapacity, float loadFactor)
Method Detail |
---|
public int size()
size
in interface GSet<K,E extends K>
public boolean contains(K k)
GSet
contains
in interface GSet<K,E extends K>
k
- The given key.
public E get(K k)
GSet
Map.get(Object)
.
get
in interface GSet<K,E extends K>
k
- The given key.
public E put(E element)
GSet
Map.put(Object, Object)
but is different from Set.add(Object)
which does not replace the existing element if there is any.
put
in interface GSet<K,E extends K>
element
- The element being put.
public E remove(K k)
GSet
Map.remove(Object)
.
remove
in interface GSet<K,E extends K>
k
- The key of the element being removed.
public Iterator<E> iterator()
iterator
in interface Iterable<E extends K>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |