- 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 aCell
at the specified index.getCellAt
(int row, int col) Returns theCell
located at the specified row and column in the grid.Cell[]
getCells()
Retrieves an array of allCell
objects managed by thisCellManager
.Cell[][]
Returns the 2D arrangement of Cells.Retrieves a list ofCellCluster
objects that represent clusters of letter cells.Retrieves a list ofCellCluster
objects 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 allCell
objects managed by thisCellManager
.- Returns:
- an array of
Cell
objects.
-
getCells2D
Cell[][] getCells2D()Returns the 2D arrangement of Cells.- Returns:
- a 2D array of
Cell
objects.
-
getCell
Retrieves aCell
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
Returns theCell
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, anIllegalArgumentException
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 ofCellCluster
objects that represent clusters of letter cells.- Returns:
- a list of letter
CellCluster
objects.
-
getSymbolClusters
List<CellCluster> getSymbolClusters()Retrieves a list ofCellCluster
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
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.
-