Interface CellManager

All Known Implementing Classes:
CellGrid

public interface CellManager
The CellManager interface defines the operations that any class must implement to manage Cell objects. This includes creating, clustering, and performing global operations on these cells.

Implementations of this interface are expected to handle different types of clusters such as letter clusters and symbol clusters, and provide functionalities for text-based operations like removing specific dud strings.

Author:
Kheagen Haskins
  • Method Details

    • getCells

      Cell[] getCells()
      Retrieves an array of all Cell objects managed by this CellManager.
      Returns:
      an array of Cell objects.
    • getCells2D

      Cell[][] getCells2D()
      Returns the 2D arrangement of Cells.
      Returns:
      a 2D array of Cell objects.
    • getCell

      Cell getCell(int index)
      Retrieves a Cell at the specified index.
      Parameters:
      index - the index of the cell to retrieve.
      Returns:
      the Cell at the specified index.
      Throws:
      IndexOutOfBoundsException - if the index is out of range.
    • getCellAt

      Cell getCellAt(int row, int col)
      Returns the Cell located at the specified row and column in the grid.

      This method retrieves a specific Cell based on its position in the grid. If the provided row or column index is out of bounds, an IllegalArgumentException is thrown.

      Parameters:
      row - The row index of the cell to retrieve.
      col - The column index of the cell to retrieve.
      Returns:
      The Cell located at the specified row and column.
      Throws:
      IllegalArgumentException - If the row or column index is out of bounds.
    • getLetterClusters

      List<CellCluster> getLetterClusters()
      Retrieves a list of CellCluster objects that represent clusters of letter cells.
      Returns:
      a list of letter CellCluster objects.
    • getSymbolClusters

      List<CellCluster> getSymbolClusters()
      Retrieves a list of CellCluster objects that represent clusters of symbol cells.
      Returns:
      a list of symbol CellCluster objects.
    • getWords

      String[] getWords()
      Retrieves an array of words formed by the managed cells.
      Returns:
      an array of strings representing the words formed.
    • removeDud

      String removeDud(String dudText)
      Removes a specified dud text from the managed cells.
      Parameters:
      dudText - the text to be removed.
      Returns:
      a string representing the text after the dud has been removed.