public class FloatValueList extends CircularValueList implements java.util.List<java.lang.Float>
CircularValueList.Statistics
Modifier and Type | Field and Description |
---|---|
float |
maxValue |
float |
minValue |
float |
rangeMinMax
the distance between the min and max value
|
double |
sum
sum of all values in this list.
|
float[] |
values
The raw values
|
EOR, head, maintainMinMax, maintainSum, maxIdx, minIdx, num, sizeMax, tail
Constructor and Description |
---|
FloatValueList(int cacheSize)
Constructs a new FloatValueList with the given preallocated entries.
|
FloatValueList(int cacheSize,
boolean maintainMinMax)
Constructs a new FloatValueList with the given preallocated entries.
|
FloatValueList(int cacheSize,
boolean maintainMinMax,
boolean maintainSum)
Constructs a new FloatValueList with the given preallocated entries.
|
Modifier and Type | Method and Description |
---|---|
int |
add(float newValue)
Adds a new entry to the ring, possibly overwriting the eldest entry.
|
boolean |
add(java.lang.Float object) |
void |
add(int location,
java.lang.Float object) |
int |
add(long newValue) |
boolean |
addAll(java.util.Collection<? extends java.lang.Float> arg0) |
boolean |
addAll(int arg0,
java.util.Collection<? extends java.lang.Float> arg1) |
void |
calculateStats(int start,
int end,
CircularValueList.Statistics stats)
Calculate statistical values in the given range, including start and end.
|
void |
clear() |
boolean |
contains(java.lang.Object object) |
boolean |
containsAll(java.util.Collection<?> arg0) |
void |
copy(java.util.ArrayList<? extends java.lang.Number> sourceList)
Copies the contents of sourceList into this ring buffer.
|
void |
copy(FloatValueList sourceList)
Copies the contents of sourceList into this ring buffer.
|
void |
findMax()
Iterates over all valid elements and fills the max value.
|
void |
findMin()
Iterates over all valid elements and fills the min value.
|
void |
findMinMax()
Iterates over all valid elements and fills the min & max value.
|
java.lang.Float |
get(int location) |
float |
getHeadValue()
Returns the value at the current head position.
|
float |
getIndirect(int rIdx)
Returns the value at position rIdx.
|
float |
getMean()
Returns the mean of all values in this list.
|
float |
getPastValue(int idxPast)
Returns the value that lies idxPast entries before the current head.
|
int |
indexOf(java.lang.Object object) |
java.util.Iterator<java.lang.Float> |
iterator() |
int |
lastIndexOf(java.lang.Object object) |
java.util.ListIterator<java.lang.Float> |
listIterator() |
java.util.ListIterator<java.lang.Float> |
listIterator(int location) |
java.lang.Float |
remove(int location) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> arg0) |
boolean |
retainAll(java.util.Collection<?> arg0) |
java.lang.Float |
set(int location,
java.lang.Float object) |
java.util.List<java.lang.Float> |
subList(int start,
int end) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
java.lang.String |
toString(java.lang.String elementFormatter) |
isEmpty, normIdx, size, tailDistance
public float[] values
public float minValue
public float maxValue
public float rangeMinMax
public double sum
public FloatValueList(int cacheSize, boolean maintainMinMax, boolean maintainSum)
cacheSize
- Number of preallocated entries.maintainMinMax
- Whether to maintain the min and max values.public FloatValueList(int cacheSize, boolean maintainMinMax)
cacheSize
- Number of preallocated entries.maintainMinMax
- Whether to maintain the min and max values.public FloatValueList(int cacheSize)
cacheSize
- Number of preallocated entries.public int add(float newValue)
add
in class CircularValueList
newValue
- The value to add to the list.public void clear()
clear
in interface java.util.Collection<java.lang.Float>
clear
in interface java.util.List<java.lang.Float>
clear
in class CircularValueList
public void copy(java.util.ArrayList<? extends java.lang.Number> sourceList)
sourceList
- public void copy(FloatValueList sourceList)
sourceList
- public void findMax()
findMax
in class CircularValueList
public void findMin()
findMin
in class CircularValueList
public void findMinMax()
findMinMax
in class CircularValueList
public float getMean()
public float getHeadValue()
public float getPastValue(int idxPast)
idxPast
- Positive number indicating how many values to go into the
past.public float getIndirect(int rIdx)
rIdx
- negative or positive index in the ringpublic boolean add(java.lang.Float object)
add
in interface java.util.Collection<java.lang.Float>
add
in interface java.util.List<java.lang.Float>
public void add(int location, java.lang.Float object)
add
in interface java.util.List<java.lang.Float>
public boolean addAll(java.util.Collection<? extends java.lang.Float> arg0)
addAll
in interface java.util.Collection<java.lang.Float>
addAll
in interface java.util.List<java.lang.Float>
public boolean addAll(int arg0, java.util.Collection<? extends java.lang.Float> arg1)
addAll
in interface java.util.List<java.lang.Float>
public boolean contains(java.lang.Object object)
contains
in interface java.util.Collection<java.lang.Float>
contains
in interface java.util.List<java.lang.Float>
public boolean containsAll(java.util.Collection<?> arg0)
containsAll
in interface java.util.Collection<java.lang.Float>
containsAll
in interface java.util.List<java.lang.Float>
public java.lang.Float get(int location)
get
in interface java.util.List<java.lang.Float>
public int indexOf(java.lang.Object object)
indexOf
in interface java.util.List<java.lang.Float>
public java.util.Iterator<java.lang.Float> iterator()
iterator
in interface java.lang.Iterable<java.lang.Float>
iterator
in interface java.util.Collection<java.lang.Float>
iterator
in interface java.util.List<java.lang.Float>
public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface java.util.List<java.lang.Float>
public java.util.ListIterator<java.lang.Float> listIterator()
listIterator
in interface java.util.List<java.lang.Float>
public java.util.ListIterator<java.lang.Float> listIterator(int location)
listIterator
in interface java.util.List<java.lang.Float>
public java.lang.Float remove(int location)
remove
in interface java.util.List<java.lang.Float>
public boolean remove(java.lang.Object object)
remove
in interface java.util.Collection<java.lang.Float>
remove
in interface java.util.List<java.lang.Float>
public boolean removeAll(java.util.Collection<?> arg0)
removeAll
in interface java.util.Collection<java.lang.Float>
removeAll
in interface java.util.List<java.lang.Float>
public boolean retainAll(java.util.Collection<?> arg0)
retainAll
in interface java.util.Collection<java.lang.Float>
retainAll
in interface java.util.List<java.lang.Float>
public java.lang.Float set(int location, java.lang.Float object)
set
in interface java.util.List<java.lang.Float>
public java.util.List<java.lang.Float> subList(int start, int end)
subList
in interface java.util.List<java.lang.Float>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Float>
toArray
in interface java.util.List<java.lang.Float>
public <T> T[] toArray(T[] array)
toArray
in interface java.util.Collection<java.lang.Float>
toArray
in interface java.util.List<java.lang.Float>
public int add(long newValue)
add
in class CircularValueList
public java.lang.String toString(java.lang.String elementFormatter)
public void calculateStats(int start, int end, CircularValueList.Statistics stats)
start
- end
- stats
- receives the computed statistics. must not be null.