|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- The type of the keys.E
- The type of the elements, which must be a subclass of the keys.@InterfaceAudience.Private public interface GSet<K,E extends K>
A 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.
Method Summary | |
---|---|
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()
|
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |