public class AddUserFields extends Filter implements OptionHandler, EnvironmentHandler
-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(String spec)
Add an attribute spec to the list
|
String |
attributeSpecsTipText()
Returns the tip text for this property.
|
void |
clearAttributeSpecs()
Clear the list of attribute specifications
|
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.
|
String[] |
getOptions()
Gets the current settings of the filter
|
String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
void |
setAttributeSpecs(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(String[] options)
Parses a given list of options.
|
batchFilterFile, batchFinished, filterFile, getCapabilities, getOutputFormat, getRevision, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapperpublic String globalInfo()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic void clearAttributeSpecs()
public Enumeration listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws 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 OptionHandlerotions - the list of options as an array of stringException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlerpublic void addAttributeSpec(String spec)
spec - the attribute spec to addpublic String attributeSpecsTipText()
public void setAttributeSpecs(List<AddUserFields.AttributeSpec> specs)
specs - the list of attribute specs to usepublic List<AddUserFields.AttributeSpec> getAttributeSpecs()
public void setEnvironment(Environment env)
setEnvironment in interface EnvironmentHandlerthe - environment variables to usepublic boolean setInputFormat(Instances instanceInfo) throws Exception
setInputFormat in class FilterinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).Exception - if the input format can't be set successfullypublic boolean input(Instance instance)
input in class Filterinstance - the input instanceIllegalStateException - if no input format has been defined.public static void main(String[] argv)
argv - should contain arguments to the filter: use -h for helpCopyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.