Provides an implementation of the DoubleArray with a maximum number of elements. Creating an array implementation with an upper limit on the number of elements allows us to support a more efficient "rolling" mechanism to support addElementRoling(double). Please note that this implementation will not preserve the order of the values supplied to this array, calling getValues() will return an array of indeterminate order.
Values are added to this array by calling addElement(double) or addElementRolling(double). If addElement(double) is called on an array that already contains the maximum number of elements, an ArrayIndexOutOfBoundsException will be thrown to reflect an attempt to add a value beyond the boundaries of the fixed length array - in this respect a FixedDoubleArray can be considered "full". Calling addElementRolling(double) on an array which contains the maximum number of elements will cause the array to overwrite the "oldest" value in the array.
This class is called FixedDoubleArray not because it is of a fixed size. The name is appropriate because the internal storage array remains "fixed" in memory, this implementation will never allocate, or copy the internal storage array to a new array instance.
@version $Revision: 1.12 $ $Date: 2003/11/19 03:28:24 $
|
|
|
|