com.rapidminer.operator.preprocessing.filter
Class Date2Numerical

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.AbstractExampleSetProcessing
          extended by com.rapidminer.operator.preprocessing.AbstractDataProcessing
              extended by com.rapidminer.operator.preprocessing.filter.Date2Numerical
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class Date2Numerical
extends AbstractDataProcessing

This operator changes a date attribute into a numerical one. It allows to specify exactly which entity should be extracted and to which unit or date it should relate. As an example, it is possible to extract seconds within a minute. Analogously, it is also possible to extract the day within a month. But it is also possible to extract the day within a week or within a year. For all time units, it is also possible to extract the number which has passed by since 1970-01-01 00:00.

Author:
Tobias Malbrecht

Field Summary
static int DAY
           
static int DAY_RELATIVE_TO_EPOCH
           
static int DAY_RELATIVE_TO_MONTH
           
static int DAY_RELATIVE_TO_WEEK
           
static int DAY_RELATIVE_TO_YEAR
           
static int HALF_YEAR
           
static int HALF_YEAR_RELATIVE_TO_EPOCH
           
static int HALF_YEAR_RELATIVE_TO_YEAR
           
static int HOUR
           
static int HOUR_RELATIVE_TO_DAY
           
static int HOUR_RELATIVE_TO_EPOCH
           
static int MILLISECOND
           
static int MILLISECOND_RELATIVE_TO_EPOCH
           
static int MILLISECOND_RELATIVE_TO_SECOND
           
static int MINUTE
           
static int MINUTE_RELATIVE_TO_DAY
           
static int MINUTE_RELATIVE_TO_EPOCH
           
static int MINUTE_RELATIVE_TO_HOUR
           
static int MONTH
           
static int MONTH_RELATIVE_TO_EPOCH
           
static int MONTH_RELATIVE_TO_QUARTER
           
static int MONTH_RELATIVE_TO_YEAR
           
static java.lang.String PARAMETER_ATTRIBUTE_NAME
           
static java.lang.String PARAMETER_KEEP_OLD_ATTRIBUTE
           
static java.lang.String PARAMETER_TIME_UNIT
           
static java.lang.String[] PARAMETERS_RELATIVE_TO
           
static int QUARTER
           
static int QUARTER_RELATIVE_TO_EPOCH
           
static int QUARTER_RELATIVE_TO_YEAR
           
static int[] RELATIVE_TO_DEFAULTS
           
static java.lang.String[][] RELATIVE_TO_MODES
           
static int SECOND
           
static int SECOND_RELATIVE_TO_DAY
           
static int SECOND_RELATIVE_TO_EPOCH
           
static int SECOND_RELATIVE_TO_HOUR
           
static int SECOND_RELATIVE_TO_MINUTE
           
static java.lang.String[] TIME_UNITS
           
static int WEEK
           
static int WEEK_RELATIVE_TO_EPOCH
           
static int WEEK_RELATIVE_TO_MONTH
           
static int WEEK_RELATIVE_TO_YEAR
           
static int YEAR
           
static int YEAR_RELATIVE_TO_EPOCH
           
static int YEAR_RELATIVE_TO_ERA
           
 
Constructor Summary
Date2Numerical(OperatorDescription description)
           
 
Method Summary
 ExampleSet apply(ExampleSet exampleSet)
          Delegate for the apply method.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 
Methods inherited from class com.rapidminer.operator.AbstractExampleSetProcessing
apply, getInputClasses, getOutputClasses
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, performAdditionalChecks, processFinished, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_ATTRIBUTE_NAME

public static final java.lang.String PARAMETER_ATTRIBUTE_NAME
See Also:
Constant Field Values

PARAMETER_TIME_UNIT

public static final java.lang.String PARAMETER_TIME_UNIT
See Also:
Constant Field Values

TIME_UNITS

public static final java.lang.String[] TIME_UNITS

MILLISECOND

public static final int MILLISECOND
See Also:
Constant Field Values

SECOND

public static final int SECOND
See Also:
Constant Field Values

MINUTE

public static final int MINUTE
See Also:
Constant Field Values

HOUR

public static final int HOUR
See Also:
Constant Field Values

DAY

public static final int DAY
See Also:
Constant Field Values

WEEK

public static final int WEEK
See Also:
Constant Field Values

MONTH

public static final int MONTH
See Also:
Constant Field Values

QUARTER

public static final int QUARTER
See Also:
Constant Field Values

HALF_YEAR

public static final int HALF_YEAR
See Also:
Constant Field Values

YEAR

public static final int YEAR
See Also:
Constant Field Values

PARAMETERS_RELATIVE_TO

public static final java.lang.String[] PARAMETERS_RELATIVE_TO

RELATIVE_TO_MODES

public static final java.lang.String[][] RELATIVE_TO_MODES

MILLISECOND_RELATIVE_TO_SECOND

public static final int MILLISECOND_RELATIVE_TO_SECOND
See Also:
Constant Field Values

MILLISECOND_RELATIVE_TO_EPOCH

public static final int MILLISECOND_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

SECOND_RELATIVE_TO_MINUTE

public static final int SECOND_RELATIVE_TO_MINUTE
See Also:
Constant Field Values

SECOND_RELATIVE_TO_HOUR

public static final int SECOND_RELATIVE_TO_HOUR
See Also:
Constant Field Values

SECOND_RELATIVE_TO_DAY

public static final int SECOND_RELATIVE_TO_DAY
See Also:
Constant Field Values

SECOND_RELATIVE_TO_EPOCH

public static final int SECOND_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

MINUTE_RELATIVE_TO_HOUR

public static final int MINUTE_RELATIVE_TO_HOUR
See Also:
Constant Field Values

MINUTE_RELATIVE_TO_DAY

public static final int MINUTE_RELATIVE_TO_DAY
See Also:
Constant Field Values

MINUTE_RELATIVE_TO_EPOCH

public static final int MINUTE_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

HOUR_RELATIVE_TO_DAY

public static final int HOUR_RELATIVE_TO_DAY
See Also:
Constant Field Values

HOUR_RELATIVE_TO_EPOCH

public static final int HOUR_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

DAY_RELATIVE_TO_WEEK

public static final int DAY_RELATIVE_TO_WEEK
See Also:
Constant Field Values

DAY_RELATIVE_TO_MONTH

public static final int DAY_RELATIVE_TO_MONTH
See Also:
Constant Field Values

DAY_RELATIVE_TO_YEAR

public static final int DAY_RELATIVE_TO_YEAR
See Also:
Constant Field Values

DAY_RELATIVE_TO_EPOCH

public static final int DAY_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

WEEK_RELATIVE_TO_MONTH

public static final int WEEK_RELATIVE_TO_MONTH
See Also:
Constant Field Values

WEEK_RELATIVE_TO_YEAR

public static final int WEEK_RELATIVE_TO_YEAR
See Also:
Constant Field Values

WEEK_RELATIVE_TO_EPOCH

public static final int WEEK_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

MONTH_RELATIVE_TO_QUARTER

public static final int MONTH_RELATIVE_TO_QUARTER
See Also:
Constant Field Values

MONTH_RELATIVE_TO_YEAR

public static final int MONTH_RELATIVE_TO_YEAR
See Also:
Constant Field Values

MONTH_RELATIVE_TO_EPOCH

public static final int MONTH_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

QUARTER_RELATIVE_TO_YEAR

public static final int QUARTER_RELATIVE_TO_YEAR
See Also:
Constant Field Values

QUARTER_RELATIVE_TO_EPOCH

public static final int QUARTER_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

HALF_YEAR_RELATIVE_TO_YEAR

public static final int HALF_YEAR_RELATIVE_TO_YEAR
See Also:
Constant Field Values

HALF_YEAR_RELATIVE_TO_EPOCH

public static final int HALF_YEAR_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

YEAR_RELATIVE_TO_EPOCH

public static final int YEAR_RELATIVE_TO_EPOCH
See Also:
Constant Field Values

YEAR_RELATIVE_TO_ERA

public static final int YEAR_RELATIVE_TO_ERA
See Also:
Constant Field Values

RELATIVE_TO_DEFAULTS

public static final int[] RELATIVE_TO_DEFAULTS

PARAMETER_KEEP_OLD_ATTRIBUTE

public static final java.lang.String PARAMETER_KEEP_OLD_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

Date2Numerical

public Date2Numerical(OperatorDescription description)
Method Detail

apply

public ExampleSet apply(ExampleSet exampleSet)
                 throws OperatorException
Description copied from class: AbstractExampleSetProcessing
Delegate for the apply method. In most cases, the returned example set will be the same as the example set or a modified clone.

Specified by:
apply in class AbstractExampleSetProcessing
Throws:
OperatorException

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class Operator


Copyright © 2001-2009 by Rapid-I