org.jfree.data.xy

Class NormalizedMatrixSeries

Implemented Interfaces:
Cloneable, Serializable

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 using getItem 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.

Field Summary

static double
DEFAULT_SCALE_FACTOR
The default scale factor.

Fields inherited from class org.jfree.data.xy.MatrixSeries

data

Constructor Summary

NormalizedMatrixSeries(String name, int rows, int columns)
Constructor for NormalizedMatrixSeries.

Method Summary

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)
void
zeroAll()

Methods inherited from class org.jfree.data.xy.MatrixSeries

equals, get, getColumnsCount, getItem, getItemColumn, getItemCount, getItemRow, getRowCount, update, zeroAll

Methods inherited from class org.jfree.data.general.Series

addChangeListener, addPropertyChangeListener, clone, equals, firePropertyChange, fireSeriesChanged, getDescription, getKey, getNotify, hashCode, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setKey, setNotify

Field Details

DEFAULT_SCALE_FACTOR

public static final double DEFAULT_SCALE_FACTOR
The default scale factor.
Field Value:
1.0

Constructor Details

NormalizedMatrixSeries

public NormalizedMatrixSeries(String name,
                              int rows,
                              int columns)
Constructor for NormalizedMatrixSeries.
Parameters:
name - the series name.
rows - the number of rows.
columns - the number of columns.

Method Details

getItem

public Number getItem(int itemIndex)
Returns an item.
Overrides:
getItem in interface MatrixSeries
Parameters:
itemIndex - the index.
Returns:
The value.

getScaleFactor

public double getScaleFactor()
Returns the factor that multiplies each item in this series when observed using getItem mehtod.
Returns:
The factor

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.

update

public void update(int i,
                   int j,
                   double mij)
Overrides:
update in interface MatrixSeries

zeroAll

public void zeroAll()
Overrides:
zeroAll in interface MatrixSeries