public static class SubstringReplacerRules.SubstringReplacerMatchRule extends Object
| Constructor and Description |
|---|
SubstringReplacerRules.SubstringReplacerMatchRule()
Constructor
|
SubstringReplacerRules.SubstringReplacerMatchRule(String setup)
Constructor
|
SubstringReplacerRules.SubstringReplacerMatchRule(String match,
String replace,
boolean regex,
boolean ignoreCase,
String selectedAtts)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Instance inst)
Apply this rule to the supplied instance
|
String |
getAttsToApplyTo()
Get the attributes to apply the rule to
|
boolean |
getIgnoreCase()
Get whether to ignore case when matching
|
String |
getMatch()
Get the string/regex to use for matching
|
boolean |
getRegex()
Get whether this is a regular expression match or not
|
String |
getReplace()
Get the replace string
|
void |
init(Environment env,
Instances structure)
Initialize this match replace rule by substituting any environment
variables in the attributes, match and replace strings.
|
void |
setAttsToApplyTo(String a)
Set the attributes to apply the rule to
|
void |
setIgnoreCase(boolean ignore)
Set whether to ignore case when matching
|
void |
setMatch(String match)
Set the string/regex to use for matching
|
void |
setRegex(boolean regex)
Set whether this is a regular expression match or not
|
void |
setReplace(String replace)
Set the replace string
|
String |
toString()
Return a textual description of this rule
|
public SubstringReplacerRules.SubstringReplacerMatchRule()
public SubstringReplacerRules.SubstringReplacerMatchRule(String setup)
setup - an internally encoded representation of all the match and
replace information for this rulepublic SubstringReplacerRules.SubstringReplacerMatchRule(String match, String replace, boolean regex, boolean ignoreCase, String selectedAtts)
match - the match stringreplace - the replace stringregex - true if this is a regular expression matchignoreCase - true if case is to be ignoredselectedAtts - the attributes to apply the rule topublic void setMatch(String match)
match - the match stringpublic String getMatch()
public void setReplace(String replace)
replace - the replace stringpublic String getReplace()
public void setRegex(boolean regex)
regex - true if this is a regular expression matchpublic boolean getRegex()
public void setIgnoreCase(boolean ignore)
ignore - true if case is to be ignoredpublic boolean getIgnoreCase()
public void setAttsToApplyTo(String a)
a - the attributes to apply the rule to.public String getAttsToApplyTo()
public void init(Environment env, Instances structure)
env - the environment variablesstructure - the structure of the incoming instancespublic void apply(Instance inst)
inst - the instance to apply toCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.