|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.unsupervised.attribute.ChangeDateFormat
public class ChangeDateFormat
Changes the date format used by a date attribute. This is most useful for converting to a format with less precision, for example, from an absolute date to day of year, etc. This changes the format string, and changes the date values to those that would be parsed by the new format.
Valid options are:-C <col> Sets the attribute index (default last).
-F <value index> Sets the output date format string (default corresponds to ISO-8601).
| Constructor Summary | |
|---|---|
ChangeDateFormat()
|
|
| Method Summary | |
|---|---|
java.lang.String |
attributeIndexTipText()
|
java.lang.String |
dateFormatTipText()
|
java.lang.String |
getAttributeIndex()
Gets the index of the attribute converted. |
Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
java.text.SimpleDateFormat |
getDateFormat()
Get the date format used in output. |
java.lang.String[] |
getOptions()
Gets the current settings of the filter. |
java.lang.String |
getRevision()
Returns the revision string. |
java.lang.String |
globalInfo()
Returns a string describing this filter |
boolean |
input(Instance instance)
Input an instance for filtering. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setAttributeIndex(java.lang.String attIndex)
Sets the index of the attribute used. |
void |
setDateFormat(java.text.SimpleDateFormat dateFormat)
Sets the output date format. |
void |
setDateFormat(java.lang.String dateFormat)
Sets the output date format. |
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, batchFinished, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChangeDateFormat()
| Method Detail |
|---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilities
public boolean setInputFormat(Instances instanceInfo)
throws java.lang.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).
java.lang.Exception - if the input format can't be set
successfully
public boolean input(Instance instance)
throws java.lang.Exception
input in class Filterinstance - the input instance
java.lang.Exception - if the input format was not set or the date format cannot
be parsedpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandler
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
-C <col> Sets the attribute index (default last).
-F <value index> Sets the output date format string (default corresponds to ISO-8601).
setOptions in interface OptionHandleroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic java.lang.String attributeIndexTipText()
public java.lang.String getAttributeIndex()
public void setAttributeIndex(java.lang.String attIndex)
attIndex - the index of the attributepublic java.lang.String dateFormatTipText()
public java.text.SimpleDateFormat getDateFormat()
public void setDateFormat(java.lang.String dateFormat)
dateFormat - the output date format.public void setDateFormat(java.text.SimpleDateFormat dateFormat)
dateFormat - the output date format.public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] argv)
argv - should contain arguments to the filter:
use -h for help
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||