de.erichseifert.gral.data.statistics
Class Histogram2D
- java.lang.Object
-
- de.erichseifert.gral.data.AbstractDataSource
-
- de.erichseifert.gral.data.statistics.AbstractHistogram2D
-
- de.erichseifert.gral.data.statistics.Histogram2D
-
- All Implemented Interfaces:
- DataListener, DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
public class Histogram2D extends AbstractHistogram2D
View that aggregates the column values of an other data source into a histogram with cells. The cells size can be equally sized by defining a number of cells or breakpoints between histogram cells can be passed as an array to create unequally sized cells.
For ease of use the histogram is a data source itself.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Histogram2D(DataSource data, Orientation orientation, int breakCount)Creates a new AbstractHistogram2D object with the specified DataSource and cell count.Histogram2D(DataSource data, Orientation orientation, java.lang.Number[]... breaks)Initializes a new histogram with the specified data source and subdivisions at the specified positions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Comparable<?>get(int col, int row)Returns the row with the specified index.java.lang.Number[]getCellLimits(int col, int cell)Returns the minimum and maximum value of the specified cell.intgetColumnCount()Returns the number of columns of the data source.java.lang.Class<? extends java.lang.Comparable<?>>[]getColumnTypes()Returns the data types of all columns.OrientationgetOrientation()Returns the direction in which the histogram values will be accumulated.intgetRowCount()Returns the number of rows of the data source.-
Methods inherited from class de.erichseifert.gral.data.statistics.AbstractHistogram2D
dataAdded, dataRemoved, dataUpdated, getData
-
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getColumnStatistics, getName, getRecord, getRow, getRowStatistics, getStatistics, isColumnNumeric, iterator, removeDataListener
-
-
-
-
Constructor Detail
-
Histogram2D
public Histogram2D(DataSource data, Orientation orientation, int breakCount)
Creates a new AbstractHistogram2D object with the specified DataSource and cell count.- Parameters:
data- DataSource so be analyzed.orientation- Orientation of the histogram values.breakCount- Number of subdivisions for analysis.
-
Histogram2D
public Histogram2D(DataSource data, Orientation orientation, java.lang.Number[]... breaks)
Initializes a new histogram with the specified data source and subdivisions at the specified positions.- Parameters:
data- Data source to be analyzed.orientation- Orientation in which the data should be sampled.breaks- Values of where a subdivision should occur.
-
-
Method Detail
-
getOrientation
public Orientation getOrientation()
Returns the direction in which the histogram values will be accumulated.- Returns:
- Horizontal or vertical orientation.
-
getCellLimits
public java.lang.Number[] getCellLimits(int col, int cell)Returns the minimum and maximum value of the specified cell.- Parameters:
col- Column index.cell- Cell index.- Returns:
- Extent of the cell.
-
get
public java.lang.Comparable<?> get(int col, int row)Returns the row with the specified index.- Parameters:
col- index of the column to returnrow- index of the row to return- Returns:
- the specified value of the data cell
-
getRowCount
public int getRowCount()
Returns the number of rows of the data source.- Returns:
- number of rows in the data source.
-
getColumnCount
public int getColumnCount()
Description copied from class:AbstractDataSourceReturns the number of columns of the data source.- Specified by:
getColumnCountin interfaceDataSource- Overrides:
getColumnCountin classAbstractDataSource- Returns:
- number of columns in the data source.
-
getColumnTypes
public java.lang.Class<? extends java.lang.Comparable<?>>[] getColumnTypes()
Description copied from class:AbstractDataSourceReturns the data types of all columns.- Specified by:
getColumnTypesin interfaceDataSource- Overrides:
getColumnTypesin classAbstractDataSource- Returns:
- The data types of all column in the data source
-
-
DataMelt 3.0 © DataMelt by jWork.ORG