- 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 Summary
Modifier and TypeMethodDescriptiongetCell(int index) Retrieves aCellat the specified index.getCellAt(int row, int col) Returns theCelllocated at the specified row and column in the grid.Cell[]getCells()Retrieves an array of allCellobjects managed by thisCellManager.Cell[][]Returns the 2D arrangement of Cells.Retrieves a list ofCellClusterobjects that represent clusters of letter cells.Retrieves a list ofCellClusterobjects that represent clusters of symbol cells.String[]getWords()Retrieves an array of words formed by the managed cells.Removes a specified dud text from the managed cells.
-
Method Details
-
getCells
Cell[] getCells()Retrieves an array of allCellobjects managed by thisCellManager.- Returns:
- an array of
Cellobjects.
-
getCells2D
Cell[][] getCells2D()Returns the 2D arrangement of Cells.- Returns:
- a 2D array of
Cellobjects.
-
getCell
Retrieves aCellat the specified index.- Parameters:
index- the index of the cell to retrieve.- Returns:
- the
Cellat the specified index. - Throws:
IndexOutOfBoundsException- if the index is out of range.
-
getCellAt
Returns theCelllocated at the specified row and column in the grid.This method retrieves a specific
Cellbased on its position in the grid. If the provided row or column index is out of bounds, anIllegalArgumentExceptionis thrown.- Parameters:
row- The row index of the cell to retrieve.col- The column index of the cell to retrieve.- Returns:
- The
Celllocated 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 ofCellClusterobjects that represent clusters of letter cells.- Returns:
- a list of letter
CellClusterobjects.
-
getSymbolClusters
List<CellCluster> getSymbolClusters()Retrieves a list ofCellClusterobjects that represent clusters of symbol cells.- Returns:
- a list of symbol
CellClusterobjects.
-
getWords
String[] getWords()Retrieves an array of words formed by the managed cells.- Returns:
- an array of strings representing the words formed.
-
removeDud
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.
-