public class Histogram1D extends Histogram
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.
Constructor and Description |
---|
Histogram1D(DataSource data,
Orientation orientation,
int breakCount)
Creates a new Histogram object with the specified DataSource and
cell count.
|
Histogram1D(DataSource data,
Orientation orientation,
java.lang.Number[]... breaks)
Initializes a new histogram with the specified data source and
subdivisions at the specified positions.
|
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.
|
int |
getColumnCount()
Returns the number of columns of the data source.
|
java.lang.Class<? extends java.lang.Comparable<?>>[] |
getColumnTypes()
Returns the data types of all columns.
|
Orientation |
getOrientation()
Returns the direction in which the histogram values will be accumulated.
|
int |
getRowCount()
Returns the number of rows of the data source.
|
protected void |
rebuildCells()
(Re-)populates the cells of this Histogram.
|
dataAdded, dataRemoved, dataUpdated, getData
addDataListener, getColumn, getRow, getStatistics, isColumnNumeric, iterator, notifyDataAdded, notifyDataRemoved, notifyDataUpdated, removeDataListener, setColumnTypes
public Histogram1D(DataSource data, Orientation orientation, int breakCount)
data
- DataSource so be analyzed.orientation
- Orientation of the histogram values.breakCount
- Number of subdivisions for analysis.public Histogram1D(DataSource data, Orientation orientation, java.lang.Number[]... breaks)
data
- Data source to be analyzed.orientation
- Orientation in which the data should be sampled.breaks
- Values of where a subdivision should occur.protected void rebuildCells()
rebuildCells
in class Histogram
public Orientation getOrientation()
public java.lang.Number[] getCellLimits(int col, int cell)
col
- Column index.cell
- Cell index.public java.lang.Comparable<?> get(int col, int row)
col
- index of the column to returnrow
- index of the row to returnpublic int getRowCount()
public int getColumnCount()
AbstractDataSource
getColumnCount
in interface DataSource
getColumnCount
in class AbstractDataSource
public java.lang.Class<? extends java.lang.Comparable<?>>[] getColumnTypes()
AbstractDataSource
getColumnTypes
in interface DataSource
getColumnTypes
in class AbstractDataSource