Package weka.core

Class Debug.Timestamp

  • All Implemented Interfaces:
    java.io.Serializable, RevisionHandler
    Enclosing class:
    Debug

    public static class Debug.Timestamp
    extends java.lang.Object
    implements java.io.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: 7519 $
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    SimpleDateFormat, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_FORMAT
      the default format
    • Constructor Summary

      Constructors 
      Constructor Description
      Timestamp()
      creates a timestamp with the current date and time and the default format.
      Timestamp​(java.lang.String format)
      creates a timestamp with the current date and time and the specified format.
      Timestamp​(java.util.Date stamp)
      creates a timestamp with the given date and the default format.
      Timestamp​(java.util.Date stamp, java.lang.String format)
      creates a timestamp with the given date and format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFormat()
      returns the current timestamp format
      java.lang.String getRevision()
      Returns the revision string.
      java.util.Date getStamp()
      returns the associated date/time
      void setFormat​(java.lang.String value)
      sets the format for the timestamp
      java.lang.String toString()
      returns the timestamp as string in the specified format
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_FORMAT

        public static final java.lang.String DEFAULT_FORMAT
        the default format
        See Also:
        Constant Field Values
    • Constructor Detail

      • Timestamp

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

        public Timestamp​(java.lang.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​(java.util.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​(java.util.Date stamp,
                         java.lang.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​(java.lang.String value)
        sets the format for the timestamp
        Parameters:
        value - the format string
        See Also:
        SimpleDateFormat
      • getFormat

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

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

        public java.lang.String toString()
        returns the timestamp as string in the specified format
        Overrides:
        toString in class java.lang.Object
        Returns:
        the timestamp as string
      • getRevision

        public java.lang.String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface RevisionHandler
        Returns:
        the revision