Package org.jfree.data.xy
Class MatrixSeries
- java.lang.Object
-
- org.jfree.data.general.Series
-
- org.jfree.data.xy.MatrixSeries
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
NormalizedMatrixSeries
public class MatrixSeries extends Series implements java.io.Serializable
Represents a dense matrix M[i,j] where each Mij item of the matrix has a value (default is 0).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double[][]
data
Series matrix valuesprivate static long
serialVersionUID
For serialization.
-
Constructor Summary
Constructors Constructor Description MatrixSeries(java.lang.String name, int rows, int columns)
Constructs a new matrix series.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.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.java.lang.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.general.Series
addChangeListener, addPropertyChangeListener, addVetoableChangeListener, canEqual, clone, firePropertyChange, fireSeriesChanged, fireVetoableChange, getDescription, getKey, getNotify, hashCode, isEmpty, notifyListeners, removeChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setDescription, setKey, setNotify
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
data
protected double[][] data
Series matrix values
-
-
Method Detail
-
getColumnsCount
public int getColumnsCount()
Returns the number of columns in this matrix series.- Returns:
- The number of columns in this matrix series.
-
getItem
public java.lang.Number getItem(int itemIndex)
Return the matrix item at the specified index. Note that this method creates a newdouble
instance every time it is called.- Parameters:
itemIndex
- item index.- Returns:
- The matrix item at the specified index.
- See Also:
get(int, int)
-
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.- Specified by:
getItemCount
in classSeries
- 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.
- See Also:
getItem(int)
,update(int, int, double)
-
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.- See Also:
get(int, int)
-
zeroAll
public void zeroAll()
Sets all matrix values to zero and sends aSeriesChangeEvent
to all registered listeners.
-
-