public class AddID extends Filter implements UnsupervisedFilter, OptionHandler
-C <index> Specify where to insert the ID. First and last are valid indexes.(default first)
-N <name> Name of the new attribute. (default = 'ID')
Constructor and Description |
---|
AddID() |
Modifier and Type | Method and Description |
---|---|
String |
attributeNameTipText()
Returns the tip text for this property
|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
String |
getAttributeName()
Get the name of the attribute to be created
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
String |
getIDIndex()
Get the index of the attribute used.
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this filter
|
String |
IDIndexTipText()
Returns the tip text for this property
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for testing this class.
|
void |
setAttributeName(String value)
Set the new attribute's name
|
void |
setIDIndex(String value)
Sets index of the attribute used.
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
public String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-C <index> Specify where to insert the ID. First and last are valid indexes.(default first)
-N <name> Name of the new attribute. (default = 'ID')
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public String attributeNameTipText()
public String getAttributeName()
public void setAttributeName(String value)
value
- the new namepublic String IDIndexTipText()
public String getIDIndex()
public void setIDIndex(String value)
value
- the index of the attributepublic Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean setInputFormat(Instances instanceInfo) throws 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).Exception
- if the format couldn't be set successfullypublic boolean input(Instance instance)
input
in class Filter
instance
- the input instanceIllegalStateException
- if no input format has been set.public boolean batchFinished()
batchFinished
in class Filter
IllegalStateException
- if no input structure has been definedpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- should contain arguments to the filter: use -h for helpCopyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.