Class ColumnModelDataFrame
- java.lang.Object
-
- com.macrofocus.molap.dataframe.AbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
-
- com.macrofocus.molap.dataframe.swing.ColumnModelDataFrame
-
- All Implemented Interfaces:
DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
,MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
public class ColumnModelDataFrame extends AbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> implements MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
Converts a TableModel into a DataFrame.
-
-
Constructor Summary
Constructors Constructor Description ColumnModelDataFrame(java.lang.String columnName, com.macrofocus.data.column.ColumnModel tableModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<java.lang.String>
columns()
Returns the column keys.Series<java.lang.Integer,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.Series<java.lang.String,?>
getRow(java.lang.Integer row)
Returns a series of all the values of a given row.int
getRowAddress(java.lang.Integer row)
Returns the absolute index for the specified row key.java.lang.Class
getRowClass(java.lang.Integer 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<java.lang.Integer>
getRowIndex()
Gets the index used to access the rows.java.lang.Integer
getRowKey(int index)
Returns the row key at the specified absolute index.java.lang.Object
getValueAt(java.lang.Integer row, 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)
MutableDataFrame<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<java.lang.Integer>
rows()
Returns the row keys.void
setValueAt(java.lang.Integer row, java.lang.String column, java.lang.Object value)
Sets the value for the cell at the intersection of thecolumn
key androw
key.-
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, remapColumns, removeColumns, removeDataFrameListener, removeDataFrameListeners, removeDuplicates
-
Methods inherited from interface com.macrofocus.molap.dataframe.MutableDataFrame
reindexRows
-
-
-
-
Method Detail
-
getRowClass
public java.lang.Class getRowClass(java.lang.Integer row)
Description copied from interface:DataFrame
Returns the most specific superclass for all cell values in a row.- Specified by:
getRowClass
in interfaceDataFrame<java.lang.Integer,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<java.lang.Integer,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(java.lang.Integer row, 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<java.lang.Integer,java.lang.String,java.lang.Object>
- 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(java.lang.Integer row, java.lang.String column, java.lang.Object 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<java.lang.Integer,java.lang.String,java.lang.Object>
- 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<java.lang.String,?> getRow(java.lang.Integer row)
Description copied from interface:DataFrame
Returns a series of all the values of a given row.
-
getColumn
public Series<java.lang.Integer,java.lang.Object> getColumn(java.lang.String column)
Description copied from interface:DataFrame
Returns a series of all the values of a given column.- Specified by:
getColumn
in interfaceDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getColumn
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Parameters:
column
- the row key- Returns:
- a Series object
-
rows
public java.lang.Iterable<java.lang.Integer> rows()
Description copied from interface:DataFrame
Returns the row keys.- Specified by:
rows
in interfaceDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
rows
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Returns:
- the row keys
-
columns
public java.lang.Iterable<java.lang.String> columns()
Description copied from interface:DataFrame
Returns the column keys.- Specified by:
columns
in interfaceDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
columns
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Returns:
- the column keys
-
getRowKey
public java.lang.Integer getRowKey(int index)
Description copied from interface:DataFrame
Returns the row key at the specified absolute index. This is the inverse ofDataFrame.getRowAddress(Object)
.- Specified by:
getRowKey
in interfaceDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getRowKey
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Parameters:
index
- the index- Returns:
- the row key
-
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<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getColumnKey
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Parameters:
index
- the index- Returns:
- the column key
-
getRowAddress
public int getRowAddress(java.lang.Integer 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<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getRowAddress
in classAbstractDataFrame<java.lang.Integer,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<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getColumnAddress
in classAbstractDataFrame<java.lang.Integer,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<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getRowCount
in classAbstractDataFrame<java.lang.Integer,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<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
getColumnCount
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Returns:
- the number of columns.
-
reindexRows
public MutableDataFrame<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<java.lang.Integer,java.lang.String,java.lang.Object>
- Specified by:
reindexRows
in interfaceMutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Overrides:
reindexRows
in classAbstractDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
- Parameters:
rows
- the columns to use for the label values- Returns:
- the reindexed data frame.
-
getRowIndex
public UniqueIndex<java.lang.Integer> getRowIndex()
Description copied from interface:DataFrame
Gets the index used to access the rows.- Specified by:
getRowIndex
in interfaceDataFrame<java.lang.Integer,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<java.lang.Integer,java.lang.String,java.lang.Object>
- Returns:
- the column index
-
-