|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.stevesoft.pat.Replacer
To use this class, first use either the getReplacer() method from Transformer or Regex. You can then use replaceAll, replaceFirst, etc. methods on the Replacer in the same way that you can from either of those two classes.
The only potential difference between using the methods of Replacer to do the replacing is that Replacer remembers changes to the replacing object between calls to replaceAll, replaceFirst etc. For details, see the example file trans3.java.
Transformer,
Regex| Constructor Summary | |
Replacer()
Instantiate a new Replacer. |
|
| Method Summary | |
void |
apply(Regex r)
Another form of apply, it is the same as apply(r,r.getReplaceRule()). |
void |
apply(RegRes r,
ReplaceRule rp)
This method allows you to apply the results of several matches in a sequence to modify a String of text. |
void |
apply1(RegRes rr)
|
java.lang.Object |
clone()
|
StringLike |
finish()
This finishes the replacement, appending the right() part of the last RegRes given to substitute(RegRes). |
Regex |
getRegex()
|
boolean |
isSpecial(ReplaceRule x)
|
int |
lastMatchedTo()
|
java.lang.String |
replaceAll(java.lang.String s)
|
StringLike |
replaceAll(StringLike s)
|
java.lang.String |
replaceAllFrom(java.lang.String s,
int start)
|
StringLike |
replaceAllFrom(StringLike s,
int start)
|
java.lang.String |
replaceAllRegion(java.lang.String s,
int start,
int end)
|
StringLike |
replaceAllRegion(StringLike s,
int start,
int end)
|
StringLike |
replaceAllRegion(StringLike s,
Regex r,
int start,
int end)
This method replaces all occurences of the Regex in the String starting with postition pos according to the Replacer rule of this object. |
StringLike |
replaceAllRegion(java.lang.String s,
Regex r,
int start,
int end)
|
StringLike |
replaceFirst(StringLike s)
|
StringLike |
replaceFirstFrom(StringLike s,
int start)
|
StringLike |
replaceFirstRegion(StringLike s,
int start,
int end)
|
StringLike |
replaceFirstRegion(StringLike s,
Regex r,
int start,
int end)
This method replaces the first occurence of the Regex in the String starting with position pos according to the Replacer rule of this object. |
StringLike |
replaceFirstRegion(java.lang.String s,
Regex r,
int start,
int end)
|
void |
setBuffer(StringBufferLike sbl)
|
void |
setPos(int pos)
|
void |
setSource(StringLike sl)
|
boolean |
WantMoreText()
|
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Replacer()
| Method Detail |
public StringLike replaceFirstRegion(java.lang.String s,
Regex r,
int start,
int end)
public StringLike replaceFirstRegion(StringLike s,
Regex r,
int start,
int end)
public StringLike replaceFirst(StringLike s)
public StringLike replaceFirstFrom(StringLike s,
int start)
public StringLike replaceFirstRegion(StringLike s,
int start,
int end)
public StringLike replaceAllRegion(java.lang.String s,
Regex r,
int start,
int end)
public StringLike replaceAllRegion(StringLike s,
Regex r,
int start,
int end)
public StringLike replaceAll(StringLike s)
public StringLike replaceAllFrom(StringLike s,
int start)
public StringLike replaceAllRegion(StringLike s,
int start,
int end)
public java.lang.String replaceAll(java.lang.String s)
public java.lang.String replaceAllFrom(java.lang.String s,
int start)
public java.lang.String replaceAllRegion(java.lang.String s,
int start,
int end)
public final boolean isSpecial(ReplaceRule x)
public final void apply1(RegRes rr)
public void apply(RegRes r,
ReplaceRule rp)
public boolean WantMoreText()
public void apply(Regex r)
public StringLike finish()
public java.lang.Object clone()
public int lastMatchedTo()
public Regex getRegex()
public void setSource(StringLike sl)
public void setBuffer(StringBufferLike sbl)
public void setPos(int pos)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||