public class LinearSet<E>
extends java.util.AbstractSet<E>
implements java.lang.Cloneable, java.io.Serializable
LinearSet is a simplistic light-weight
Set designed for use when the number of entries is
small. It is backed by a List.| Constructor and Description |
|---|
LinearSet()
Creates a
LinearSet. |
LinearSet(java.util.Collection<? extends E> c)
Creates a
LinearSet, filling it with the elements
of the given collection. |
LinearSet(int capacity)
Creates a
LinearSet with given capacity. |
LinearSet(ListFactory<E> lf)
|
LinearSet(ListFactory<E> lf,
int capacity)
Creates an empty
LinearSet with a given capacity,
using a List generated by lf as the
backing store. |
LinearSet(ListFactory<E> lf,
java.util.Set<? extends E> set)
Creates an empty
LinearSet, using a
List generated by lf as the backing
store, and fills it with the elements of set. |
LinearSet(java.util.Set<? extends E> set)
Creates a
LinearSet, filling it with the elements
of set. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
boolean |
addAll(java.util.Collection<? extends E> c) |
LinearSet<E> |
clone() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object o) |
int |
size() |
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitpublic LinearSet()
LinearSet. Uses an
ArrayList as the backing store.public LinearSet(int capacity)
LinearSet with given capacity.
Uses an ArrayList as the backing store.public LinearSet(java.util.Set<? extends E> set)
public LinearSet(java.util.Collection<? extends E> c)
LinearSet, filling it with the elements
of the given collection. Uses an ArrayList as the
backing store. Uses time quadratic in the size of the given
collection.public LinearSet(ListFactory<E> lf)
public LinearSet(ListFactory<E> lf, int capacity)
LinearSet with a given capacity,
using a List generated by lf as the
backing store.public LinearSet(ListFactory<E> lf, java.util.Set<? extends E> set)
LinearSet, using a
List generated by lf as the backing
store, and fills it with the elements of set.Copyright (c) 2006 C. Scott Ananian