net.cscott.jutil
public class LinearSet<E> extends AbstractSet<E> implements Cloneable, Serializable
LinearSet
is a simplistic light-weight
Set
designed for use when the number of entries is
small. It is backed by a List
.
Version: $Id: LinearSet.java,v 1.3 2004/01/13 20:47:05 cananian Exp $
Constructor Summary | |
---|---|
LinearSet() Creates a LinearSet . | |
LinearSet(int capacity) Creates a LinearSet with given capacity.
| |
LinearSet(Set<? extends E> set) Creates a LinearSet , filling it with the elements
of set . | |
LinearSet(Collection<? extends E> c) Creates a LinearSet , filling it with the elements
of the given collection. | |
LinearSet(ListFactory<E> lf) Creates an empty LinearSet , using a
List generated by lf as the backing
store. | |
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, 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 . |
Method Summary | |
---|---|
boolean | add(E o) |
boolean | addAll(Collection<? extends E> c) |
Object | clone() |
Iterator<E> | iterator() |
boolean | remove(Object o) |
int | size() |
LinearSet
. Uses an
ArrayList
as the backing store.LinearSet
with given capacity.
Uses an ArrayList
as the backing store.LinearSet
, filling it with the elements
of set
. Uses an ArrayList
as the
backing store.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.LinearSet
, using a
List
generated by lf
as the backing
store.LinearSet
with a given capacity,
using a List
generated by lf
as the
backing store.LinearSet
, using a
List
generated by lf
as the backing
store, and fills it with the elements of set
.