| org.openrdf.sail.memory.model.WeakObjectRegistry
WeakObjectRegistry | public class WeakObjectRegistry extends AbstractSet (Code) | | An object registry that uses weak references to keep track of the stored
objects. The registry can be used to retrieve stored objects using another,
equivalent object. As such, it can be used to prevent the use of duplicates
in another data structure, reducing memory usage. The objects that are being
stored should properly implement the
Object.equals and
Object.hashCode methods.
|
Method Summary | |
public boolean | add(E object) | public void | clear() | public boolean | contains(Object o) | public E | get(Object key) Retrieves the stored object that is equal to the supplied key
object.
Parameters: key - The object that should be used as the search key for the operation. | public Iterator<E> | iterator() | public boolean | remove(Object o) | public int | size() |
WeakObjectRegistry | public WeakObjectRegistry()(Code) | | Constructs a new, empty object registry.
|
WeakObjectRegistry | public WeakObjectRegistry(Collection<? extends E> c)(Code) | | Constructs a new WeakObjectRegistry containing the elements in the
specified collection.
Parameters: c - The collection whose elements are to be placed into this objectregistry. throws: NullPointerException - If the specified collection is null. |
add | public boolean add(E object)(Code) | | |
clear | public void clear()(Code) | | |
get | public E get(Object key)(Code) | | Retrieves the stored object that is equal to the supplied key
object.
Parameters: key - The object that should be used as the search key for the operation. A stored object that is equal to the supplied key, ornull if no such object was found. |
|
|