org.eclipse.core.internal.utils
Class KeyedHashSet
java.lang.Object
org.eclipse.core.internal.utils.KeyedHashSet
public class KeyedHashSet
- extends java.lang.Object
Adapted from a homonym class in org.eclipse.osgi. A hash table of
KeyedElement
s.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
KeyedHashSet
public KeyedHashSet(int capacity)
KeyedHashSet
public KeyedHashSet(int capacity,
boolean replace)
add
public boolean add(KeyedHashSet.KeyedElement element)
- Adds an element to this set. If an element with the same key already exists,
replaces it depending on the replace flag.
- Returns:
- true if the element was added/stored, false otherwise
clear
public void clear()
getByKey
public KeyedHashSet.KeyedElement getByKey(java.lang.Object key)
- Returns the set element with the given id, or null
if not found.
remove
public boolean remove(KeyedHashSet.KeyedElement toRemove)
size
public int size()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object