|
||||||||||
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 filter-specific options are:
-C col
The column containing the date attribute to be changed. (default last)
-F format
The output date format (default corresponds to ISO-8601 format).
Constructor Summary | |
---|---|
ChangeDateFormat()
|
Method Summary | |
---|---|
java.lang.String |
attributeIndexTipText()
|
java.lang.String |
dateFormatTipText()
|
java.lang.String |
getAttributeIndex()
Gets the index of the attribute converted. |
java.text.SimpleDateFormat |
getDateFormat()
Get the date format used in output. |
java.lang.String[] |
getOptions()
{@inheritDoc |
java.lang.String |
globalInfo()
Returns a string describing this filter |
boolean |
input(Instance instance)
{@inheritDoc |
java.util.Enumeration |
listOptions()
{@inheritDoc |
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)
{@inheritDoc |
void |
setOptions(java.lang.String[] options)
Parses the options for this object. |
Methods inherited from class weka.filters.Filter |
---|
batchFilterFile, batchFinished, filterFile, getOutputFormat, inputFormat, isOutputFormatDefined, numPendingOutput, output, outputFormat, outputPeek, useFilter |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChangeDateFormat()
Method Detail |
---|
public java.lang.String globalInfo()
public 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 inputFormat can't be set successfullypublic boolean input(Instance instance)
input
in class Filter
instance
- the input instance
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-C col
The column containing the date attribute to be changed. (default last)
-F index
The output date format (default corresponds to ISO-8601 format).
setOptions
in interface OptionHandler
options
- 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 OptionHandler
public java.lang.String attributeIndexTipText()
public java.lang.String getAttributeIndex()
public void setAttributeIndex(java.lang.String attIndex)
index
- the index of the attributepublic java.lang.String dateFormatTipText()
public java.text.SimpleDateFormat getDateFormat()
public void setDateFormat(java.lang.String dateFormat)
index
- the output date format.public void setDateFormat(java.text.SimpleDateFormat dateFormat)
index
- the output date format.public 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 |