|
JUtil | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.cscott.jutil.LinearSet<E>
public class LinearSet<E>
LinearSet is a simplistic light-weight
Set designed for use when the number of entries is
small. It is backed by a List.
| Constructor Summary | |
|---|---|
LinearSet()
Creates a LinearSet. |
|
LinearSet(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)
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. |
|
LinearSet(Set<? extends E> set)
Creates a LinearSet, filling it with the elements
of set. |
|
| Method Summary | |
|---|---|
boolean |
add(E o)
|
boolean |
addAll(Collection<? extends E> c)
|
LinearSet<E> |
clone()
|
Iterator<E> |
iterator()
|
boolean |
remove(Object o)
|
int |
size()
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public 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(Set<? extends E> set)
LinearSet, filling it with the elements
of set. Uses an ArrayList as the
backing store.
public LinearSet(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)
LinearSet, using a
List generated by lf as the backing
store.
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,
Set<? extends E> set)
LinearSet, using a
List generated by lf as the backing
store, and fills it with the elements of set.
| Method Detail |
|---|
public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>iterator in class AbstractCollection<E>public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface Set<E>addAll in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public LinearSet<E> clone()
clone in class Object
|
JUtil | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||