|
JHotDraw 7.5.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.samples.teddy.regex.Matcher
public class Matcher
Searches for an occurence of a case (in)sensitive text on a document. This is a rather slow implementation that does not use advanced techniques such as Boyer-Moore.
Constructor Summary | |
---|---|
Matcher(javax.swing.text.Document document,
java.lang.String findString)
Creates a new instance of Matcher which performs a case sensitive search. |
|
Matcher(javax.swing.text.Document document,
java.lang.String findString,
boolean matchCase,
MatchType matchType)
Creates a new instance of Matcher |
Method Summary | |
---|---|
int |
findNext()
Attempts to find the next subsequence of the input sequence that matches the pattern. |
int |
findNext(int startIndex)
Resets this matcher and then attempts to find the next subsequence of the input sequence that matches the pattern, starting at the specified index. |
int |
findPrevious()
Attempts to find the previous subsequence of the input sequence that matches the pattern. |
int |
findPrevious(int startIndex)
Resets this matcher and then attempts to find the previous subsequence of the input sequence that matches the pattern, starting at the specified index. |
java.lang.String |
getFindString()
|
MatchType |
getMatchType()
|
boolean |
isMatchCase()
|
void |
reset()
Resets the startIndex of the matcher to 0. |
void |
setStartIndex(int newValue)
Sets the start index for the findNext(), findPrevious() methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matcher(javax.swing.text.Document document, java.lang.String findString)
document
- The document to be examinedfindString
- The string to be searched.public Matcher(javax.swing.text.Document document, java.lang.String findString, boolean matchCase, MatchType matchType)
document
- The document to be examinedfindString
- The string to be searched.matchCase
- Set to true for case sensitive search.matchType
- Sets the match type.Method Detail |
---|
public java.lang.String getFindString()
public boolean isMatchCase()
public MatchType getMatchType()
public void setStartIndex(int newValue)
public int findNext(int startIndex)
startIndex
- the index from which to start the search.
public int findNext()
This method starts at the beginning of the input sequence or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.
public int findPrevious(int startIndex)
startIndex
- the index from which to start the search.
public int findPrevious()
This method starts at the beginning of the input sequence or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.
public void reset()
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |