Documentation of 'smile.data.DateAttribute' Java class
DateAttribute
smile.data

Class DateAttribute

  • All Implemented Interfaces:
    java.io.Serializable


    public class DateAttribute
    extends Attribute
    Data attribute. The default format string accepts the ISO-8601 combined date and time format: "yyyy-MM-dd'T'HH:mm:ss".
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DateAttribute(java.lang.String name)
      Constructor.
      DateAttribute(java.lang.String name, double weight)
      Constructor.
      DateAttribute(java.lang.String name, java.lang.String description, double weight)
      Constructor.
      DateAttribute(java.lang.String name, java.lang.String description, double weight, java.lang.String format)
      Constructor.
      DateAttribute(java.lang.String name, java.lang.String description, java.lang.String format)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.text.DateFormat getFormat()
      Returns the date string formatter.
      void setFormat(java.text.DateFormat format)
      Sets the date string formatter.
      void setFormat(java.lang.String format)
      Sets the date format.
      java.util.Date toDate(double x)
      Retruns the date object from internal double encoding.
      java.lang.String toString(java.util.Date date)
      Generate the date string.
      java.lang.String toString(double x)
      Returns the string representation of a double value of this attribute.
      double valueOf(java.util.Date date)
      Returns the double value representation of a data object.
      double valueOf(java.lang.String s)
      Returns the double value of a string of this attribute.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DateAttribute

        public DateAttribute(java.lang.String name)
        Constructor.
      • DateAttribute

        public DateAttribute(java.lang.String name,
                             double weight)
        Constructor.
      • DateAttribute

        public DateAttribute(java.lang.String name,
                             java.lang.String description,
                             double weight)
        Constructor.
      • DateAttribute

        public DateAttribute(java.lang.String name,
                             java.lang.String description,
                             java.lang.String format)
        Constructor.
        Parameters:
        name - the name of attribute.
        format - the date format.
      • DateAttribute

        public DateAttribute(java.lang.String name,
                             java.lang.String description,
                             double weight,
                             java.lang.String format)
        Constructor.
        Parameters:
        name - the name of attribute.
        format - the date format.
    • Method Detail

      • getFormat

        public java.text.DateFormat getFormat()
        Returns the date string formatter.
        Returns:
        the date string formatter.
      • setFormat

        public void setFormat(java.lang.String format)
        Sets the date format.
        Parameters:
        format - the date format string.
      • setFormat

        public void setFormat(java.text.DateFormat format)
        Sets the date string formatter.
        Parameters:
        format - the date string formatter.
      • toString

        public java.lang.String toString(java.util.Date date)
        Generate the date string.
      • toDate

        public java.util.Date toDate(double x)
        Retruns the date object from internal double encoding.
        Parameters:
        x - the date in double encoding.
      • valueOf

        public double valueOf(java.util.Date date)
        Returns the double value representation of a data object.
      • toString

        public java.lang.String toString(double x)
        Description copied from class: Attribute
        Returns the string representation of a double value of this attribute.
        Specified by:
        toString in class Attribute
        Parameters:
        x - a double value of this attribute. NaN means missing value.
        Returns:
        the string representation of x. For nominal, date and string attributes, null will be returned for missing values. For numeric attributes, "NaN" will be returned for missing values.
      • valueOf

        public double valueOf(java.lang.String s)
                       throws java.text.ParseException
        Description copied from class: Attribute
        Returns the double value of a string of this attribute.
        Specified by:
        valueOf in class Attribute
        Parameters:
        s - a string value of this attribute.
        Throws:
        java.text.ParseException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.