javax.print.attribute

Class DateTimeSyntax

  • All Implemented Interfaces:
    Serializable, Cloneable
    Direct Known Subclasses:
    DateTimeAtCompleted, DateTimeAtCreation, DateTimeAtProcessing, JobHoldUntil

    public abstract class DateTimeSyntax
    extends Object
    implements Serializable, Cloneable
    Class DateTimeSyntax is an abstract base class providing the common implementation of all attributes whose value is a date and time.

    Under the hood, a date-time attribute is stored as a value of class java.util.Date. You can get a date-time attribute's Date value by calling getValue(). A date-time attribute's Date value is established when it is constructed (see DateTimeSyntax(Date)). Once constructed, a date-time attribute's value is immutable.

    To construct a date-time attribute from separate values of the year, month, day, hour, minute, and so on, use a java.util.Calendar object to construct a java.util.Date object, then use the java.util.Date object to construct the date-time attribute. To convert a date-time attribute to separate values of the year, month, day, hour, minute, and so on, create a java.util.Calendar object and set it to the java.util.Date from the date-time attribute. Class DateTimeSyntax stores its value in the form of a java.util.Date rather than a java.util.Calendar because it typically takes less memory to store and less time to compare a java.util.Date than a java.util.Calendar.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected DateTimeSyntax(Date value)
      Construct a new date-time attribute with the given java.util.Date value.

        

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(Object object)
      Returns whether this date-time attribute is equivalent to the passed in object.
      Date getValue()
      Returns this date-time attribute's java.util.Date value.
      int hashCode()
      Returns a hash code value for this date-time attribute.
      String toString()
      Returns a string value corresponding to this date-time attribute.

        

    • Constructor Detail

      • DateTimeSyntax

        protected DateTimeSyntax(Date value)
        Construct a new date-time attribute with the given java.util.Date value.
        Parameters:
        value - java.util.Date value.
        Throws:
        NullPointerException - (unchecked exception) Thrown if theValue is null.
    • Method Detail

      • getValue

        public Date getValue()
        Returns this date-time attribute's java.util.Date value.
        Returns:
        the Date.
      • equals

        public boolean equals(Object object)
        Returns whether this date-time attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:
        1. object is not null.
        2. object is an instance of class DateTimeSyntax.
        3. This date-time attribute's java.util.Date value and object's java.util.Date value are equal.
        Overrides:
        equals in class Object
        Parameters:
        object - Object to compare to.
        Returns:
        True if object is equivalent to this date-time attribute, false otherwise.
        See Also:
        Object.hashCode(), HashMap
      • toString

        public String toString()
        Returns a string value corresponding to this date-time attribute. The string value is just this attribute's java.util.Date value converted to a string.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/print/attribute/DateTimeSyntax.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, DateTimeSyntax

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut