K - The type of the keys.E - The type of the elements, which must be a subclass of the keys.java.lang.Iterable<E>GSetByHashMap, LightWeightCache, LightWeightGSet, LightWeightResizableGSet@Private
public interface GSet<K,E extends K>
extends java.lang.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.| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method | Description |
|---|---|---|
void |
clear() |
Clear the set.
|
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() |
|
java.util.Collection<E> |
values() |
Returns a
Collection view of the values contained in this set. |
int size()
boolean contains(K key)
key - The given key.java.lang.NullPointerException - if key == null.E get(K key)
Map.get(Object).key - The given key.java.lang.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.java.lang.NullPointerException - if element == null.E remove(K key)
Map.remove(Object).key - The key of the element being removed.java.lang.NullPointerException - if key == null.void clear()
java.util.Collection<E> values()
Collection view 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.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.