|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractSet | +--harpoon.Util.Collections.LinearSet
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(int capacity)
Creates a LinearSet with given capacity. |
|
LinearSet(ListFactory lf)
Creates an empty LinearSet , using a
List generated by lf as the backing
store. |
|
LinearSet(ListFactory lf,
int capacity)
Creates an empty LinearSet with a given capacity,
using a List generated by lf as the
backing store. |
|
LinearSet(ListFactory lf,
Set 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 set)
Creates a LinearSet , filling it with the elements
of set . |
Method Summary | |
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
Object |
clone()
|
Iterator |
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 set)
LinearSet
, filling it with the elements
of set
. Uses an ArrayList
as the
backing store.
public LinearSet(ListFactory lf)
LinearSet
, using a
List
generated by lf
as the backing
store.
public LinearSet(ListFactory lf, int capacity)
LinearSet
with a given capacity,
using a List
generated by lf
as the
backing store.
public LinearSet(ListFactory lf, Set set)
LinearSet
, using a
List
generated by lf
as the backing
store, and fills it with the elements of set
.
Method Detail |
public Iterator iterator()
iterator
in interface Set
iterator
in class AbstractCollection
public int size()
size
in interface Set
size
in class AbstractCollection
public boolean add(Object o)
add
in interface Set
add
in class AbstractCollection
public boolean addAll(Collection c)
addAll
in interface Set
addAll
in class AbstractCollection
public boolean remove(Object o)
remove
in interface Set
remove
in class AbstractCollection
public Object clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |