Package adams.data.filter
Class TimeseriesShiftTimestamps
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<Timeseries>
-
- adams.data.filter.TimeseriesShiftTimestamps
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Filter>,SizeOfHandler,Filter<Timeseries>,Serializable,Comparable
public class TimeseriesShiftTimestamps extends AbstractFilter<Timeseries>
Shifts the timestamps of the timeseries by a calculated amount.
The amount is either the difference between the 'new' timestamp and a timestamp from the report or a supplied timestamp.
Accepted date formats (unless custom format specified):
yyyy-MM-dd HH:mm:ss
yyyy-MM-dd HH:mm:ss.S
yyyy-MM-dd
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-id-update <boolean> (property: dontUpdateID) If enabled, suppresses updating the ID of adams.data.id.IDHandler data containers. default: false
-source <REPORT_FIELD|SUPPLIED_TIMESTAMP> (property: source) Specifies where to get the 'old' timestamp from. default: SUPPLIED_TIMESTAMP
-report-field <adams.data.report.Field> (property: reportField) The report field to obtain the timestamp from. default:
-custom-format <java.lang.String> (property: customFormat) The custom date format to use for parsing the value from the report. default:
-supplied-timestamp <adams.core.base.BaseDateTime> (property: suppliedTimestamp) The supplied timestamp value to use. default: NOW
-new-timestamp <adams.core.base.BaseDateTime> (property: newTimestamp) The new timestamp value to use. default: NOW
- Version:
- $Revision: 7789 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimeseriesShiftTimestamps.TimestampSourceEnumeration for where to obtain the "old" timestamp from.-
Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter
AbstractFilter.FilterJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_CustomFormatthe custom format to use.protected BaseDateTimem_NewTimestampthe new timstamp.protected Fieldm_ReportFieldthe reprt field to use.protected TimeseriesShiftTimestamps.TimestampSourcem_Sourcethe timestamp source.protected BaseDateTimem_SuppliedTimestampthe supplied timestamp.-
Fields inherited from class adams.data.filter.AbstractFilter
m_DontUpdateID
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description TimeseriesShiftTimestamps()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcustomFormatTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringgetCustomFormat()Returns the custom date format to use for parsing.BaseDateTimegetNewTimestamp()The new timestamp to use.FieldgetReportField()The report field to obtain the timestamp from.TimeseriesShiftTimestamps.TimestampSourcegetSource()Returns where to get the 'old' timestamp from.BaseDateTimegetSuppliedTimestamp()The supplied timestamp to use.StringglobalInfo()Returns a string describing the object.StringnewTimestampTipText()Returns the tip text for this property.protected TimeseriesprocessData(Timeseries data)Performs the actual filtering.StringreportFieldTipText()Returns the tip text for this property.voidsetCustomFormat(String value)Sets the custom date format to use for parsing.voidsetNewTimestamp(BaseDateTime value)Sets the new timestamp to use.voidsetReportField(Field value)Sets the report field to obtain the timestamp from.voidsetSource(TimeseriesShiftTimestamps.TimestampSource value)Sets where to get the 'old' timestamp from.voidsetSuppliedTimestamp(BaseDateTime value)Sets the supplied timestamp to use.StringsourceTipText()Returns the tip text for this property.StringsuppliedTimestampTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Source
protected TimeseriesShiftTimestamps.TimestampSource m_Source
the timestamp source.
-
m_ReportField
protected Field m_ReportField
the reprt field to use.
-
m_CustomFormat
protected String m_CustomFormat
the custom format to use.
-
m_SuppliedTimestamp
protected BaseDateTime m_SuppliedTimestamp
the supplied timestamp.
-
m_NewTimestamp
protected BaseDateTime m_NewTimestamp
the new timstamp.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFilter<Timeseries>
-
setSource
public void setSource(TimeseriesShiftTimestamps.TimestampSource value)
Sets where to get the 'old' timestamp from.- Parameters:
value- the source
-
getSource
public TimeseriesShiftTimestamps.TimestampSource getSource()
Returns where to get the 'old' timestamp from.- Returns:
- the source
-
sourceTipText
public String sourceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReportField
public void setReportField(Field value)
Sets the report field to obtain the timestamp from.- Parameters:
value- the field
-
getReportField
public Field getReportField()
The report field to obtain the timestamp from.- Returns:
- the field
-
reportFieldTipText
public String reportFieldTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCustomFormat
public void setCustomFormat(String value)
Sets the custom date format to use for parsing. Ignored if empty.- Parameters:
value- the custom format
-
getCustomFormat
public String getCustomFormat()
Returns the custom date format to use for parsing. Ignored if empty.- Returns:
- the custom format
-
customFormatTipText
public String customFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSuppliedTimestamp
public void setSuppliedTimestamp(BaseDateTime value)
Sets the supplied timestamp to use.- Parameters:
value- the timestamp
-
getSuppliedTimestamp
public BaseDateTime getSuppliedTimestamp()
The supplied timestamp to use.- Returns:
- the timestamp
-
suppliedTimestampTipText
public String suppliedTimestampTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNewTimestamp
public void setNewTimestamp(BaseDateTime value)
Sets the new timestamp to use.- Parameters:
value- the timestamp
-
getNewTimestamp
public BaseDateTime getNewTimestamp()
The new timestamp to use.- Returns:
- the timestamp
-
newTimestampTipText
public String newTimestampTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
processData
protected Timeseries processData(Timeseries data)
Performs the actual filtering.- Specified by:
processDatain classAbstractFilter<Timeseries>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-