Package org.jfree.data
Class MatrixSeries
java.lang.Object
org.jfree.data.Series
org.jfree.data.MatrixSeries
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
NormalizedMatrixSeries
public class MatrixSeries extends Series implements Serializable
Represents a dense matrix M[i,j] where each Mij item of the matrix has a
value (default is 0).
- Author:
- Barak Naveh
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description MatrixSeries(String name, int rows, int columns)
Constructs a new matrix series. -
Method Summary
Modifier and Type Method Description boolean
equals(Object obj)
Tests this object instance for equality with an arbitrary object.double
get(int i, int j)
Returns the value of the specified item in this matrix series.int
getColumnsCount()
Returns the number of columns in this matrix series.Number
getItem(int itemIndex)
Return the matrix item at the specified index.int
getItemColumn(int itemIndex)
Returns the column of the specified item.int
getItemCount()
Returns the number of items in the series.int
getItemRow(int itemIndex)
Returns the row of the specified item.int
getRowCount()
Returns the number of rows in this matrix series.void
update(int i, int j, double mij)
Updates the value of the specified item in this matrix series.void
zeroAll()
Sets all matrix values to zero and sends aSeriesChangeEvent
to all registered listeners.Methods inherited from class org.jfree.data.Series
addChangeListener, addPropertyChangeListener, clone, fireSeriesChanged, getDescription, getName, getNotify, hashCode, removeChangeListener, removePropertyChangeListener, setDescription, setName, setNotify
-
Constructor Details
-
MatrixSeries
Constructs a new matrix series.By default, all matrix items are initialzed to 0.
- Parameters:
name
- series name (null
not permitted).rows
- the number of rows.columns
- the number of columns.
-
-
Method Details
-
getColumnsCount
public int getColumnsCount()Returns the number of columns in this matrix series.- Returns:
- the number of columns in this matrix series.
-
getItem
Return the matrix item at the specified index.- Parameters:
itemIndex
- item index.- Returns:
- matrix item at the specified index.
-
getItemColumn
public int getItemColumn(int itemIndex)Returns the column of the specified item.- Parameters:
itemIndex
- the index of the item.- Returns:
- the column of the specified item.
-
getItemCount
public int getItemCount()Returns the number of items in the series.- Returns:
- The item count.
-
getItemRow
public int getItemRow(int itemIndex)Returns the row of the specified item.- Parameters:
itemIndex
- the index of the item.- Returns:
- the row of the specified item.
-
getRowCount
public int getRowCount()Returns the number of rows in this matrix series.- Returns:
- the number of rows in this matrix series.
-
get
public double get(int i, int j)Returns the value of the specified item in this matrix series.- Parameters:
i
- the row of the item.j
- the column of the item.- Returns:
- the value of the specified item in this matrix series.
-
update
public void update(int i, int j, double mij)Updates the value of the specified item in this matrix series.- Parameters:
i
- the row of the item.j
- the column of the item.mij
- the new value for the item.
-
zeroAll
public void zeroAll()Sets all matrix values to zero and sends aSeriesChangeEvent
to all registered listeners. -
equals
Tests this object instance for equality with an arbitrary object.
-