|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uchicago.src.sim.util.ConservationCollection
A Vector like collection class that maintains a specified size by either randomly removing elements of the collection or removing elements through the Remover class. On any add operation the new objects are added and if the size of the collection is over the limit, the appropriate number of objects are then removed. Note that on a random remove objects that have just been added may be removed.
| Constructor Summary | |
ConservationCollection(int sizeLimit)
Creates a ConservationCollection with the specified size limit. |
|
| Method Summary | |
void |
add(int index,
Object element)
|
boolean |
add(Object o)
Adds the specified object to the collection. |
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
boolean |
equals(Object o)
|
Object |
get(int index)
|
int |
hashCode()
|
int |
indexOf(Object o)
|
boolean |
isEmpty()
|
Iterator |
iterator()
|
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
Object |
set(int index,
Object element)
|
int |
size()
|
List |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConservationCollection(int sizeLimit)
sizeLimit - the size limit of this ConservationCollection.| Method Detail |
public boolean add(Object o)
o - the object to add
public void add(int index,
Object element)
public boolean addAll(Collection c)
public boolean addAll(int index,
Collection c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection c)
public boolean equals(Object o)
equals in class Objectpublic Object get(int index)
public int hashCode()
hashCode in class Objectpublic int indexOf(Object o)
public boolean isEmpty()
public Iterator iterator()
public int lastIndexOf(Object o)
public ListIterator listIterator()
public ListIterator listIterator(int index)
public Object remove(int index)
public boolean remove(Object o)
public boolean removeAll(Collection c)
public boolean retainAll(Collection c)
public Object set(int index,
Object element)
public int size()
public List subList(int fromIndex,
int toIndex)
public Object[] toArray()
public Object[] toArray(Object[] a)
|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||