Class Timestamp

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class Timestamp
    extends AbstractTransformer
    Creates a timestamp string whenever it receives an input token.

    - accepts:
    - generates:

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: Timestamp
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        default: false
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
    -format <> (property: format)
        The format of the timestamp to generate; use single quotes for non-format
        chars, eg: "yyyyMMdd'T'HHmmss.'csv'"
        default: yyyy-MM-dd HH:mm:ss
    -time-zone <java.util.TimeZone> (property: timeZone)
        The time zone to use for interpreting dates/times; default is the system-wide 
        defined one.
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_TimeZone

        protected TimeZone m_TimeZone
        the timezone to use.
      • m_Formatter

        protected transient DateFormat m_Formatter
        for generating the timestamp.
    • Constructor Detail

      • Timestamp

        public Timestamp()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
        reset in class AbstractActor
      • getFormatter

        protected DateFormat getFormatter()
        Returns the instance of a date formatter to use.
        the formatter object
      • getDefaultFormat

        protected DateFormatString getDefaultFormat()
        Returns the default format to use.
        the format
      • setFormat

        public void setFormat​(DateFormatString value)
        Sets the format string to use; use single quotes for non-format chars, eg: "yyyyMMdd'T'HHmmss.'csv'".
        value - the format
      • getFormat

        public DateFormatString getFormat()
        Returns the format string in use; use single quotes for non-format chars, eg: "yyyyMMdd'T'HHmmss.'csv'".
        the format
      • formatTipText

        public String formatTipText()
        Returns the tip text for this property.
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTimeZone

        public void setTimeZone​(TimeZone value)
        Sets the time zone to use.
        value - the time zone
      • getTimeZone

        public TimeZone getTimeZone()
        Returns the time zone in use.
        the time zone
      • timeZoneTipText

        public String timeZoneTipText()
        Returns the tip text for this property.
        tip text for this property suitable for displaying in the gui
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        null if everything is fine, otherwise error message