Module org.jfree.chart3d
Package org.jfree.chart3d.data
Class DefaultKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>,T>
java.lang.Object
org.jfree.chart3d.data.DefaultKeyedValues2D<R,C,T>
- Type Parameters:
R
- the row key typeC
- the column key typeT
- the value type.
- All Implemented Interfaces:
Serializable
,KeyedValues2D<R,
,C, T> Values2D<T>
public final class DefaultKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>,T>
extends Object
implements KeyedValues2D<R,C,T>, Serializable
A two dimensional grid of (typically numerical) data that is accessible by
row and column keys.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new (empty) instance.DefaultKeyedValues2D
(List<R> rowKeys, List<C> columnKeys) Creates a new instance with the specified keys and all data values initialized tonull
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns the number of column keys in the data structure.int
getColumnIndex
(C columnKey) Returns the index corresponding to the specified column key.getColumnKey
(int columnIndex) Returns the column key corresponding to the specified index.Returns a copy of the list of column keys.double
getDoubleValue
(int rowIndex, int columnIndex) Returns the data item at the specified position as a double primitive.int
Returns the number of row keys in the table.int
getRowIndex
(R rowKey) Returns the index corresponding to the specified row key.getRowKey
(int rowIndex) Returns the row key corresponding to the specified index.Returns a copy of the list of row keys.getValue
(int rowIndex, int columnIndex) Returns the value from one cell in the table.Returns a value from one cell in the table.void
Sets a value for one cell in the table.
-
Constructor Details
-
DefaultKeyedValues2D
public DefaultKeyedValues2D()Creates a new (empty) instance. -
DefaultKeyedValues2D
Creates a new instance with the specified keys and all data values initialized tonull
.- Parameters:
rowKeys
- the xKeys (null
not permitted).columnKeys
- the yKeys (null
not permitted).
-
-
Method Details
-
getRowKey
Returns the row key corresponding to the specified index.- Specified by:
getRowKey
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Parameters:
rowIndex
- the row index.- Returns:
- The key.
-
getColumnKey
Returns the column key corresponding to the specified index.- Specified by:
getColumnKey
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Parameters:
columnIndex
- the column index.- Returns:
- The key.
-
getRowIndex
Returns the index corresponding to the specified row key.- Specified by:
getRowIndex
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Parameters:
rowKey
- the row key (null
not permitted).- Returns:
- The index.
-
getColumnIndex
Returns the index corresponding to the specified column key.- Specified by:
getColumnIndex
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Parameters:
columnKey
- the column key (null
not permitted).- Returns:
- The index.
-
getRowKeys
Returns a copy of the list of row keys.- Specified by:
getRowKeys
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Returns:
- A copy of the list of row keys (never
null
).
-
getColumnKeys
Returns a copy of the list of column keys.- Specified by:
getColumnKeys
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Returns:
- A copy of the list of column keys (never
null
).
-
getRowCount
Returns the number of row keys in the table.- Specified by:
getRowCount
in interfaceValues2D<R extends Comparable<R>>
- Returns:
- The number of row keys in the table.
-
getColumnCount
Returns the number of column keys in the data structure.- Specified by:
getColumnCount
in interfaceValues2D<R extends Comparable<R>>
- Returns:
- The number of column keys.
-
getValue
Returns a value from one cell in the table.- Specified by:
getValue
in interfaceKeyedValues2D<R extends Comparable<R>,
C extends Comparable<C>, T> - Parameters:
rowKey
- the row-key (null
not permitted).columnKey
- the column-key (null
not permitted).- Returns:
- The value (possibly
null
).
-
getValue
Returns the value from one cell in the table.- Specified by:
getValue
in interfaceValues2D<R extends Comparable<R>>
- Parameters:
rowIndex
- the row index.columnIndex
- the column index.- Returns:
- The value (possibly
null
).
-
getDoubleValue
Returns the data item at the specified position as a double primitive. Where thegetValue(int, int)
method returnsnull
, this method returnsDouble.NaN
.- Specified by:
getDoubleValue
in interfaceValues2D<R extends Comparable<R>>
- Parameters:
rowIndex
- the row index.columnIndex
- the column index.- Returns:
- The data value.
-
setValue
Sets a value for one cell in the table.- Parameters:
n
- the value (null
permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).
-
equals
-