K - The type of the keys.E - The type of the elements, which must be a subclass of the keys.public interface GSet<K,E extends K> extends Iterable<E>
GSet is set,
which supports the get(Object) operation.
The get(Object) operation uses a key to lookup an element.
Null element is not supported.| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
boolean |
contains(K key)
Does this set contain an element corresponding to the given key?
|
E |
get(K key)
Return the stored element which is equal to the given key.
|
E |
put(E element)
Add/replace an element.
|
E |
remove(K key)
Remove the element corresponding to the given key.
|
int |
size() |
int size()
boolean contains(K key)
key - The given key.NullPointerException - if key == null.E get(K key)
Map.get(Object).key - The given key.NullPointerException - if key == null.E put(E element)
Map.put(Object, Object)
but is different from Set.add(Object)
which does not replace the existing element if there is any.element - The element being put.NullPointerException - if element == null.E remove(K key)
Map.remove(Object).key - The key of the element being removed.NullPointerException - if key == null.void clear()
Copyright © 2009 The Apache Software Foundation