src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  30 import javax.print.attribute.PrintJobAttribute;
  31 
  32 /**
  33  * Class DateTimeAtCreation is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job was
  35  * created.
  36  * <P>
  37  * To construct a DateTimeAtCreation attribute from separate values of the year,
  38  * month, day, hour, minute, and so on, use a {@link java.util.Calendar
  39  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  40  * the {@link java.util.Date Date} object to construct the DateTimeAtCreation
  41  * attribute. To convert a DateTimeAtCreation attribute to separate values of
  42  * the year, month, day, hour, minute, and so on, create a {@link
  43  * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
  44  * Date} from the DateTimeAtCreation attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-creation" attribute can be obtained as described above. The
  48  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  49  * name.
  50  * <P>
  51  *
  52  * @author  Alan Kaminsky
  53  */
  54 public final class DateTimeAtCreation   extends DateTimeSyntax
  55         implements PrintJobAttribute {
  56 
  57     private static final long serialVersionUID = -2923732231056647903L;
  58 
  59     /**
  60      * Construct a new date-time at creation attribute with the given {@link
  61      * java.util.Date Date} value.
  62      *
  63      * @param  dateTime  {@link java.util.Date Date} value.
  64      *
  65      * @exception  NullPointerException
  66      *     (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
  67      */
  68     public DateTimeAtCreation(Date dateTime) {
  69         super (dateTime);
  70     }


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  30 import javax.print.attribute.PrintJobAttribute;
  31 
  32 /**
  33  * Class DateTimeAtCreation is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job was
  35  * created.
  36  * <P>
  37  * To construct a DateTimeAtCreation attribute from separate values of the year,
  38  * month, day, hour, minute, and so on, use a {@link java.util.Calendar
  39  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  40  * the {@link java.util.Date Date} object to construct the DateTimeAtCreation
  41  * attribute. To convert a DateTimeAtCreation attribute to separate values of
  42  * the year, month, day, hour, minute, and so on, create a {@link
  43  * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
  44  * Date} from the DateTimeAtCreation attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-creation" attribute can be obtained as described above. The
  48  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  49  * name.

  50  *
  51  * @author  Alan Kaminsky
  52  */
  53 public final class DateTimeAtCreation   extends DateTimeSyntax
  54         implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = -2923732231056647903L;
  57 
  58     /**
  59      * Construct a new date-time at creation attribute with the given {@link
  60      * java.util.Date Date} value.
  61      *
  62      * @param  dateTime  {@link java.util.Date Date} value.
  63      *
  64      * @exception  NullPointerException
  65      *     (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
  66      */
  67     public DateTimeAtCreation(Date dateTime) {
  68         super (dateTime);
  69     }