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 TypeMethodDescriptionbooleanintReturns the number of column keys in the data structure.intgetColumnIndex(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.doublegetDoubleValue(int rowIndex, int columnIndex) Returns the data item at the specified position as a double primitive.intReturns the number of row keys in the table.intgetRowIndex(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.voidSets 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 (nullnot permitted).columnKeys- the yKeys (nullnot permitted).
-
-
Method Details
-
getRowKey
Returns the row key corresponding to the specified index.- Specified by:
getRowKeyin 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:
getColumnKeyin 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:
getRowIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>, T> - Parameters:
rowKey- the row key (nullnot permitted).- Returns:
- The index.
-
getColumnIndex
Returns the index corresponding to the specified column key.- Specified by:
getColumnIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>, T> - Parameters:
columnKey- the column key (nullnot permitted).- Returns:
- The index.
-
getRowKeys
Returns a copy of the list of row keys.- Specified by:
getRowKeysin 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:
getColumnKeysin 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:
getRowCountin 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:
getColumnCountin interfaceValues2D<R extends Comparable<R>>- Returns:
- The number of column keys.
-
getValue
Returns a value from one cell in the table.- Specified by:
getValuein interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>, T> - Parameters:
rowKey- the row-key (nullnot permitted).columnKey- the column-key (nullnot permitted).- Returns:
- The value (possibly
null).
-
getValue
Returns the value from one cell in the table.- Specified by:
getValuein 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:
getDoubleValuein 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 (nullpermitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).
-
equals
-