|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpapaya.Unique
public class Unique
Class for getting and storing an unsorted array's unique elements, the indices of these elements, and the number of times the elements occur.
This class is overkill if:
you want to store only the unique elements. Use a Java
Set instead.
you don't want to store everything in a class. Use the
Descriptive.frequencies(float[], java.util.ArrayList
method instead.
Field Summary | |
---|---|
ArrayList<Integer> |
frequencies
ArrayList containing the frequencies of the corresponding unique value |
int[][] |
idx
Class containing the integer arrays that hold the indices of each unique value. |
ArrayList<Float> |
values
ArrayList containing the unique values |
Constructor Summary | |
---|---|
Unique(float[] data,
boolean storeIndices)
Class for storing the unique values in an unsorted data array. |
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ArrayList<Float> values
public ArrayList<Integer> frequencies
public int[][] idx
Constructor Detail |
---|
public Unique(float[] data, boolean storeIndices)
true
.
Example:
data = (8,5,6,7,8,5,5) --> values = (5,6,7,8), frequencies = (3,1,1,2),
idx[0] = {1,5,6}, idx[1] = {2}, idx[2] = {3}, idx[3] = {0,4}
data
- the data arraystoreIndices
- set to true
if you want to store the indices,
else set to false
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |