forked from CharlesSkelton/studio
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package studio.ui.search; | ||
|
||
import java.util.regex.Matcher; | ||
|
||
public class SearchResult { | ||
|
||
private final Matcher matcher; | ||
|
||
public final static SearchResult NOT_FOUND = new SearchResult(null); | ||
|
||
public SearchResult(Matcher matcher) { | ||
this.matcher = matcher; | ||
} | ||
|
||
public boolean found() { | ||
return matcher != null; | ||
} | ||
|
||
public Matcher matcher() { | ||
if (! found()) throw new IllegalStateException("No matcher for the SearchResult"); | ||
return matcher; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters