ecologylab.collections
Interface BasicFloatSet<E extends FloatSetElement>

All Superinterfaces:
LinearAccess<E>
All Known Implementing Classes:
ArrayListFloatSet, FloatWeightSet

public interface BasicFloatSet<E extends FloatSetElement>
extends LinearAccess<E>

Minimal set of functions needed for collections of FloatSetElements.

Author:
andruid

Field Summary
static int NO_RECOMPUTE
          A flag that may be passed to the delete method.
static int PARTIAL_RECOMPUTE
          A flag that may be passed to the delete method.
static int RECOMPUTE_ALL
          A flag that may be passed to the delete method.
 
Method Summary
 void decrement(E el)
           
 void delete(E el, int recompute)
          Delete an element from the set.
 E get(int i)
          Get the ith element in the set.
 boolean isEmpty()
          Check to see if the set has any elements.
 E lastElement()
          Get the last element in the set, or null if the set is empty.
 
Methods inherited from interface ecologylab.collections.LinearAccess
size
 

Field Detail

NO_RECOMPUTE

static final int NO_RECOMPUTE
A flag that may be passed to the delete method. Indicates minimize recomputation. Be as expedient as possible.

See Also:
Constant Field Values

PARTIAL_RECOMPUTE

static final int PARTIAL_RECOMPUTE
A flag that may be passed to the delete method. Indicates do recompute partially, from this element only, to maintain the structural integrity of the set.

See Also:
Constant Field Values

RECOMPUTE_ALL

static final int RECOMPUTE_ALL
A flag that may be passed to the delete method. Indicates do whatever is necessary to maintain the structural integrity of the set.

See Also:
Constant Field Values
Method Detail

delete

void delete(E 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.

Parameters:
el - The FloatSetElement element to delete.
recompute - -1 for absolutely no recompute. 0 for recompute upwards from el. 1 for recompute all.

get

E get(int i)
Get the ith element in the set.

Specified by:
get in interface LinearAccess<E extends FloatSetElement>
Parameters:
i -
Returns:

lastElement

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

Returns:

isEmpty

boolean isEmpty()
Check to see if the set has any elements.

Specified by:
isEmpty in interface LinearAccess<E extends FloatSetElement>
Returns:

decrement

void decrement(E el)