public class AddUserFields extends Filter implements OptionHandler, EnvironmentHandler, UnsupervisedFilter, WeightedInstancesHandler, WeightedAttributesHandler
-A <name:type:value> New field specification (name@type@value). Environment variables may be used for any/all parts of the specification. Type can be one of (numeric, nominal, string or date). The value for date be a specific date string or the special string "now" to indicate the current date-time. A specific date format string for parsing specific date values can be specified by suffixing the type specification - e.g. "myTime@date:MM-dd-yyyy@08-23-2009".This option may be specified multiple times
Modifier and Type | Class and Description |
---|---|
static class |
AddUserFields.AttributeSpec
Inner class encapsulating a new user-specified attribute to create.
|
Constructor and Description |
---|
AddUserFields()
Constructs a new AddUserFields
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeSpec(java.lang.String spec)
Add an attribute spec to the list
|
java.lang.String |
attributeSpecsTipText()
Returns the tip text for this property.
|
void |
clearAttributeSpecs()
Clear the list of attribute specifications
|
java.util.List<AddUserFields.AttributeSpec> |
getAttributeSpecs()
Get the list of attribute specs to use to create the new attributes.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter
|
java.lang.String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
void |
setAttributeSpecs(java.util.List<AddUserFields.AttributeSpec> specs)
Set the list of attribute specs to use to create the new attributes.
|
void |
setEnvironment(Environment env)
Set environment varialbes to use
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
batchFilterFile, batchFinished, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOutputFormat, getRevision, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public void clearAttributeSpecs()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class Filter
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-A <name:type:value> * New field specification (name@type@value). * Environment variables may be used for any/all parts of the * specification. Type can be one of (numeric, nominal, string or date). * The value for date be a specific date string or the special string * "now" to indicate the current date-time. A specific date format * string for parsing specific date values can be specified by suffixing * the type specification - e.g. "myTime@date:MM-dd-yyyy@08-23-2009".This option may be specified multiple times*
setOptions
in interface OptionHandler
setOptions
in class Filter
options
- the list of options as an array of stringjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Filter
public void addAttributeSpec(java.lang.String spec)
spec
- the attribute spec to addpublic java.lang.String attributeSpecsTipText()
public void setAttributeSpecs(java.util.List<AddUserFields.AttributeSpec> specs)
specs
- the list of attribute specs to usepublic java.util.List<AddUserFields.AttributeSpec> getAttributeSpecs()
public void setEnvironment(Environment env)
setEnvironment
in interface EnvironmentHandler
env
- the environment variables to usepublic boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class Filter
instanceInfo
- an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).java.lang.Exception
- if the input format can't be set successfullypublic boolean input(Instance instance)
public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter: use -h for help