Package com.macrofocus.molap.dataframe
Class ReIndexedDataFrame<R,C,V,X,Y>
- java.lang.Object
-
- com.macrofocus.molap.dataframe.AbstractDataFrame<R,C,V>
-
- com.macrofocus.molap.dataframe.AbstractMutableDataFrame<R,C,V>
-
- com.macrofocus.molap.dataframe.ReIndexedDataFrame<R,C,V,X,Y>
-
- Type Parameters:
R
- the rexindexed type of rowsC
- the reindexed type of columnsV
- the type of valuesX
- the original type of rowsY
- the original type of columns
- All Implemented Interfaces:
DataFrame<R,C,V>
,MutableDataFrame<R,C,V>
- Direct Known Subclasses:
TimeSeriesDataFrames.DefaultDynamic
,TimeSeriesDataFrames.DefaultStatic
public class ReIndexedDataFrame<R,C,V,X,Y> extends AbstractMutableDataFrame<R,C,V> implements MutableDataFrame<R,C,V>
A reindexed data frame.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ReIndexedDataFrame.ReIndexRecipe<R,C>
-
Nested classes/interfaces inherited from class com.macrofocus.molap.dataframe.AbstractDataFrame
AbstractDataFrame.ColumnSeries
-
-
Constructor Summary
Constructors Constructor Description ReIndexedDataFrame(DataFrame<X,Y,V> dataFrame, ReIndexedDataFrame.ReIndexRecipe<R,C> recipe)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<C>
columns()
Returns the column keys.protected void
dataFrameChanged()
Series<R,V>
getColumn(C column)
Returns a series of all the values of a given column.int
getColumnAddress(C column)
Returns the absolute index for the specified column key.java.lang.Class
getColumnClass(C column)
Returns the most specific superclass for all cell values in a columnint
getColumnCount()
Returns the number of columns contained by this data frame.UniqueIndex<C>
getColumnIndex()
Gets the index used to access the columns.C
getColumnKey(int index)
Returns the column key at the specified absolute index.Series<C,?>
getRow(R row)
Returns a series of all the values of a given row.int
getRowAddress(R row)
Returns the absolute index for the specified row key.java.lang.Class
getRowClass(R row)
Returns the most specific superclass for all cell values in a row.int
getRowCount()
Returns the number of rows contained by the this data frame.UniqueIndex<R>
getRowIndex()
Gets the index used to access the rows.R
getRowKey(int index)
Returns the row key at the specified absolute index.V
getValueAt(R row, C column)
Returns the value for the cell at the intersection of thecolumn
key androw
key.DataFrame
join(Series series, C[] columns)
java.lang.Iterable<R>
rows()
Returns the row keys.protected void
setRecipe(ReIndexedDataFrame.ReIndexRecipe<R,C> recipe)
void
setValueAt(R row, C column, V value)
Sets the value for the cell at the intersection of thecolumn
key androw
key.-
Methods inherited from class com.macrofocus.molap.dataframe.AbstractMutableDataFrame
reindexRows, reindexRows
-
Methods inherited from class com.macrofocus.molap.dataframe.AbstractDataFrame
addDataFrameListener, addWeakDataFrameListener, aggregate, aggregate, append, appendAndReindex, benchmark, filter, getCentroid, getColumnName, getConstant, getCount, getCountDistinct, getCountDistinctWithNull, getCube, getDataFrameAggregation, getDistributiveStatistics, getFirst, getFirstQuartile, getMax, getMean, getMedian, getMin, getRandom, getStatistics, getStdDev, getSum, getThirdQuartile, getUnivariateStatistics, getVariance, getVarianceByPopulation, getWeightedMean, getWeightedSum, notifyDataFrameChanged, orderRows, print, print, printSchema, reindexColumns, reindexRows, reindexRows, reindexRows, remapColumns, removeColumns, removeDataFrameListener, removeDataFrameListeners, removeDuplicates
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.molap.dataframe.DataFrame
addDataFrameListener, addWeakDataFrameListener, aggregate, aggregate, append, appendAndReindex, benchmark, filter, getCentroid, getColumnName, getConstant, getCount, getCountDistinct, getCountDistinctWithNull, getDataFrameAggregation, getDistributiveStatistics, getFirst, getFirstQuartile, getMax, getMean, getMedian, getMin, getRandom, getStatistics, getStdDev, getSum, getThirdQuartile, getUnivariateStatistics, getVariance, getVarianceByPopulation, getWeightedMean, getWeightedSum, orderRows, print, print, printSchema, reindexColumns, reindexRows, reindexRows, reindexRows, remapColumns, removeColumns, removeDataFrameListener, removeDataFrameListeners, removeDuplicates
-
Methods inherited from interface com.macrofocus.molap.dataframe.MutableDataFrame
reindexRows, reindexRows
-
-
-
-
Method Detail
-
setRecipe
protected void setRecipe(ReIndexedDataFrame.ReIndexRecipe<R,C> recipe)
-
dataFrameChanged
protected void dataFrameChanged()
-
getRowClass
public java.lang.Class getRowClass(R row)
Description copied from interface:DataFrame
Returns the most specific superclass for all cell values in a row.- Specified by:
getRowClass
in interfaceDataFrame<R,C,V>
- Parameters:
row
- the key of the row- Returns:
- the common ancestor class of the object values in the row.
-
getColumnClass
public java.lang.Class getColumnClass(C column)
Description copied from interface:DataFrame
Returns the most specific superclass for all cell values in a column- Specified by:
getColumnClass
in interfaceDataFrame<R,C,V>
- Parameters:
column
- the key of the column- Returns:
- the common ancestor class of the object values in the column.
-
getValueAt
public V getValueAt(R row, C column)
Description copied from interface:DataFrame
Returns the value for the cell at the intersection of thecolumn
key androw
key.- Specified by:
getValueAt
in interfaceDataFrame<R,C,V>
- Parameters:
row
- the row key whose value is to be queriedcolumn
- the column key whose value is to be queried- Returns:
- the value Object at the specified cell
-
setValueAt
public void setValueAt(R row, C column, V value)
Description copied from interface:MutableDataFrame
Sets the value for the cell at the intersection of thecolumn
key androw
key.- Specified by:
setValueAt
in interfaceMutableDataFrame<R,C,V>
- Parameters:
row
- the row key whose value is to be changedcolumn
- the column key whose value is to be changedvalue
- the new value at the specified cell
-
getRow
public Series<C,?> getRow(R row)
Description copied from interface:DataFrame
Returns a series of all the values of a given row.
-
getColumn
public Series<R,V> getColumn(C column)
Description copied from interface:DataFrame
Returns a series of all the values of a given column.
-
rows
public java.lang.Iterable<R> rows()
Description copied from interface:DataFrame
Returns the row keys.
-
columns
public java.lang.Iterable<C> columns()
Description copied from interface:DataFrame
Returns the column keys.
-
getRowKey
public R getRowKey(int index)
Description copied from interface:DataFrame
Returns the row key at the specified absolute index. This is the inverse ofDataFrame.getRowAddress(Object)
.
-
getColumnKey
public C getColumnKey(int index)
Description copied from interface:DataFrame
Returns the column key at the specified absolute index. This is the inverse ofDataFrame.getColumnAddress(Object)
.- Specified by:
getColumnKey
in interfaceDataFrame<R,C,V>
- Overrides:
getColumnKey
in classAbstractDataFrame<R,C,V>
- Parameters:
index
- the index- Returns:
- the column key
-
getRowAddress
public int getRowAddress(R row)
Description copied from interface:DataFrame
Returns the absolute index for the specified row key. This is the inverse ofDataFrame.getRowKey(int)
.- Specified by:
getRowAddress
in interfaceDataFrame<R,C,V>
- Overrides:
getRowAddress
in classAbstractDataFrame<R,C,V>
- Parameters:
row
- the row key- Returns:
- the absolute index of the specified key.
-
getColumnAddress
public int getColumnAddress(C column)
Description copied from interface:DataFrame
Returns the absolute index for the specified column key. This is the inverse ofDataFrame.getColumnKey(int)
.- Specified by:
getColumnAddress
in interfaceDataFrame<R,C,V>
- Overrides:
getColumnAddress
in classAbstractDataFrame<R,C,V>
- Parameters:
column
- the column key- Returns:
- the absolute index of the specified key.
-
getRowCount
public int getRowCount()
Description copied from interface:DataFrame
Returns the number of rows contained by the this data frame.- Specified by:
getRowCount
in interfaceDataFrame<R,C,V>
- Overrides:
getRowCount
in classAbstractDataFrame<R,C,V>
- Returns:
- the number of rows.
-
getColumnCount
public int getColumnCount()
Description copied from interface:DataFrame
Returns the number of columns contained by this data frame.- Specified by:
getColumnCount
in interfaceDataFrame<R,C,V>
- Overrides:
getColumnCount
in classAbstractDataFrame<R,C,V>
- Returns:
- the number of columns.
-
getRowIndex
public UniqueIndex<R> getRowIndex()
Description copied from interface:DataFrame
Gets the index used to access the rows.- Specified by:
getRowIndex
in interfaceDataFrame<R,C,V>
- Returns:
- the row index
-
getColumnIndex
public UniqueIndex<C> getColumnIndex()
Description copied from interface:DataFrame
Gets the index used to access the columns.- Specified by:
getColumnIndex
in interfaceDataFrame<R,C,V>
- Returns:
- the column index
-
-