public class SlidingCategoryDataset extends AbstractDataset implements CategoryDataset
CategoryDataset
implementation that presents a subset of the
categories in an underlying dataset. The index of the first "visible"
category can be modified, which provides a means of "sliding" through
the categories in the underlying dataset.Constructor and Description |
---|
SlidingCategoryDataset(CategoryDataset underlying,
int firstColumn,
int maxColumns)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns an independent copy of the dataset.
|
boolean |
equals(Object obj)
Tests this
SlidingCategoryDataset for equality with an
arbitrary object. |
int |
getColumnCount()
Returns the number of columns in the table.
|
int |
getColumnIndex(Comparable key)
Returns the index for the specified column key.
|
Comparable |
getColumnKey(int column)
Returns the column key for a given index.
|
List |
getColumnKeys()
Returns the column keys.
|
int |
getFirstCategoryIndex()
Returns the index of the first visible category.
|
int |
getMaximumCategoryCount()
Returns the maximum category count.
|
int |
getRowCount()
Returns the number of rows in the table.
|
int |
getRowIndex(Comparable key)
Returns the row index for a given key.
|
Comparable |
getRowKey(int row)
Returns the row key for a given index.
|
List |
getRowKeys()
Returns the row keys.
|
CategoryDataset |
getUnderlyingDataset()
Returns the underlying dataset that was supplied to the constructor.
|
Number |
getValue(Comparable rowKey,
Comparable columnKey)
Returns the value for a pair of keys.
|
Number |
getValue(int row,
int column)
Returns a value from the table.
|
void |
setFirstCategoryIndex(int first)
Sets the index of the first category that should be used from the
underlying dataset, and sends a
DatasetChangeEvent to all
registered listeners. |
void |
setMaximumCategoryCount(int max)
Sets the maximum category count and sends a
DatasetChangeEvent
to all registered listeners. |
addChangeListener, getGroup, getNotify, hasListener, removeChangeListener, setGroup, setNotify, validateObject
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChangeListener, getGroup, removeChangeListener, setGroup
public SlidingCategoryDataset(CategoryDataset underlying, int firstColumn, int maxColumns)
underlying
- the underlying dataset (null
not
permitted).firstColumn
- the index of the first visible column from the
underlying dataset.maxColumns
- the maximumColumnCount.public CategoryDataset getUnderlyingDataset()
null
).public int getFirstCategoryIndex()
setFirstCategoryIndex(int)
public void setFirstCategoryIndex(int first)
DatasetChangeEvent
to all
registered listeners.first
- the index.getFirstCategoryIndex()
public int getMaximumCategoryCount()
setMaximumCategoryCount(int)
public void setMaximumCategoryCount(int max)
DatasetChangeEvent
to all registered listeners.max
- the maximum.getMaximumCategoryCount()
public int getColumnIndex(Comparable key)
getColumnIndex
in interface KeyedValues2D
key
- the key.public Comparable getColumnKey(int column)
getColumnKey
in interface KeyedValues2D
column
- the column index (zero-based).IndexOutOfBoundsException
- if row
is out of bounds.public List getColumnKeys()
getColumnKeys
in interface KeyedValues2D
getColumnKey(int)
public int getRowIndex(Comparable key)
getRowIndex
in interface KeyedValues2D
key
- the row key.-1
if the key is unrecognised.public Comparable getRowKey(int row)
getRowKey
in interface KeyedValues2D
row
- the row index (zero-based).IndexOutOfBoundsException
- if row
is out of bounds.public List getRowKeys()
getRowKeys
in interface KeyedValues2D
public Number getValue(Comparable rowKey, Comparable columnKey)
getValue
in interface KeyedValues2D
rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).null
).UnknownKeyException
- if either key is not defined in the dataset.public int getColumnCount()
getColumnCount
in interface Values2D
public int getRowCount()
getRowCount
in interface Values2D
public Number getValue(int row, int column)
public boolean equals(Object obj)
SlidingCategoryDataset
for equality with an
arbitrary object.public Object clone() throws CloneNotSupportedException
PublicCloneable
interface;clone
in class AbstractDataset
CloneNotSupportedException
- if the dataset cannot be cloned for
any reason.Jas4pp 1.5 © Java Analysis Studio for Particle Physics