Package org.jdesktop.swingx.search
Class AbstractSearchable.SearchResult
java.lang.Object
org.jdesktop.swingx.search.AbstractSearchable.SearchResult
- Enclosing class:
- AbstractSearchable
A convenience class to hold search state.
NOTE: this is still in-flow, probably will take more responsibility/ or even change altogether on further factoring
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates an empty SearchResult.SearchResult
(Pattern ex, MatchResult result, int row, int column) Instantiates a SearchResult with the given state. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the column index of the match position.int
Returns the row index of the match position.Returns the MatchResult representing the current match.Returns the Pattern used for matching.getRegEx()
Returns the regex of the Pattern used for matching.void
reset()
Resets all internal state to no-match.void
Resets the column to OFF.void
updateFrom
(AbstractSearchable.SearchResult searchResult) Sets internal state to the same as the given SearchResult.
-
Constructor Details
-
SearchResult
public SearchResult()Instantiates an empty SearchResult. -
SearchResult
Instantiates a SearchResult with the given state.- Parameters:
ex
- the Pattern used for matchingresult
- the current MatchResultrow
- the row index of the current matchcolumn
- the column index of the current match
-
-
Method Details
-
updateFrom
Sets internal state to the same as the given SearchResult. Resets internals if the param is null.- Parameters:
searchResult
- the SearchResult to copy internal state from.
-
getRegEx
Returns the regex of the Pattern used for matching.- Returns:
- the regex of the Pattern used for matching.
-
reset
public void reset()Resets all internal state to no-match. -
resetFoundColumn
public void resetFoundColumn()Resets the column to OFF. -
getFoundColumn
public int getFoundColumn()Returns the column index of the match position.- Returns:
- the column index of the match position.
-
getFoundRow
public int getFoundRow()Returns the row index of the match position.- Returns:
- the row index of the match position.
-
getMatchResult
Returns the MatchResult representing the current match.- Returns:
- the MatchResult representing the current match.
-
getPattern
Returns the Pattern used for matching.- Returns:
- the Pattern used for the matching.
-