Class FindOptions
java.lang.Object
com.independentsoft.office.spreadsheet.FindOptions
Specifies how the find and replace methods of the
Workbook match text.-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of theFindOptionsclass.FindOptions(int scope)Initializes a new instance of theFindOptionsclass with the specified scope. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a newFindOptionsthat is a copy of the current object.intGets the maximum number of results.intgetScope()Gets the parts of the document to search.booleanGets a value that indicates whether the search is case sensitive.booleanGets a value that indicates whether replaced content inherits the formatting of the replaced content.booleanGets a value that indicates whether the search text is a regular expression.booleanGets a value that indicates whether the search text contains wildcards (*, ? and [ ]).booleanGets a value that indicates whether only whole words are matched.voidsetMatchCase(boolean matchCase)Sets a value that indicates whether the search is case sensitive.voidsetMaxResults(int maxResults)Sets the maximum number of results.voidsetPreserveFormatting(boolean preserveFormatting)Sets a value that indicates whether replaced content inherits the formatting of the replaced content.voidsetScope(int scope)Sets the parts of the document to search.voidsetUseRegularExpressions(boolean useRegularExpressions)Sets a value that indicates whether the search text is a regular expression.voidsetUseWildcards(boolean useWildcards)Sets a value that indicates whether the search text contains wildcards (*, ? and [ ]).voidsetWholeWord(boolean wholeWord)Sets a value that indicates whether only whole words are matched.
-
Constructor Details
-
FindOptions
public FindOptions()Initializes a new instance of theFindOptionsclass. -
FindOptions
public FindOptions(int scope)Initializes a new instance of theFindOptionsclass with the specified scope.- Parameters:
scope- the parts of the document to search
-
-
Method Details
-
clone
Creates a newFindOptionsthat is a copy of the current object.- Overrides:
clonein classObject- Returns:
- a new
FindOptionsthat is a copy of the current object
-
isMatchCase
public boolean isMatchCase()Gets a value that indicates whether the search is case sensitive. The default value is true.- Returns:
- true, if the search is case sensitive
-
setMatchCase
public void setMatchCase(boolean matchCase)Sets a value that indicates whether the search is case sensitive. The default value is true.- Parameters:
matchCase- true, if the search is case sensitive
-
isWholeWord
public boolean isWholeWord()Gets a value that indicates whether only whole words are matched. The default value is false.- Returns:
- true, if only whole words are matched
-
setWholeWord
public void setWholeWord(boolean wholeWord)Sets a value that indicates whether only whole words are matched. The default value is false.- Parameters:
wholeWord- true, if only whole words are matched
-
isUseRegularExpressions
public boolean isUseRegularExpressions()Gets a value that indicates whether the search text is a regular expression. The default value is false. Group references such as $1 are substituted in the replacement text.- Returns:
- true, if the search text is a regular expression
-
setUseRegularExpressions
public void setUseRegularExpressions(boolean useRegularExpressions)Sets a value that indicates whether the search text is a regular expression. The default value is false. Group references such as $1 are substituted in the replacement text.- Parameters:
useRegularExpressions- true, if the search text is a regular expression
-
isUseWildcards
public boolean isUseWildcards()Gets a value that indicates whether the search text contains wildcards (*, ? and [ ]). The default value is false.- Returns:
- true, if the search text contains wildcards
-
setUseWildcards
public void setUseWildcards(boolean useWildcards)Sets a value that indicates whether the search text contains wildcards (*, ? and [ ]). The default value is false.- Parameters:
useWildcards- true, if the search text contains wildcards
-
isPreserveFormatting
public boolean isPreserveFormatting()Gets a value that indicates whether replaced content inherits the formatting of the replaced content. The default value is true.- Returns:
- true, if replaced content inherits the formatting of the replaced content
-
setPreserveFormatting
public void setPreserveFormatting(boolean preserveFormatting)Sets a value that indicates whether replaced content inherits the formatting of the replaced content. The default value is true.- Parameters:
preserveFormatting- true, if replaced content inherits the formatting of the replaced content
-
getScope
public int getScope()Gets the parts of the document to search. The default value isSearchScope.ALL.- Returns:
- the parts of the document to search
-
setScope
public void setScope(int scope)Sets the parts of the document to search. The default value isSearchScope.ALL.- Parameters:
scope- the parts of the document to search
-
getMaxResults
public int getMaxResults()Gets the maximum number of results. Zero, the default value, means no limit.- Returns:
- the maximum number of results
-
setMaxResults
public void setMaxResults(int maxResults)Sets the maximum number of results. Zero, the default value, means no limit.- Parameters:
maxResults- the maximum number of results
-