public class MatchMap extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
MatchMap.EvaluatorToken
Evaluator token.
|
protected static class |
MatchMap.EvaluatorTokenStream
Token stream.
|
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected Pattern[] |
matchPatterns
This is the set of Pattern objects corresponding to the match regexp strings.
|
protected ArrayList |
matchStrings
This is the set of match regexp strings
|
protected ArrayList |
replaceStrings
This is the set of replace strings
|
Constructor and Description |
---|
MatchMap()
Constructor.
|
MatchMap(ArrayList matchStrings,
ArrayList replaceStrings)
Constructor.
|
MatchMap(String stringForm)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendMatchPair(String match,
String replace)
Append a match/replace string pair
|
void |
appendOldstyleMatchPair(String oldstyleMatch,
String oldstyleReplace)
Append old-style match/replace pair.
|
void |
deleteMatchPair(int index)
Delete a specified match/replace string pair
|
protected static void |
escape(StringBuilder output,
String input)
Escape a string so it is verbatim
|
int |
getMatchCount()
Get the number of match/replace strings
|
String |
getMatchString(int index)
Get a specific match string
|
String |
getReplaceString(int index)
Get a specific replace string
|
void |
insertMatchPair(int index,
String match,
String replace)
Insert a match/replace string pair
|
protected static void |
stuff(StringBuilder sb,
String value)
Stuff characters
|
String |
toString()
Convert the matchmap to string form.
|
String |
translate(String input)
Perform a translation.
|
public static final String _rcsid
protected ArrayList matchStrings
protected Pattern[] matchPatterns
protected ArrayList replaceStrings
public MatchMap()
public MatchMap(String stringForm)
public int getMatchCount()
public String getMatchString(int index)
public String getReplaceString(int index)
public void deleteMatchPair(int index)
public void insertMatchPair(int index, String match, String replace)
public void appendMatchPair(String match, String replace)
public void appendOldstyleMatchPair(String oldstyleMatch, String oldstyleReplace)
protected static void escape(StringBuilder output, String input)
public String toString()
protected static void stuff(StringBuilder sb, String value)