Package weka.core

Class Debug.Timestamp

  • All Implemented Interfaces:
    Serializable, RevisionHandler
    Enclosing class:
    Debug

    public static class Debug.Timestamp
    extends Object
    implements Serializable, RevisionHandler
    A class that can be used for timestamps in files, The toString() method simply returns the associated Date object in a timestamp format. For formatting options, see java.text.SimpleDateFormat.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    SimpleDateFormat, Serialized Form
    • Constructor Detail

      • Timestamp

        public Timestamp()
        creates a timestamp with the current date and time and the default format.
      • Timestamp

        public Timestamp​(String format)
        creates a timestamp with the current date and time and the specified format.
        Parameters:
        format - the format of the timestamp
        See Also:
        SimpleDateFormat
      • Timestamp

        public Timestamp​(Date stamp)
        creates a timestamp with the given date and the default format.
        Parameters:
        stamp - the associated date/time for the timestamp
      • Timestamp

        public Timestamp​(Date stamp,
                         String format)
        creates a timestamp with the given date and format.
        Parameters:
        stamp - the associated date/time for the timestamp
        format - the format of the timestamp
        See Also:
        SimpleDateFormat
    • Method Detail

      • setFormat

        public void setFormat​(String value)
        sets the format for the timestamp
        Parameters:
        value - the format string
        See Also:
        SimpleDateFormat
      • getFormat

        public String getFormat()
        returns the current timestamp format
        Returns:
        the current format
      • getStamp

        public Date getStamp()
        returns the associated date/time
        Returns:
        the timestamp value
      • toString

        public String toString()
        returns the timestamp as string in the specified format
        Overrides:
        toString in class Object
        Returns:
        the timestamp as string