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<Option> |
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, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapperpublic String globalInfo()
public Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Filterpublic 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 OptionHandlersetOptions in class Filteroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Filterpublic 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 CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic 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 format couldn't be set successfullypublic boolean input(Instance instance)
input in class Filterinstance - the input instanceIllegalStateException - if no input format has been set.public boolean batchFinished()
batchFinished in class FilterIllegalStateException - if no input structure has been definedpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(String[] args)
args - should contain arguments to the filter: use -h for helpCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.