Class QueryDataFrame<C>
- java.lang.Object
-
- com.macrofocus.molap.dataframe.AbstractDataFrame<Group,java.lang.String,java.lang.Object>
-
- com.macrofocus.molap.aggregates.query.QueryDataFrame<C>
-
- All Implemented Interfaces:
AggregateDataFrame<C>
,DataFrame<Group,java.lang.String,java.lang.Object>
public class QueryDataFrame<C> extends AbstractDataFrame<Group,java.lang.String,java.lang.Object> implements AggregateDataFrame<C>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.macrofocus.molap.dataframe.AbstractDataFrame
AbstractDataFrame.ColumnSeries
-
-
Constructor Summary
Constructors Constructor Description QueryDataFrame(Query query, boolean includeIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregateDataFrame<C>
collapse()
java.lang.Iterable<java.lang.String>
columns()
Returns the column keys.AggregateDataFrame<C>
dice(java.util.Set<java.lang.Object> valuesSets)
AggregateDataFrame<C>
drillDown(C... columns)
Returns a new data frame that group the rows by values of the specified columns.AggregateDataFrame<C>
drillUp()
Returns a new data frame with the last group by level removed, i.e.Series<Group,java.lang.Object>
getColumn(java.lang.String column)
Returns a series of all the values of a given column.int
getColumnAddress(java.lang.String column)
Returns the absolute index for the specified column key.java.lang.Class
getColumnClass(java.lang.String 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<java.lang.String>
getColumnIndex()
Gets the index used to access the columns.java.lang.String
getColumnKey(int index)
Returns the column key at the specified absolute index.Cuboid
getCuboid()
Returns the cuboid used to aggregate the values.Series<java.lang.String,?>
getRow(Group row)
Returns a series of all the values of a given row.int
getRowAddress(Group row)
Returns the absolute index for the specified row key.java.lang.Class
getRowClass(Group 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<Group>
getRowIndex()
Gets the index used to access the rows.Group
getRowKey(int index)
Returns the row key at the specified absolute index.java.lang.Object
getValueAt(Group path, java.lang.String column)
Returns the value for the cell at the intersection of thecolumn
key androw
key.DataFrame
join(Series series, java.lang.String[] columns)
AggregateDataFrame<C>
on(Cuboid... cuboids)
Combine the values from multiple cuboids into that data frame.AggregateDataFrame<C>
order(Aggregation... aggregations)
Returns a new data frame that change the order of the groups according to the specified aggregation methods.AggregateDataFrame<C>
pivot(Aggregation aggregation)
Returns a new data frame that pivot the specified aggregation method into column values.DataFrame<MultiKey,java.lang.String,java.lang.Object>
reindexRows(java.lang.String... rows)
Returns a new data frame reindexed using the values coming from the specified rows.java.lang.Iterable<Group>
rows()
Returns the row keys.AggregateDataFrame<C>
slice(java.lang.Object value)
-
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, 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, reindexRows, remapColumns, removeColumns, removeDataFrameListener, removeDataFrameListeners, removeDuplicates
-
-
-
-
Constructor Detail
-
QueryDataFrame
public QueryDataFrame(Query query, boolean includeIndex)
-
-
Method Detail
-
getCuboid
public Cuboid getCuboid()
Description copied from interface:AggregateDataFrame
Returns the cuboid used to aggregate the values.- Specified by:
getCuboid
in interfaceAggregateDataFrame<C>
- Returns:
- the cuboid
-
drillDown
public AggregateDataFrame<C> drillDown(C... columns)
Description copied from interface:AggregateDataFrame
Returns a new data frame that group the rows by values of the specified columns.- Specified by:
drillDown
in interfaceAggregateDataFrame<C>
- Parameters:
columns
- the columns- Returns:
- a new data frame aggregating the values according to the new criteria
-
drillUp
public AggregateDataFrame<C> drillUp()
Description copied from interface:AggregateDataFrame
Returns a new data frame with the last group by level removed, i.e. one level up.- Specified by:
drillUp
in interfaceAggregateDataFrame<C>
- Returns:
- a new data frame aggregating the values according to the new criteria
-
slice
public AggregateDataFrame<C> slice(java.lang.Object value)
- Specified by:
slice
in interfaceAggregateDataFrame<C>
-
dice
public AggregateDataFrame<C> dice(java.util.Set<java.lang.Object> valuesSets)
- Specified by:
dice
in interfaceAggregateDataFrame<C>
-
collapse
public AggregateDataFrame<C> collapse()
- Specified by:
collapse
in interfaceAggregateDataFrame<C>
-
order
public AggregateDataFrame<C> order(Aggregation... aggregations)
Description copied from interface:AggregateDataFrame
Returns a new data frame that change the order of the groups according to the specified aggregation methods.- Specified by:
order
in interfaceAggregateDataFrame<C>
- Parameters:
aggregations
- the aggregation methods- Returns:
- a new data frame
-
pivot
public AggregateDataFrame<C> pivot(Aggregation aggregation)
Description copied from interface:AggregateDataFrame
Returns a new data frame that pivot the specified aggregation method into column values.- Specified by:
pivot
in interfaceAggregateDataFrame<C>
- Parameters:
aggregation
- the aggregation to pivot- Returns:
- a new data frame
-
on
public AggregateDataFrame<C> on(Cuboid... cuboids)
Description copied from interface:AggregateDataFrame
Combine the values from multiple cuboids into that data frame.- Specified by:
on
in interfaceAggregateDataFrame<C>
- Parameters:
cuboids
- the cuboids- Returns:
- a new data frame
-
getRowClass
public java.lang.Class getRowClass(Group row)
Description copied from interface:DataFrame
Returns the most specific superclass for all cell values in a row.- Specified by:
getRowClass
in interfaceDataFrame<Group,java.lang.String,java.lang.Object>
- 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(java.lang.String column)
Description copied from interface:DataFrame
Returns the most specific superclass for all cell values in a column- Specified by:
getColumnClass
in interfaceDataFrame<Group,java.lang.String,java.lang.Object>
- Parameters:
column
- the key of the column- Returns:
- the common ancestor class of the object values in the column.
-
getValueAt
public java.lang.Object getValueAt(Group path, java.lang.String 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<Group,java.lang.String,java.lang.Object>
- Parameters:
path
- 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
-
getRow
public Series<java.lang.String,?> getRow(Group row)
Description copied from interface:DataFrame
Returns a series of all the values of a given row.
-
getColumn
public Series<Group,java.lang.Object> getColumn(java.lang.String column)
Description copied from interface:DataFrame
Returns a series of all the values of a given column.
-
rows
public java.lang.Iterable<Group> rows()
Description copied from interface:DataFrame
Returns the row keys.
-
columns
public java.lang.Iterable<java.lang.String> columns()
Description copied from interface:DataFrame
Returns the column keys.
-
getRowKey
public Group 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 java.lang.String 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<Group,java.lang.String,java.lang.Object>
- Overrides:
getColumnKey
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- Parameters:
index
- the index- Returns:
- the column key
-
getRowAddress
public int getRowAddress(Group 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<Group,java.lang.String,java.lang.Object>
- Overrides:
getRowAddress
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- Parameters:
row
- the row key- Returns:
- the absolute index of the specified key.
-
getColumnAddress
public int getColumnAddress(java.lang.String 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<Group,java.lang.String,java.lang.Object>
- Overrides:
getColumnAddress
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- 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<Group,java.lang.String,java.lang.Object>
- Overrides:
getRowCount
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- 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<Group,java.lang.String,java.lang.Object>
- Overrides:
getColumnCount
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- Returns:
- the number of columns.
-
reindexRows
public DataFrame<MultiKey,java.lang.String,java.lang.Object> reindexRows(java.lang.String... rows)
Description copied from interface:DataFrame
Returns a new data frame reindexed using the values coming from the specified rows.- Specified by:
reindexRows
in interfaceDataFrame<Group,java.lang.String,java.lang.Object>
- Overrides:
reindexRows
in classAbstractDataFrame<Group,java.lang.String,java.lang.Object>
- Parameters:
rows
- the columns to use for the label values- Returns:
- the reindexed data frame.
-
getRowIndex
public UniqueIndex<Group> getRowIndex()
Description copied from interface:DataFrame
Gets the index used to access the rows.- Specified by:
getRowIndex
in interfaceDataFrame<Group,java.lang.String,java.lang.Object>
- Returns:
- the row index
-
getColumnIndex
public UniqueIndex<java.lang.String> getColumnIndex()
Description copied from interface:DataFrame
Gets the index used to access the columns.- Specified by:
getColumnIndex
in interfaceDataFrame<Group,java.lang.String,java.lang.Object>
- Returns:
- the column index
-
-