org.jfree.data.gantt

Class SlidingGanttCategoryDataset

public class SlidingGanttCategoryDataset extends AbstractDataset implements GanttCategoryDataset

A GanttCategoryDataset 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.

Since: 1.0.10

Constructor Summary
SlidingGanttCategoryDataset(GanttCategoryDataset underlying, int firstColumn, int maxColumns)
Creates a new instance.
Method Summary
Objectclone()
Returns an independent copy of the dataset.
booleanequals(Object obj)
Tests this SlidingCategoryDataset for equality with an arbitrary object.
intgetColumnCount()
Returns the number of columns in the table.
intgetColumnIndex(Comparable key)
Returns the index for the specified column key.
ComparablegetColumnKey(int column)
Returns the column key for a given index.
ListgetColumnKeys()
Returns the column keys.
NumbergetEndValue(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the end value of a sub-interval for a given item.
NumbergetEndValue(int row, int column, int subinterval)
Returns the end value of a sub-interval for a given item.
NumbergetEndValue(Comparable rowKey, Comparable columnKey)
Returns the end value for the interval for a given series and category.
NumbergetEndValue(int series, int category)
Returns the end value for the interval for a given series and category.
intgetFirstCategoryIndex()
Returns the index of the first visible category.
intgetMaximumCategoryCount()
Returns the maximum category count.
NumbergetPercentComplete(Comparable rowKey, Comparable columnKey)
Returns the percent complete for a given item.
NumbergetPercentComplete(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.
NumbergetPercentComplete(int series, int category)
Returns the percent complete for a given item.
NumbergetPercentComplete(int row, int column, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.
intgetRowCount()
Returns the number of rows in the table.
intgetRowIndex(Comparable key)
Returns the row index for a given key.
ComparablegetRowKey(int row)
Returns the row key for a given index.
ListgetRowKeys()
Returns the row keys.
NumbergetStartValue(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the start value of a sub-interval for a given item.
NumbergetStartValue(int row, int column, int subinterval)
Returns the start value of a sub-interval for a given item.
NumbergetStartValue(Comparable rowKey, Comparable columnKey)
Returns the start value for the interval for a given series and category.
NumbergetStartValue(int row, int column)
Returns the start value for the interval for a given series and category.
intgetSubIntervalCount(Comparable rowKey, Comparable columnKey)
Returns the number of sub-intervals for a given item.
intgetSubIntervalCount(int row, int column)
Returns the number of sub-intervals for a given item.
GanttCategoryDatasetgetUnderlyingDataset()
Returns the underlying dataset that was supplied to the constructor.
NumbergetValue(Comparable rowKey, Comparable columnKey)
Returns the value for a pair of keys.
NumbergetValue(int row, int column)
Returns a value from the table.
voidsetFirstCategoryIndex(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.
voidsetMaximumCategoryCount(int max)
Sets the maximum category count and sends a DatasetChangeEvent to all registered listeners.

Constructor Detail

SlidingGanttCategoryDataset

public SlidingGanttCategoryDataset(GanttCategoryDataset underlying, int firstColumn, int maxColumns)
Creates a new instance.

Parameters: underlying the underlying dataset (null not permitted). firstColumn the index of the first visible column from the underlying dataset. maxColumns the maximumColumnCount.

Method Detail

clone

public Object clone()
Returns an independent copy of the dataset. Note that:

Returns: An independent copy of the dataset.

Throws: CloneNotSupportedException if the dataset cannot be cloned for any reason.

equals

public boolean equals(Object obj)
Tests this SlidingCategoryDataset for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.

Returns: The column count.

getColumnIndex

public int getColumnIndex(Comparable key)
Returns the index for the specified column key.

Parameters: key the key.

Returns: The column index, or -1 if the key is not recognised.

getColumnKey

public Comparable getColumnKey(int column)
Returns the column key for a given index.

Parameters: column the column index (zero-based).

Returns: The column key.

Throws: IndexOutOfBoundsException if row is out of bounds.

getColumnKeys

public List getColumnKeys()
Returns the column keys.

Returns: The keys.

See Also: SlidingGanttCategoryDataset

getEndValue

public Number getEndValue(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the end value of a sub-interval for a given item.

Parameters: rowKey the row key. columnKey the column key. subinterval the sub-interval.

Returns: The end value (possibly null).

See Also: SlidingGanttCategoryDataset

getEndValue

public Number getEndValue(int row, int column, int subinterval)
Returns the end value of a sub-interval for a given item.

Parameters: row the row index (zero-based). column the column index (zero-based). subinterval the sub-interval.

Returns: The end value (possibly null).

See Also: SlidingGanttCategoryDataset

getEndValue

public Number getEndValue(Comparable rowKey, Comparable columnKey)
Returns the end value for the interval for a given series and category.

Parameters: rowKey the series key. columnKey the category key.

Returns: The end value (possibly null).

See Also: SlidingGanttCategoryDataset

getEndValue

public Number getEndValue(int series, int category)
Returns the end value for the interval for a given series and category.

Parameters: series the series (zero-based index). category the category (zero-based index).

Returns: The end value (possibly null).

getFirstCategoryIndex

public int getFirstCategoryIndex()
Returns the index of the first visible category.

Returns: The index.

See Also: SlidingGanttCategoryDataset

getMaximumCategoryCount

public int getMaximumCategoryCount()
Returns the maximum category count.

Returns: The maximum category count.

See Also: SlidingGanttCategoryDataset

getPercentComplete

public Number getPercentComplete(Comparable rowKey, Comparable columnKey)
Returns the percent complete for a given item.

Parameters: rowKey the row key. columnKey the column key.

Returns: The percent complete.

getPercentComplete

public Number getPercentComplete(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.

Parameters: rowKey the row key. columnKey the column key. subinterval the sub-interval.

Returns: The percent complete value (possibly null).

See Also: SlidingGanttCategoryDataset

getPercentComplete

public Number getPercentComplete(int series, int category)
Returns the percent complete for a given item.

Parameters: series the row index (zero-based). category the column index (zero-based).

Returns: The percent complete.

getPercentComplete

public Number getPercentComplete(int row, int column, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.

Parameters: row the row index (zero-based). column the column index (zero-based). subinterval the sub-interval.

Returns: The percent complete value (possibly null).

See Also: SlidingGanttCategoryDataset

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Returns: The row count.

getRowIndex

public int getRowIndex(Comparable key)
Returns the row index for a given key.

Parameters: key the row key.

Returns: The row index, or -1 if the key is unrecognised.

getRowKey

public Comparable getRowKey(int row)
Returns the row key for a given index.

Parameters: row the row index (zero-based).

Returns: The row key.

Throws: IndexOutOfBoundsException if row is out of bounds.

getRowKeys

public List getRowKeys()
Returns the row keys.

Returns: The keys.

getStartValue

public Number getStartValue(Comparable rowKey, Comparable columnKey, int subinterval)
Returns the start value of a sub-interval for a given item.

Parameters: rowKey the row key. columnKey the column key. subinterval the sub-interval.

Returns: The start value (possibly null).

See Also: SlidingGanttCategoryDataset

getStartValue

public Number getStartValue(int row, int column, int subinterval)
Returns the start value of a sub-interval for a given item.

Parameters: row the row index (zero-based). column the column index (zero-based). subinterval the sub-interval index (zero-based).

Returns: The start value (possibly null).

See Also: SlidingGanttCategoryDataset

getStartValue

public Number getStartValue(Comparable rowKey, Comparable columnKey)
Returns the start value for the interval for a given series and category.

Parameters: rowKey the series key. columnKey the category key.

Returns: The start value (possibly null).

See Also: SlidingGanttCategoryDataset

getStartValue

public Number getStartValue(int row, int column)
Returns the start value for the interval for a given series and category.

Parameters: row the series (zero-based index). column the category (zero-based index).

Returns: The start value (possibly null).

See Also: SlidingGanttCategoryDataset

getSubIntervalCount

public int getSubIntervalCount(Comparable rowKey, Comparable columnKey)
Returns the number of sub-intervals for a given item.

Parameters: rowKey the row key. columnKey the column key.

Returns: The sub-interval count.

See Also: SlidingGanttCategoryDataset

getSubIntervalCount

public int getSubIntervalCount(int row, int column)
Returns the number of sub-intervals for a given item.

Parameters: row the row index (zero-based). column the column index (zero-based).

Returns: The sub-interval count.

See Also: SlidingGanttCategoryDataset

getUnderlyingDataset

public GanttCategoryDataset getUnderlyingDataset()
Returns the underlying dataset that was supplied to the constructor.

Returns: The underlying dataset (never null).

getValue

public Number getValue(Comparable rowKey, Comparable columnKey)
Returns the value for a pair of keys.

Parameters: rowKey the row key (null not permitted). columnKey the column key (null not permitted).

Returns: The value (possibly null).

Throws: UnknownKeyException if either key is not defined in the dataset.

getValue

public Number getValue(int row, int column)
Returns a value from the table.

Parameters: row the row index (zero-based). column the column index (zero-based).

Returns: The value (possibly null).

setFirstCategoryIndex

public 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.

Parameters: first the index.

See Also: getFirstCategoryIndex

setMaximumCategoryCount

public void setMaximumCategoryCount(int max)
Sets the maximum category count and sends a DatasetChangeEvent to all registered listeners.

Parameters: max the maximum.

See Also: getMaximumCategoryCount