Package uk.co.rafilevy.utils.ValueGrid
Class MutableIntGrid<A,B>
- java.lang.Object
-
- uk.co.rafilevy.utils.ValueGrid.ValueGrid<A,B,java.lang.Integer>
-
- uk.co.rafilevy.utils.ValueGrid.MutableIntGrid<A,B>
-
- Type Parameters:
A- The row label typeB- The column label type
public class MutableIntGrid<A,B> extends ValueGrid<A,B,java.lang.Integer>
MutableIntGrid is a ValueGrid containing integer values with some methods aiding mutation of values in the grid
-
-
Constructor Summary
Constructors Constructor Description MutableIntGrid()Constructs a new empty MutableIntGrid Null value is set to 0MutableIntGrid(int nullValue)Constructs a new empty MutableIntGrid with a specified null value
-
Method Summary
Modifier and Type Method Description voidadd(A a, B b, int value)Adds a value to the item in rowacolumnbvoiddivide(A a, B b, int value)Divides (Integer division) the item in rowacolumnbby a specified valuevoidmodulo(A a, B b, int value)Gives the remainder the item in rowacolumnbwhen divided by a specified valuevoidmultiply(A a, B b, int value)Multiplies the item in rowacolumnbby a specified valuevoidsubtract(A a, B b, int value)Subtracts a value from the item in rowacolumnb-
Methods inherited from class uk.co.rafilevy.utils.ValueGrid.ValueGrid
containsColumn, containsRow, get, getColumn, getColumns, getRow, getRows, isEmpty, set, size, toString
-
-
-
-
Method Detail
-
add
public void add(A a, B b, int value)
Adds a value to the item in rowacolumnb- Parameters:
a- the row to be modifiedb- the column to be modifiedvalue- the value to be added to the specified item
-
subtract
public void subtract(A a, B b, int value)
Subtracts a value from the item in rowacolumnb- Parameters:
a- the row to be modifiedb- the column to be modifiedvalue- the value to be subtracted from the specified item
-
multiply
public void multiply(A a, B b, int value)
Multiplies the item in rowacolumnbby a specified value- Parameters:
a- the row to be modifiedb- the column to be modifiedvalue- the value to multiply the specified item by
-
divide
public void divide(A a, B b, int value)
Divides (Integer division) the item in rowacolumnbby a specified value- Parameters:
a- the row to be modifiedb- the column to be modifiedvalue- the value to divide the specified item by
-
-