public class NumberMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable> extends SparseMatrix<RK,CK,V>
Constructor and Description |
---|
NumberMatrix() |
NumberMatrix(int inInitialRowCapacity,
int inInitialColCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
clearCol(CK inColKey) |
void |
clearRow(RK inRowKey) |
V |
getColTotal(CK inColKey) |
V |
getGrandTotal() |
Float |
getOverallPercent(RK inRowKey,
CK inColKey)
Calculates the percentage of the grand total (total of all cell values) represented by the specified cell.
|
Float |
getPercentOfCol(RK inRowKey,
CK inColKey)
Calculates the percentage of the total column value represented by the specified cell.
|
Float |
getPercentOfRow(RK inRowKey,
CK inColKey)
Calculates the percentage of the total row value represented by the specified cell.
|
V |
getRowTotal(RK inRowKey) |
void |
increment(RK inRowKey,
CK inColKey,
V inIncrementSize)
Increments the value in the specified cell by the specified amount.
|
void |
put(RK inRowKey,
CK inColKey,
V inValue) |
void |
putCol(CK inColKey,
Map<RK,V> inRowMap) |
void |
putRow(RK inRowKey,
Map<CK,V> inColMap) |
V |
remove(RK inRowKey,
CK inColKey) |
clone, colKeySet, getCol, getRow, rowKeySet
addCol, addRow, changeColKey, changeRowKey, containsCol, containsRow, get, getCellWithSmallestValue, getNonIdentityCellWithSmallestValue, removeCol, removeCols, removeRow, size, toString, toString, trimToSize
public NumberMatrix()
public NumberMatrix(int inInitialRowCapacity, int inInitialColCapacity)
public void increment(RK inRowKey, CK inColKey, V inIncrementSize)
inRowKey
- the key of the selected rowinColKey
- the key of the selected columninIncrementSize
- the amount by which to increment the valuepublic V getColTotal(CK inColKey)
public V getRowTotal(RK inRowKey)
public V getGrandTotal()
public Float getPercentOfCol(RK inRowKey, CK inColKey)
inRowKey
- the key of the selected rowinColKey
- the key of the selected columnpublic Float getPercentOfRow(RK inRowKey, CK inColKey)
inRowKey
- the key of the selected rowinColKey
- the key of the selected columnpublic Float getOverallPercent(RK inRowKey, CK inColKey)
inRowKey
- the key of the selected rowinColKey
- the key of the selected columnpublic void put(RK inRowKey, CK inColKey, V inValue)
put
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>
public void putRow(RK inRowKey, Map<CK,V> inColMap)
putRow
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>
public void putCol(CK inColKey, Map<RK,V> inRowMap)
putCol
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>
public V remove(RK inRowKey, CK inColKey)
remove
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>
public void clearRow(RK inRowKey)
clearRow
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>
public void clearCol(CK inColKey)
clearCol
in class AbstractSparseMatrix<RK extends Comparable,CK extends Comparable,V extends Number & Comparable>