ecologylab.collections
Class ArrayListFloatSet<T extends FloatSetElement>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by ecologylab.collections.ArrayListFloatSet<T>
All Implemented Interfaces:
BasicFloatSet<T>, LinearAccess<T>, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess

public class ArrayListFloatSet<T extends FloatSetElement>
extends java.util.ArrayList<T>
implements BasicFloatSet<T>

A set of FloatSetElements, that uses ArrayList as the storage medium.

Author:
andruid
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface ecologylab.collections.BasicFloatSet
NO_RECOMPUTE, PARTIAL_RECOMPUTE, RECOMPUTE_ALL
 
Constructor Summary
ArrayListFloatSet()
           
ArrayListFloatSet(java.util.Collection arg0)
           
ArrayListFloatSet(int arg0)
           
 
Method Summary
 void decrement(T el)
           
 void delete(T el, int recompute)
          Delete an element from the set.
 T getElement(int i)
          Get the ith element in the set.
 void insert(T element)
           
 T lastElement()
          Get the last element in the set, or null if the set is empty.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ecologylab.collections.BasicFloatSet
get, isEmpty
 
Methods inherited from interface ecologylab.collections.LinearAccess
size
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ArrayListFloatSet

public ArrayListFloatSet()

ArrayListFloatSet

public ArrayListFloatSet(int arg0)
Parameters:
arg0 -

ArrayListFloatSet

public ArrayListFloatSet(java.util.Collection arg0)
Parameters:
arg0 -
Method Detail

delete

public void delete(T el,
                   int recompute)
Delete an element from the set. If they are relevant, perhaps recompute internal structures, such as incremental sums, or tree/heap balancing, depending on the value of the recompute parameter.

Specified by:
delete in interface BasicFloatSet<T extends FloatSetElement>
Parameters:
el - The FloatSetElement element to delete.
recompute - -1 for absolutely no recompute. 0 for recompute upwards from el. 1 for recompute all.

insert

public void insert(T element)

getElement

public T getElement(int i)
Get the ith element in the set.

Parameters:
i -
Returns:

lastElement

public T lastElement()
Get the last element in the set, or null if the set is empty.

Specified by:
lastElement in interface BasicFloatSet<T extends FloatSetElement>
Returns:

decrement

public void decrement(T el)
Specified by:
decrement in interface BasicFloatSet<T extends FloatSetElement>