|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.util.DataLib
public class DataLib
Functions for processing an iterator of tuples, including the creation of arrays of particular tuple data values and summary statistics (min, max, median, mean, standard deviation).
Constructor Summary | |
---|---|
DataLib()
|
Method Summary | |
---|---|
static int |
count(java.util.Iterator tuples,
java.lang.String field)
Get the number of values in a data column. |
static double |
deviation(java.util.Iterator tuples,
java.lang.String field)
Get the standard deviation of a tuple data value. |
static double |
deviation(java.util.Iterator tuples,
java.lang.String field,
double mean)
Get the standard deviation of a tuple data value. |
static java.lang.Class |
inferType(TupleSet tuples,
java.lang.String field)
Infer the data field type across all tuples in a TupleSet. |
static Tuple |
max(java.util.Iterator tuples,
java.lang.String field)
Get the Tuple with the maximum data field value. |
static Tuple |
max(java.util.Iterator tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the maximum data field value. |
static Tuple |
max(TupleSet tuples,
java.lang.String field)
Get the Tuple with the maximum data field value. |
static Tuple |
max(TupleSet tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the maximum data field value. |
static double |
mean(java.util.Iterator tuples,
java.lang.String field)
Get the mean value of a tuple data value. |
static Tuple |
median(java.util.Iterator tuples,
java.lang.String field)
Get the Tuple with the median data field value. |
static Tuple |
median(java.util.Iterator tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the median data field value. |
static Tuple |
median(TupleSet tuples,
java.lang.String field)
Get the Tuple with the median data field value. |
static Tuple |
median(TupleSet tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the median data field value. |
static Tuple |
min(java.util.Iterator tuples,
java.lang.String field)
Get the Tuple with the minimum data field value. |
static Tuple |
min(java.util.Iterator tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the minimum data field value. |
static Tuple |
min(TupleSet tuples,
java.lang.String field)
Get the Tuple with the minimum data field value. |
static Tuple |
min(TupleSet tuples,
java.lang.String field,
java.util.Comparator cmp)
Get the Tuple with the minimum data field value. |
static java.lang.Object[] |
ordinalArray(java.util.Iterator tuples,
java.lang.String field)
Get a sorted array containing all column values for a given tuple iterator and field. |
static java.lang.Object[] |
ordinalArray(java.util.Iterator tuples,
java.lang.String field,
java.util.Comparator cmp)
Get a sorted array containing all column values for a given table and field. |
static java.lang.Object[] |
ordinalArray(TupleSet tuples,
java.lang.String field)
Get a sorted array containing all column values for a given tuple iterator and field. |
static java.lang.Object[] |
ordinalArray(TupleSet tuples,
java.lang.String field,
java.util.Comparator cmp)
Get a sorted array containing all column values for a given table and field. |
static java.util.Map |
ordinalMap(java.util.Iterator tuples,
java.lang.String field)
Get map mapping from column values (as Object instances) to their ordinal index in a sorted array. |
static java.util.Map |
ordinalMap(java.util.Iterator tuples,
java.lang.String field,
java.util.Comparator cmp)
Get map mapping from column values (as Object instances) to their ordinal index in a sorted array. |
static java.util.Map |
ordinalMap(TupleSet tuples,
java.lang.String field)
Get map mapping from column values (as Object instances) to their ordinal index in a sorted array. |
static java.util.Map |
ordinalMap(TupleSet tuples,
java.lang.String field,
java.util.Comparator cmp)
Get map mapping from column values (as Object instances) to their ordinal index in a sorted array. |
static double |
sum(java.util.Iterator tuples,
java.lang.String field)
Get the sum of a tuple data value. |
static java.lang.Object[] |
toArray(java.util.Iterator tuples,
java.lang.String field)
Get an array containing all data values for a given tuple iteration and field. |
static double[] |
toDoubleArray(java.util.Iterator tuples,
java.lang.String field)
Get an array of doubles containing all column values for a given table and field. |
static int |
uniqueCount(java.util.Iterator tuples,
java.lang.String field)
Get the number of distinct values in a data column. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataLib()
Method Detail |
---|
public static java.lang.Object[] toArray(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static double[] toDoubleArray(java.util.Iterator tuples, java.lang.String field)
Table.canGetDouble(String)
method must return
true for the given column name, otherwise an exception will be thrown.
tuples
- an iterator over tuplesfield
- the column / data field name
public static java.lang.Object[] ordinalArray(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static java.lang.Object[] ordinalArray(java.util.Iterator tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- an iterator over tuplesfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static java.lang.Object[] ordinalArray(TupleSet tuples, java.lang.String field)
tuples
- a TupleSetfield
- the column / data field name
public static java.lang.Object[] ordinalArray(TupleSet tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- a TupleSetfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static java.util.Map ordinalMap(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static java.util.Map ordinalMap(java.util.Iterator tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- an iterator over tuplesfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static java.util.Map ordinalMap(TupleSet tuples, java.lang.String field)
tuples
- a TupleSetfield
- the column / data field name
public static java.util.Map ordinalMap(TupleSet tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- a TupleSetfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static int count(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static int uniqueCount(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static Tuple min(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static Tuple min(java.util.Iterator tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- an iterator over tuplesfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static Tuple min(TupleSet tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- a TupleSetfield
- the column / data field name
public static Tuple min(TupleSet tuples, java.lang.String field)
tuples
- a TupleSetfield
- the column / data field name
public static Tuple max(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static Tuple max(java.util.Iterator tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- an iterator over tuplesfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static Tuple max(TupleSet tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- a TupleSetfield
- the column / data field name
public static Tuple max(TupleSet tuples, java.lang.String field)
tuples
- a TupleSetfield
- the column / data field name
public static Tuple median(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static Tuple median(java.util.Iterator tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- an iterator over tuplesfield
- the column / data field namecmp
- a comparator for sorting the column contents
public static Tuple median(TupleSet tuples, java.lang.String field, java.util.Comparator cmp)
tuples
- a TupleSetfield
- the column / data field name
public static Tuple median(TupleSet tuples, java.lang.String field)
tuples
- a TupleSetfield
- the column / data field name
public static double mean(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static double deviation(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static double deviation(java.util.Iterator tuples, java.lang.String field, double mean)
tuples
- an iterator over tuplesfield
- the column / data field namemean
- the mean of the column, used to speed up accurate
deviation calculation
public static double sum(java.util.Iterator tuples, java.lang.String field)
tuples
- an iterator over tuplesfield
- the column / data field name
public static java.lang.Class inferType(TupleSet tuples, java.lang.String field)
tuples
- the TupleSet to analyzefield
- the data field to type check
java.lang.IllegalArgumentException
- if incompatible types are used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |