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.

    Input/output:
    - accepts:
       adams.flow.core.Unknown
    - generates:
       java.lang.String


    -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.
        default: 
     
    -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
        actors.
        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 <adams.data.DateFormatString> (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
        more: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
     
    -time-zone <java.util.TimeZone> (property: timeZone)
        The time zone to use for interpreting dates/times; default is the system-wide 
        defined one.
     
    Author:
    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.
        Overrides:
        reset in class AbstractActor
      • getFormatter

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

        protected DateFormatString getDefaultFormat()
        Returns the default format to use.
        Returns:
        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'".
        Parameters:
        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'".
        Returns:
        the format
      • formatTipText

        public String formatTipText()
        Returns the tip text for this property.
        Returns:
        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.
        Parameters:
        value - the time zone
      • getTimeZone

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

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        adams.flow.core.Unknown.class
      • generates

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

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