|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.stevesoft.pat.RegRes
This class is used to store a result from Regex
| Field Summary | |
protected int |
charsMatched_
|
protected boolean |
didMatch_
|
protected int[] |
marks
|
protected int |
matchFrom_
|
protected int |
numSubs_
|
protected StringLike |
src
|
| Constructor Summary | |
RegRes()
|
|
RegRes(RegRes r)
|
|
| Method Summary | |
int |
charsMatched()
After a successful match, this returns the number of characters in the match, or -1 if the match failed. |
int |
charsMatched(int i)
Obtains the number of characters matched by backreference i, or -1 if backreference i was not matched. |
java.lang.Object |
clone()
|
void |
copyOutOf(RegRes r)
|
boolean |
didMatch()
Contains true if the last match was successful. |
boolean |
equals(RegRes r)
|
java.lang.String |
getString()
Obtain the text String that was matched against. |
StringLike |
getStringLike()
Obtain the source StringLike object. |
java.lang.String |
left()
This returns the part of the string that preceeds the match, or null if the match failed. |
java.lang.String |
left(int i)
This returns the part of the string that follows the ith backreference, or null if the backreference did not match. |
int |
matchedFrom()
After a successful match, this returns the location of the first matching character, or -1 if the match failed. |
int |
matchedFrom(int i)
Obtains the position backreference number i begins to match, or -1 if backreference i was not matched. |
int |
matchedTo()
This is matchedFrom()+charsMatched() after a successful match, or -1 otherwise. |
int |
matchedTo(int i)
This is either equal to matchedFrom(i)+charsMatched(i) if the match was successful, or -1 if it was not. |
int |
matchFrom()
An older name for matchedFrom. |
int |
matchFrom(int i)
An older name for matchedFrom. |
int |
numSubs()
This returns the number of backreferences (parenthesis) in the pattern, i.e. |
java.lang.String |
right()
This returns the part of the string that follows the match, or null if the backreference did not match. |
java.lang.String |
right(int i)
This returns the string to the right of the ith backreference, or null if the backreference did not match. |
java.lang.String |
stringMatched()
Obtains the match if successful, null otherwise. |
java.lang.String |
stringMatched(int i)
Obtains a substring matching the nth set of parenthesis from the pattern. |
java.lang.String |
substring()
An older name for stringMatched(). |
java.lang.String |
substring(int i)
An older name for stringMatched. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected int[] marks
protected boolean didMatch_
protected StringLike src
protected int charsMatched_
protected int matchFrom_
protected int numSubs_
| Constructor Detail |
public RegRes()
public RegRes(RegRes r)
| Method Detail |
public java.lang.String getString()
public StringLike getStringLike()
public java.lang.String toString()
public void copyOutOf(RegRes r)
public java.lang.Object clone()
public boolean equals(RegRes r)
public java.lang.String stringMatched()
public int matchedFrom(int i)
public int charsMatched(int i)
public int matchedTo(int i)
public java.lang.String stringMatched(int i)
public java.lang.String left()
public java.lang.String left(int i)
public java.lang.String right()
public java.lang.String right(int i)
public int matchedFrom()
public int charsMatched()
public int matchedTo()
public int numSubs()
public boolean didMatch()
public int matchFrom()
public java.lang.String substring()
public int matchFrom(int i)
public java.lang.String substring(int i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||