Class MutableIntGrid<A,​B>

  • Type Parameters:
    A - The row label type
    B - 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 0
      MutableIntGrid​(int nullValue)
      Constructs a new empty MutableIntGrid with a specified null value
    • Method Summary

      Modifier and Type Method Description
      void add​(A a, B b, int value)
      Adds a value to the item in row a column b
      void divide​(A a, B b, int value)
      Divides (Integer division) the item in row a column b by a specified value
      void modulo​(A a, B b, int value)
      Gives the remainder the item in row a column b when divided by a specified value
      void multiply​(A a, B b, int value)
      Multiplies the item in row a column b by a specified value
      void subtract​(A a, B b, int value)
      Subtracts a value from the item in row a column b
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MutableIntGrid

        public MutableIntGrid()
        Constructs a new empty MutableIntGrid Null value is set to 0
      • MutableIntGrid

        public MutableIntGrid​(int nullValue)
        Constructs a new empty MutableIntGrid with a specified null value
        Parameters:
        nullValue - the default value of undefined items
    • Method Detail

      • add

        public void add​(A a,
                        B b,
                        int value)
        Adds a value to the item in row a column b
        Parameters:
        a - the row to be modified
        b - the column to be modified
        value - 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 row a column b
        Parameters:
        a - the row to be modified
        b - the column to be modified
        value - the value to be subtracted from the specified item
      • multiply

        public void multiply​(A a,
                             B b,
                             int value)
        Multiplies the item in row a column b by a specified value
        Parameters:
        a - the row to be modified
        b - the column to be modified
        value - the value to multiply the specified item by
      • divide

        public void divide​(A a,
                           B b,
                           int value)
        Divides (Integer division) the item in row a column b by a specified value
        Parameters:
        a - the row to be modified
        b - the column to be modified
        value - the value to divide the specified item by
      • modulo

        public void modulo​(A a,
                           B b,
                           int value)
        Gives the remainder the item in row a column b when divided by a specified value
        Parameters:
        a - the row to be modified
        b - the column to be modified
        value - the value to divide the specified item by