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 class
TimeseriesShiftTimestamps.TimestampSource
Enumeration 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 String
m_CustomFormat
the custom format to use.protected BaseDateTime
m_NewTimestamp
the new timstamp.protected Field
m_ReportField
the reprt field to use.protected TimeseriesShiftTimestamps.TimestampSource
m_Source
the timestamp source.protected BaseDateTime
m_SuppliedTimestamp
the 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 String
customFormatTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
getCustomFormat()
Returns the custom date format to use for parsing.BaseDateTime
getNewTimestamp()
The new timestamp to use.Field
getReportField()
The report field to obtain the timestamp from.TimeseriesShiftTimestamps.TimestampSource
getSource()
Returns where to get the 'old' timestamp from.BaseDateTime
getSuppliedTimestamp()
The supplied timestamp to use.String
globalInfo()
Returns a string describing the object.String
newTimestampTipText()
Returns the tip text for this property.protected Timeseries
processData(Timeseries data)
Performs the actual filtering.String
reportFieldTipText()
Returns the tip text for this property.void
setCustomFormat(String value)
Sets the custom date format to use for parsing.void
setNewTimestamp(BaseDateTime value)
Sets the new timestamp to use.void
setReportField(Field value)
Sets the report field to obtain the timestamp from.void
setSource(TimeseriesShiftTimestamps.TimestampSource value)
Sets where to get the 'old' timestamp from.void
setSuppliedTimestamp(BaseDateTime value)
Sets the supplied timestamp to use.String
sourceTipText()
Returns the tip text for this property.String
suppliedTimestampTipText()
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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:
processData
in classAbstractFilter<Timeseries>
- Parameters:
data
- the data to filter- Returns:
- the filtered data
-
-