public static class SubstringReplacerRules.SubstringReplacerMatchRule
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
SubstringReplacerMatchRule()
Constructor
|
SubstringReplacerMatchRule(java.lang.String setup)
Constructor
|
SubstringReplacerMatchRule(java.lang.String match,
java.lang.String replace,
boolean regex,
boolean ignoreCase,
java.lang.String selectedAtts)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Instance inst)
Apply this rule to the supplied instance
|
void |
apply(java.lang.String[] stringVals)
Apply this rule to the supplied array of strings.
|
java.lang.String |
getAttsToApplyTo()
Get the attributes to apply the rule to
|
boolean |
getIgnoreCase()
Get whether to ignore case when matching
|
java.lang.String |
getMatch()
Get the string/regex to use for matching
|
boolean |
getRegex()
Get whether this is a regular expression match or not
|
java.lang.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(java.lang.String a)
Set the attributes to apply the rule to
|
void |
setIgnoreCase(boolean ignore)
Set whether to ignore case when matching
|
void |
setMatch(java.lang.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(java.lang.String replace)
Set the replace string
|
java.lang.String |
toString()
Return a textual description of this rule
|
java.lang.String |
toStringInternal()
Return the internally encoded representation of this rule
|
public SubstringReplacerMatchRule()
public SubstringReplacerMatchRule(java.lang.String setup)
setup - an internally encoded representation of all the match and
replace information for this rulepublic SubstringReplacerMatchRule(java.lang.String match,
java.lang.String replace,
boolean regex,
boolean ignoreCase,
java.lang.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(java.lang.String match)
match - the match stringpublic java.lang.String getMatch()
public void setReplace(java.lang.String replace)
replace - the replace stringpublic java.lang.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(java.lang.String a)
a - the attributes to apply the rule to.public java.lang.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 topublic void apply(java.lang.String[] stringVals)
stringVals - an array of strings containing string values from an
input instancepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringInternal()