|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.aerith.misao.util.SortableArray
|
+--net.aerith.misao.util.Array
The Array represents an array of data values with a
funciton to sort.
| Field Summary | |
protected double[] |
array
The buffer of data array. |
protected int |
size
The size of buffer. |
| Fields inherited from class net.aerith.misao.util.SortableArray |
COMPARE_EQUAL,
COMPARE_LARGER,
COMPARE_SMALLER,
SORT_ASCENDANT,
SORT_DESCENDANT,
sort_index |
| Constructor Summary | |
Array(int buffer_size)
Constructs an Array with a specified size of
buffer. |
|
| Method Summary | |
Array |
cloneArray()
Creates a clone array. |
Array |
cloneArray(int new_size)
Creates a clone array. |
protected int |
compare(int index1,
int index2)
Compares the two data represented by the specified index and returns which is smaller. |
int |
getArraySize()
Gets the size of this array. |
int |
getDataCount()
Gets the number of data. |
int |
getPeakIndex()
Gets the location of the largest value. |
double |
getValueAt(int index)
Gets the value of data at the specified location. |
int |
meanIndexOf(double value)
Gets the mean location where the value is expected to go across the specified value. |
void |
set(int index,
double value)
Sets the value of data at the specified location. |
void |
setMovingAverage(int window_size)
Calculates the moving average and sets the result into this array. |
protected void |
sort()
Sorts this array itself based on the sorted index. |
| Methods inherited from class net.aerith.misao.util.SortableArray |
quick_sort,
sortAscendant,
sortDescendant |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected double[] array
protected int size
| Constructor Detail |
public Array(int buffer_size)
Array with a specified size of
buffer. The buffer is set as 0.buffer_size - the size of buffer to create.| Method Detail |
public int getArraySize()
public int getDataCount()
public double getValueAt(int index)
throws java.lang.IndexOutOfBoundsException
index - the location of the data.
public void set(int index,
double value)
throws java.lang.IndexOutOfBoundsException
index - the location to store the data.value - the value of data.public int getPeakIndex()
public int meanIndexOf(double value)
value - the value.public void setMovingAverage(int window_size)
window_size - the number of data to caluclate the moving
average.
protected int compare(int index1,
int index2)
index1 - the index to represent the first data to compare.index2 - the index to represent the second data to compare.protected void sort()
public Array cloneArray()
public Array cloneArray(int new_size)
new_size - the size of new array.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||