Package io.keikai.range.impl
Class FindReplaceHelper
java.lang.Object
io.keikai.range.impl.FindReplaceHelper
Helper class for find and replace operations on a spreadsheet.
Implements cell iteration, text extraction, and pattern matching
according to the options specified in FindOptions.
- Since:
- 7.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind(SSheet sheet, String searchText, FindOptions options, int startRow, int startCol) Finds the next cell matching the search text, starting after the given position.findAll(SSheet sheet, String searchText, FindOptions options) Finds all cells matching the search text in the given sheet.intreplace(SSheet sheet, String searchText, String replacement, FindOptions options) Replaces all occurrences of the search text with the replacement in the given sheet.
-
Constructor Details
-
FindReplaceHelper
public FindReplaceHelper()
-
-
Method Details
-
find
public CellRegion find(SSheet sheet, String searchText, FindOptions options, int startRow, int startCol) Finds the next cell matching the search text, starting after the given position.- Parameters:
sheet- the sheet to search insearchText- the text to findoptions- the find optionsstartRow- the row to start searching from (inclusive)startCol- the column to start searching from (inclusive, search starts at next cell)- Returns:
- the matching CellRegion, or null if not found
-
findAll
Finds all cells matching the search text in the given sheet.- Parameters:
sheet- the sheet to search insearchText- the text to findoptions- the find options- Returns:
- a list of matching CellRegion objects (never null)
-
replace
Replaces all occurrences of the search text with the replacement in the given sheet.- Parameters:
sheet- the sheet to search insearchText- the text to findreplacement- the replacement textoptions- the find options- Returns:
- the number of replacements made
-