/** * Checks if the given Pattern should be considered as the same as * in a previous search. * <p> * This implementation compares the patterns' regex. * * @param pattern <code>Pattern</code> that we will compare with last request * @return if provided <code>Pattern</code> is the same as the stored from * the previous search attempt */ protected boolean isEqualPattern(Pattern pattern) { return pattern.pattern().equals(lastSearchResult.getRegEx()); }
/** * Sets internal state to the same as the given SearchResult. Resets internals * if the param is null. * * @param searchResult the SearchResult to copy internal state from. */ public void updateFrom(SearchResult searchResult) { if (searchResult == null) { reset(); return; } foundRow = searchResult.foundRow; foundColumn = searchResult.foundColumn; matchResult = searchResult.matchResult; pattern = searchResult.pattern; }
/** * Sets internal state to the same as the given SearchResult. Resets internals * if the param is null. * * @param searchResult the SearchResult to copy internal state from. */ public void updateFrom(SearchResult searchResult) { if (searchResult == null) { reset(); return; } foundRow = searchResult.foundRow; foundColumn = searchResult.foundColumn; matchResult = searchResult.matchResult; pattern = searchResult.pattern; }
/** * Sets internal state to the same as the given SearchResult. Resets internals * if the param is null. * * @param searchResult the SearchResult to copy internal state from. */ public void updateFrom(SearchResult searchResult) { if (searchResult == null) { reset(); return; } foundRow = searchResult.foundRow; foundColumn = searchResult.foundColumn; matchResult = searchResult.matchResult; pattern = searchResult.pattern; }
/** * Sets internal state to the same as the given SearchResult. Resets internals * if the param is null. * * @param searchResult the SearchResult to copy internal state from. */ public void updateFrom(SearchResult searchResult) { if (searchResult == null) { reset(); return; } foundRow = searchResult.foundRow; foundColumn = searchResult.foundColumn; matchResult = searchResult.matchResult; pattern = searchResult.pattern; }
/** * Checks if the given Pattern should be considered as the same as * in a previous search. * <p> * This implementation compares the patterns' regex. * * @param pattern <code>Pattern</code> that we will compare with last request * @return if provided <code>Pattern</code> is the same as the stored from * the previous search attempt */ protected boolean isEqualPattern(Pattern pattern) { return pattern.pattern().equals(lastSearchResult.getRegEx()); }
/** * Sets internal state to the same as the given SearchResult. Resets internals * if the param is null. * * @param searchResult the SearchResult to copy internal state from. */ public void updateFrom(SearchResult searchResult) { if (searchResult == null) { reset(); return; } foundRow = searchResult.foundRow; foundColumn = searchResult.foundColumn; matchResult = searchResult.matchResult; pattern = searchResult.pattern; }
/** * Checks if the given Pattern should be considered as the same as * in a previous search. * <p> * This implementation compares the patterns' regex. * * @param pattern <code>Pattern</code> that we will compare with last request * @return if provided <code>Pattern</code> is the same as the stored from * the previous search attempt */ protected boolean isEqualPattern(Pattern pattern) { return pattern.pattern().equals(lastSearchResult.getRegEx()); }
/** * Checks if the given Pattern should be considered as the same as * in a previous search. * <p> * This implementation compares the patterns' regex. * * @param pattern <code>Pattern</code> that we will compare with last request * @return if provided <code>Pattern</code> is the same as the stored from * the previous search attempt */ protected boolean isEqualPattern(Pattern pattern) { return pattern.pattern().equals(lastSearchResult.getRegEx()); }
/** * Factory method to create a SearchResult from the given parameters. * * @param matcher the matcher after a successful find. Must not be null. * @param row the found index * @param column the found column * @return newly created <code>SearchResult</code> */ protected SearchResult createSearchResult(Matcher matcher, int row, int column) { return new SearchResult(matcher.pattern(), matcher.toMatchResult(), row, column); }
/** * Instantiates an empty SearchResult. */ public SearchResult() { reset(); }
/** * Updates inner searchable state based on provided search result * * @param searchResult <code>SearchResult</code> that represents the new state * of this <code>AbstractSearchable</code> */ protected void updateState(SearchResult searchResult) { lastSearchResult.updateFrom(searchResult); }
/** * Factory method to create a SearchResult from the given parameters. * * @param matcher the matcher after a successful find. Must not be null. * @param row the found index * @param column the found column * @return newly created <code>SearchResult</code> */ protected SearchResult createSearchResult(Matcher matcher, int row, int column) { return new SearchResult(matcher.pattern(), matcher.toMatchResult(), row, column); }
/** * * @param result * @return {@code true} if the {@code result} contains a match; * {@code false} otherwise */ private boolean hasMatch(SearchResult result) { boolean noMatch = (result.getFoundRow() < 0) || (result.getFoundColumn() < 0); return !noMatch; }
/** * * @param result * @return {@code true} if the {@code result} contains a match; * {@code false} otherwise */ private boolean hasMatch(SearchResult result) { boolean noMatch = (result.getFoundRow() < 0) || (result.getFoundColumn() < 0); return !noMatch; }
/** * * @param result * @return {@code true} if the {@code result} contains a match; * {@code false} otherwise */ private boolean hasMatch(SearchResult result) { boolean noMatch = (result.getFoundRow() < 0) || (result.getFoundColumn() < 0); return !noMatch; }
/** * Instantiates an empty SearchResult. */ public SearchResult() { reset(); }
/** * Factory method to create a SearchResult from the given parameters. * * @param matcher the matcher after a successful find. Must not be null. * @param row the found index * @param column the found column * @return newly created <code>SearchResult</code> */ protected SearchResult createSearchResult(Matcher matcher, int row, int column) { return new SearchResult(matcher.pattern(), matcher.toMatchResult(), row, column); }
/** * Factory method to create a SearchResult from the given parameters. * * @param matcher the matcher after a successful find. Must not be null. * @param row the found index * @param column the found column * @return newly created <code>SearchResult</code> */ protected SearchResult createSearchResult(Matcher matcher, int row, int column) { return new SearchResult(matcher.pattern(), matcher.toMatchResult(), row, column); }
/** * Instantiates an empty SearchResult. */ public SearchResult() { reset(); }