hudson.plugins.plot
Class PlotCategoryDataset

java.lang.Object
  extended by org.jfree.data.general.AbstractDataset
      extended by hudson.plugins.plot.PlotCategoryDataset
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, org.jfree.data.category.CategoryDataset, org.jfree.data.general.Dataset, org.jfree.data.KeyedValues2D, org.jfree.data.Values2D

public class PlotCategoryDataset
extends org.jfree.data.general.AbstractDataset
implements org.jfree.data.category.CategoryDataset

A CategoryDataset implementation that stores numeric data points and corresponding URLs. This data structure is basically a table with row and column names (keys).

Author:
Nigel Daley
See Also:
Serialized Form

Constructor Summary
PlotCategoryDataset()
          Creates a new empty instance.
 
Method Summary
 void clipDataset(int maxColumns)
          Truncates the dataset to the last maxColumns columns.
 int getColumnCount()
           
 int getColumnIndex(java.lang.Comparable key)
           
 java.lang.Comparable getColumnKey(int column)
           
 java.util.List getColumnKeys()
           
 int getRowCount()
           
 int getRowIndex(java.lang.Comparable key)
           
 java.lang.Comparable getRowKey(int row)
           
 java.util.List getRowKeys()
           
 java.lang.String getUrl(int row, int column)
          Returns the URL at the given row and column.
 java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Gets the value with the given row and column keys.
 java.lang.Number getValue(int row, int column)
           
 void setValue(java.lang.Number value, java.lang.String url, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Adds or updates a value.
 
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

PlotCategoryDataset

public PlotCategoryDataset()
Creates a new empty instance.

Method Detail

clipDataset

public void clipDataset(int maxColumns)
Truncates the dataset to the last maxColumns columns.

Parameters:
maxColumns - the maximum number columns that will appear to be in the dataset.

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface org.jfree.data.Values2D

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface org.jfree.data.Values2D

getValue

public java.lang.Number getValue(int row,
                                 int column)
Specified by:
getValue in interface org.jfree.data.Values2D

getRowKey

public java.lang.Comparable getRowKey(int row)
Specified by:
getRowKey in interface org.jfree.data.KeyedValues2D

getRowIndex

public int getRowIndex(java.lang.Comparable key)
Specified by:
getRowIndex in interface org.jfree.data.KeyedValues2D

getRowKeys

public java.util.List getRowKeys()
Specified by:
getRowKeys in interface org.jfree.data.KeyedValues2D

getColumnKey

public java.lang.Comparable getColumnKey(int column)
Specified by:
getColumnKey in interface org.jfree.data.KeyedValues2D

getColumnIndex

public int getColumnIndex(java.lang.Comparable key)
Specified by:
getColumnIndex in interface org.jfree.data.KeyedValues2D

getColumnKeys

public java.util.List getColumnKeys()
Specified by:
getColumnKeys in interface org.jfree.data.KeyedValues2D

getValue

public java.lang.Number getValue(java.lang.Comparable rowKey,
                                 java.lang.Comparable columnKey)
Gets the value with the given row and column keys.

Specified by:
getValue in interface org.jfree.data.KeyedValues2D
Parameters:
rowKey - the row key
columnKey - the column key
Returns:
the value with the given row and column keys

getUrl

public java.lang.String getUrl(int row,
                               int column)
Returns the URL at the given row and column.

Parameters:
row - the row index
column - the column index
Returns:
the URL

setValue

public void setValue(java.lang.Number value,
                     java.lang.String url,
                     java.lang.Comparable rowKey,
                     java.lang.Comparable columnKey)
Adds or updates a value.

Parameters:
value - the value to add
url - the URL to add and associate with the value
rowKey - the row key
columnKey - the column key


Copyright © 2007. All Rights Reserved.