public class SubstringReplacerRules extends java.lang.Object implements EnvironmentHandler, java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
SubstringReplacerRules.SubstringReplacerMatchRule
Inner class encapsulating the logic for matching and replacing.
|
| Modifier and Type | Field and Description |
|---|---|
protected Environment |
m_env
Environment variables
|
protected Instances |
m_inputStructure
The input structure
|
protected java.util.List<SubstringReplacerRules.SubstringReplacerMatchRule> |
m_matchRules |
protected Instances |
m_outputStructure
The output structure
|
protected java.lang.String |
m_statusMessagePrefix
An optional prefix for status log messages
|
| Constructor and Description |
|---|
SubstringReplacerRules(java.lang.String matchDetails,
Instances inputStructure)
Constructor.
|
SubstringReplacerRules(java.lang.String matchDetails,
Instances inputStructure,
java.lang.String statusMessagePrefix,
Logger log,
Environment env)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyRules(Instance inst) |
Instance |
makeOutputInstance(Instance inputI)
Make an output instance given an input one
|
static java.util.List<SubstringReplacerRules.SubstringReplacerMatchRule> |
matchRulesFromInternal(java.lang.String matchReplaceDetails,
Instances inputStructure,
java.lang.String statusMessagePrefix,
Logger log,
Environment env)
Get a list of match rules from an internally encoded match specification
|
void |
setEnvironment(Environment env)
Set environment variables to use.
|
protected transient Environment m_env
protected java.util.List<SubstringReplacerRules.SubstringReplacerMatchRule> m_matchRules
protected Instances m_inputStructure
protected Instances m_outputStructure
protected java.lang.String m_statusMessagePrefix
public SubstringReplacerRules(java.lang.String matchDetails,
Instances inputStructure,
java.lang.String statusMessagePrefix,
Logger log,
Environment env)
matchDetails - the internally encoded match details stringinputStructure - the incoming instances structurestatusMessagePrefix - an optional status message prefix string for
logginglog - the log to use (may be null)env - environment variablespublic SubstringReplacerRules(java.lang.String matchDetails,
Instances inputStructure)
matchDetails - the internally encoded match details stringinputStructure - the incoming instances structurepublic void setEnvironment(Environment env)
EnvironmentHandlersetEnvironment in interface EnvironmentHandlerenv - the environment variables to
usepublic static java.util.List<SubstringReplacerRules.SubstringReplacerMatchRule> matchRulesFromInternal(java.lang.String matchReplaceDetails, Instances inputStructure, java.lang.String statusMessagePrefix, Logger log, Environment env)
matchReplaceDetails - the internally encoded specification of the
match rulesinputStructure - the input instances structurestatusMessagePrefix - an optional status message prefix for logginglog - the log to useenv - environment variablespublic void applyRules(Instance inst)