|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.models.DataModelUtil
public abstract class DataModelUtil extends java.lang.Object
Data model conversion utilities.
| Constructor and Description |
|---|
DataModelUtil()
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.ArrayList<?> |
convert(java.util.Collection<?> data)
Converts from this type of list to appropriate array:
ArrayList list = new ArrayList();
list.add(new Object[] { "Lemons", null });
list.add(new Object[] { "Oranges", new Double(10) });
list.add(new Object[] { "Bananas", new Double(40) });
list.add(new Object[] { "Apples", new Double(20) });
list.add(new Object[] { "Nuts", new Double(30) });
|
static java.lang.Object[][] |
convert(java.lang.Object[][] data)
Converts from this type of array to appropriate array for a data model (rotation transformation): |
static void |
copy(ChartDataModel from,
ChartDataModel to)
Copies data from one chart data model to another. |
static void |
copy(MetaDataModel from,
MetaDataModel to,
ChartDataModel fromDataModel)
Copies data from one chart data model to another. |
static void |
copyIndexed(ChartDataModel from,
ChartDataModel to,
java.util.List<java.lang.Integer> indicies)
Copies indexed data from one chart data model to another. |
static void |
copyIndexed(MetaDataModel from,
MetaDataModel to,
ChartDataModel fromDataModel,
java.util.List<java.lang.Integer> indicies)
Copies data from one chart data model to another. |
static void |
generateSequenceData(DataColumnType[] columnTypes,
double seqStart,
double seqStep,
int seqCount,
ChartDataModel model)
Generates sequential data (for all columns the same) |
static java.util.List<java.lang.Object> |
getColumnData(DataColumnType valType,
AbstractDataModel model)
Gets the column data for the specified data type |
static java.util.Hashtable<java.lang.Object,java.lang.Number> |
getIndexedData(AbstractDataModel model)
Gets the frequencies for the KEY column. |
static void |
logBase(double logBase,
DataModel model)
All data elements are replaced with such values: Math.log(x + base) |
static void |
normalize(DataModel model,
DataColumnType column,
double min,
double max)
Normalizes each value, by assuming, that the minimum and maximum values, are the ones, provided as parameters. |
static void |
normalize(MatrixDataModel model)
Normalizes each value. |
static ChartDataModel |
sliceArrayDataModel(ChartDataModel model,
boolean sliceByRow,
java.lang.Object sliceThrough)
Slices given Array ChartDataModel into a 2D ChartModel. |
static MetaDataModel |
sliceArrayMetaModel(MetaDataModel metaModel,
ChartDataModel model,
boolean sliceByRow,
java.lang.Object sliceThrough)
Slices given 3D MetaDataModel into a 2D MetaDataModel. |
static ChartDataModel |
sliceMatrixDataModel(ChartDataModel matrixModel,
boolean sliceByRow,
int index)
Slices given Matrix ChartDataModel into a 2D ChartModel. |
static void |
soften3x3(MatrixDataModel matrix)
Softens the matrix be averaging it using 3x3 grid |
static void |
soften5x5(MatrixDataModel matrix)
Softens the matrix be averaging it using 5x5 grid |
static void |
swapDataColumns(DataColumnType valType1,
DataColumnType valType2,
AbstractDataModel model)
Swaps data columns |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataModelUtil()
| Method Detail |
|---|
public static java.util.ArrayList<?> convert(java.util.Collection<?> data)
ArrayList list = new ArrayList();
list.add(new Object[] { "Lemons", null });
list.add(new Object[] { "Oranges", new Double(10) });
list.add(new Object[] { "Bananas", new Double(40) });
list.add(new Object[] { "Apples", new Double(20) });
list.add(new Object[] { "Nuts", new Double(30) });
data - list to convert
public static void swapDataColumns(DataColumnType valType1,
DataColumnType valType2,
AbstractDataModel model)
valType1 - 1st column data typevalType2 - 2nd column data typemodel - data model where to swap columns
public static java.util.List<java.lang.Object> getColumnData(DataColumnType valType,
AbstractDataModel model)
valType - data value type (specifies the column)model - data modelpublic static java.util.Hashtable<java.lang.Object,java.lang.Number> getIndexedData(AbstractDataModel model)
model - data model
public static void generateSequenceData(DataColumnType[] columnTypes,
double seqStart,
double seqStep,
int seqCount,
ChartDataModel model)
seqStart - sequence startseqStep - sequence stepseqCount - sequence countmodel - data modelpublic static java.lang.Object[][] convert(java.lang.Object[][] data)
data - array of objectspublic static void soften3x3(MatrixDataModel matrix)
matrix - data matrixpublic static void soften5x5(MatrixDataModel matrix)
matrix - data matrix
public static void logBase(double logBase,
DataModel model)
Math.log(x + base)
logBase - log basemodel - chart data modelpublic static void normalize(MatrixDataModel model)
For array data model each column is normalized separately.
model - chart data model
public static void normalize(DataModel model,
DataColumnType column,
double min,
double max)
model - chart data modelcolumn - column type to normalizemin - assumed minimum valuemax - assumed maximum value
public static void copyIndexed(ChartDataModel from,
ChartDataModel to,
java.util.List<java.lang.Integer> indicies)
from - model from which to copy.to - model where to copy.indicies - list of model point indices.UnsupportedOperationException.
public static void copy(ChartDataModel from,
ChartDataModel to)
from - model from which to copy.to - model where to copy.UnsupportedOperationException.
public static void copyIndexed(MetaDataModel from,
MetaDataModel to,
ChartDataModel fromDataModel,
java.util.List<java.lang.Integer> indicies)
from - model from which to copy.to - model where to copy.UnsupportedOperationException.
public static void copy(MetaDataModel from,
MetaDataModel to,
ChartDataModel fromDataModel)
from - model from which to copy.to - model where to copy.UnsupportedOperationException.
public static ChartDataModel sliceMatrixDataModel(ChartDataModel matrixModel,
boolean sliceByRow,
int index)
matrixModel - 3D ChartDataModel.sliceByRow - if slice is should be taken for row, it is taken for column otherwise.index - index of row or column whose slice we want.
public static ChartDataModel sliceArrayDataModel(ChartDataModel model,
boolean sliceByRow,
java.lang.Object sliceThrough)
model - 3D ChartDataModel.sliceByRow - if slice is should be taken for row, it is taken for column otherwise.sliceThrough - row or column value through which to splice.
public static MetaDataModel sliceArrayMetaModel(MetaDataModel metaModel,
ChartDataModel model,
boolean sliceByRow,
java.lang.Object sliceThrough)
metaModel - 3D MetaDataModel.model - 3D ChartDataModel.sliceByRow - if slice is should be taken for row, it is taken for column otherwise.sliceThrough - row or column value through which to splice.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||