Interface Matrix

All Known Implementing Classes:
DynamicMatrix, SimpleMatrix

public interface Matrix
Interface that defines a matrix object, with methods that allow to obtain and set a specific object element of the matrix and those that returns the dimensions
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int x, int y)
    Returns an element of the Matrix
    int
    Returns the height of the Matrix
    int
    Returns the width of the Matrix
    void
    set(int x, int y, Object o)
    Sets an object in the Matrix
  • Method Details

    • get

      Object get(int x, int y)
      Returns an element of the Matrix
      Parameters:
      x - The horizontal position of the cell from which extract the object
      y - The vertical position of the cell from which extract the object
      Returns:
      The object in the position defined by x and y
    • set

      void set(int x, int y, Object o)
      Sets an object in the Matrix
      Parameters:
      x - The horizontal position of the cell
      y - The vertical position of the cell
      o - The object to set
    • getWidth

      int getWidth()
      Returns the width of the Matrix
      Returns:
      The number of horizontal cells of the Matrix
    • getHeight

      int getHeight()
      Returns the height of the Matrix
      Returns:
      The number of vertical cells of the Matrix