public class IdentitySet<T>
extends java.util.AbstractSet<T>
(obj1 == obj2)
. Use only when caching objects in a model where identity equality is specifically required, rather than .equals equality or any of the comparisons available for DBObject and DBObjectID through the other Collection and Map implementation in this package.
For a Map implementation using the same model, simply use IdentityHashMap
which actually backs this implementation.
This Set is not synchronized for a thread safe Set use Collections.synchronizedSet
.
IdentityHashMap
Constructor and Description |
---|
IdentitySet() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
java.util.Iterator<T> |
iterator() |
boolean |
remove(java.lang.Object o) |
int |
size() |
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString