com.sleepycat.je.utilint
Class TinyHashSet<T>
java.lang.Object
com.sleepycat.je.utilint.TinyHashSet<T>
public class TinyHashSet<T>
- extends Object
TinyHashSet is used to optimize (for speed, not space) the case where a
HashSet generally holds a single element. This saves us the cost of
creating the HashSet and related elements as well as call Object.hashCode().
If single != null, it's the only element in the TinyHashSet. If set != null
then there are multiple elements in the TinyHashSet. It should never be
true that (single != null) && (set != null).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TinyHashSet
public TinyHashSet()
- Creates an empty set.
TinyHashSet
public TinyHashSet(T o)
- Creates a set with one element.
size
public int size()
contains
public boolean contains(T o)
remove
public boolean remove(T o)
add
public boolean add(T o)
copy
public Set<T> copy()
iterator
public Iterator<T> iterator()
Copyright (c) 2004-2010 Oracle. All rights reserved.