Package org.jfree.data.xy
Class NormalizedMatrixSeries
- java.lang.Object
-
- org.jfree.data.general.Series
-
- org.jfree.data.xy.MatrixSeries
-
- org.jfree.data.xy.NormalizedMatrixSeries
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class NormalizedMatrixSeries extends MatrixSeries
Represents a dense normalized matrix M[i,j] where each Mij item of the matrix has a value (default is 0). When a matrix item is observed usinggetItem()
method, it is normalized, that is, divided by the total sum of all items. It can be also be scaled by setting a scale factor.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_SCALE_FACTOR
The default scale factor.private double
m_scaleFactor
A factor that multiplies each item in this series when observed using getItem method.private double
m_totalSum
The sum of all items in this matrix-
Fields inherited from class org.jfree.data.xy.MatrixSeries
data
-
-
Constructor Summary
Constructors Constructor Description NormalizedMatrixSeries(java.lang.String name, int rows, int columns)
Constructor for NormalizedMatrixSeries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
getItem(int itemIndex)
Returns an item.double
getScaleFactor()
Returns the factor that multiplies each item in this series when observed using getItem mehtod.void
setScaleFactor(double factor)
Sets the factor that multiplies each item in this series when observed using getItem mehtod.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.xy.MatrixSeries
equals, get, getColumnsCount, getItemColumn, getItemCount, getItemRow, getRowCount
-
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
-
DEFAULT_SCALE_FACTOR
public static final double DEFAULT_SCALE_FACTOR
The default scale factor.- See Also:
- Constant Field Values
-
m_scaleFactor
private double m_scaleFactor
A factor that multiplies each item in this series when observed using getItem method.
-
m_totalSum
private double m_totalSum
The sum of all items in this matrix
-
-
Method Detail
-
getItem
public java.lang.Number getItem(int itemIndex)
Returns an item.- Overrides:
getItem
in classMatrixSeries
- Parameters:
itemIndex
- the index.- Returns:
- The value.
- See Also:
MatrixSeries.getItem(int)
-
setScaleFactor
public void setScaleFactor(double factor)
Sets the factor that multiplies each item in this series when observed using getItem mehtod.- Parameters:
factor
- new factor to set.- See Also:
DEFAULT_SCALE_FACTOR
-
getScaleFactor
public double getScaleFactor()
Returns the factor that multiplies each item in this series when observed using getItem mehtod.- Returns:
- The factor
-
update
public void update(int i, int j, double mij)
Updates the value of the specified item in this matrix series.- Overrides:
update
in classMatrixSeries
- Parameters:
i
- the row of the item.j
- the column of the item.mij
- the new value for the item.- See Also:
MatrixSeries.get(int, int)
-
zeroAll
public void zeroAll()
Description copied from class:MatrixSeries
Sets all matrix values to zero and sends aSeriesChangeEvent
to all registered listeners.- Overrides:
zeroAll
in classMatrixSeries
- See Also:
MatrixSeries.zeroAll()
-
-