< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java

Print this page




  60  * printer supports this attribute, the printer must use its
  61  * (implementation-dependent) default JobHoldUntil value at job submission time
  62  * (unlike most job template attributes that are used if necessary at job
  63  * processing time).
  64  * <P>
  65  * To construct a JobHoldUntil attribute from separate values of the year,
  66  * month, day, hour, minute, and so on, use a {@link java.util.Calendar
  67  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  68  * the {@link java.util.Date Date} object to construct the JobHoldUntil
  69  * attribute. To convert a JobHoldUntil attribute to separate values of the
  70  * year, month, day, hour, minute, and so on, create a {@link java.util.Calendar
  71  * Calendar} object and set it to the {@link java.util.Date Date} from the
  72  * JobHoldUntil attribute.
  73  * <P>
  74  * <B>IPP Compatibility:</B> Although IPP supports a "job-hold-until" attribute
  75  * specified as a keyword, IPP does not at this time support a "job-hold-until"
  76  * attribute specified as a date and time. However, the date and time can be
  77  * converted to one of the standard IPP keywords with some loss of precision;
  78  * for example, a JobHoldUntil value with today's date and 9:00pm local time
  79  * might be converted to the standard IPP keyword "night". The category name
  80  * returned by <CODE>getName()</CODE> gives the IPP attribute name.
  81  *
  82  * @author  Alan Kaminsky
  83  */
  84 public final class JobHoldUntil extends DateTimeSyntax
  85         implements PrintRequestAttribute, PrintJobAttribute {
  86 
  87     private static final long serialVersionUID = -1664471048860415024L;
  88 
  89 
  90     /**
  91      * Construct a new job hold until date-time attribute with the given
  92      * {@link java.util.Date Date} value.
  93      *
  94      * @param  dateTime  {@link java.util.Date Date} value.
  95      *
  96      * @exception  NullPointerException
  97      *     (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
  98      */
  99     public JobHoldUntil(Date dateTime) {
 100         super (dateTime);
 101     }
 102 
 103     /**
 104      * Returns whether this job hold until attribute is equivalent to the
 105      * passed in object. To be equivalent, all of the following conditions
 106      * must be true:
 107      * <OL TYPE=1>
 108      * <LI>
 109      * <CODE>object</CODE> is not null.
 110      * <LI>
 111      * <CODE>object</CODE> is an instance of class JobHoldUntil.
 112      * <LI>
 113      * This job hold until attribute's {@link java.util.Date Date} value and
 114      * <CODE>object</CODE>'s {@link java.util.Date Date} value are equal.
 115      * </OL>
 116      *
 117      * @param  object  Object to compare to.
 118      *
 119      * @return  True if <CODE>object</CODE> is equivalent to this job hold
 120      *          until attribute, false otherwise.
 121      */
 122     public boolean equals(Object object) {
 123         return (super.equals(object) && object instanceof JobHoldUntil);
 124     }
 125 
 126 
 127     /**
 128      * Get the printing attribute class which is to be used as the "category"
 129      * for this printing attribute value.
 130      * <P>
 131      * For class JobHoldUntil, the category is class JobHoldUntil itself.
 132      *
 133      * @return  Printing attribute class (category), an instance of class
 134      *          {@link java.lang.Class java.lang.Class}.
 135      */
 136     public final Class<? extends Attribute> getCategory() {
 137         return JobHoldUntil.class;
 138     }
 139 
 140     /**
 141      * Get the name of the category of which this attribute value is an
 142      * instance.
 143      * <P>
 144      * For class JobHoldUntil, the category name is <CODE>"job-hold-until"</CODE>.
 145      *
 146      * @return  Attribute category name.
 147      */
 148     public final String getName() {
 149         return "job-hold-until";
 150     }
 151 
 152 }


  60  * printer supports this attribute, the printer must use its
  61  * (implementation-dependent) default JobHoldUntil value at job submission time
  62  * (unlike most job template attributes that are used if necessary at job
  63  * processing time).
  64  * <P>
  65  * To construct a JobHoldUntil attribute from separate values of the year,
  66  * month, day, hour, minute, and so on, use a {@link java.util.Calendar
  67  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  68  * the {@link java.util.Date Date} object to construct the JobHoldUntil
  69  * attribute. To convert a JobHoldUntil attribute to separate values of the
  70  * year, month, day, hour, minute, and so on, create a {@link java.util.Calendar
  71  * Calendar} object and set it to the {@link java.util.Date Date} from the
  72  * JobHoldUntil attribute.
  73  * <P>
  74  * <B>IPP Compatibility:</B> Although IPP supports a "job-hold-until" attribute
  75  * specified as a keyword, IPP does not at this time support a "job-hold-until"
  76  * attribute specified as a date and time. However, the date and time can be
  77  * converted to one of the standard IPP keywords with some loss of precision;
  78  * for example, a JobHoldUntil value with today's date and 9:00pm local time
  79  * might be converted to the standard IPP keyword "night". The category name
  80  * returned by {@code getName()} gives the IPP attribute name.
  81  *
  82  * @author  Alan Kaminsky
  83  */
  84 public final class JobHoldUntil extends DateTimeSyntax
  85         implements PrintRequestAttribute, PrintJobAttribute {
  86 
  87     private static final long serialVersionUID = -1664471048860415024L;
  88 
  89 
  90     /**
  91      * Construct a new job hold until date-time attribute with the given
  92      * {@link java.util.Date Date} value.
  93      *
  94      * @param  dateTime  {@link java.util.Date Date} value.
  95      *
  96      * @exception  NullPointerException
  97      *     (unchecked exception) Thrown if {@code dateTime} is null.
  98      */
  99     public JobHoldUntil(Date dateTime) {
 100         super (dateTime);
 101     }
 102 
 103     /**
 104      * Returns whether this job hold until attribute is equivalent to the
 105      * passed in object. To be equivalent, all of the following conditions
 106      * must be true:
 107      * <OL TYPE=1>
 108      * <LI>
 109      * {@code object} is not null.
 110      * <LI>
 111      * {@code object} is an instance of class JobHoldUntil.
 112      * <LI>
 113      * This job hold until attribute's {@link java.util.Date Date} value and
 114      * {@code object}'s {@link java.util.Date Date} value are equal.
 115      * </OL>
 116      *
 117      * @param  object  Object to compare to.
 118      *
 119      * @return  True if {@code object} is equivalent to this job hold
 120      *          until attribute, false otherwise.
 121      */
 122     public boolean equals(Object object) {
 123         return (super.equals(object) && object instanceof JobHoldUntil);
 124     }
 125 
 126 
 127     /**
 128      * Get the printing attribute class which is to be used as the "category"
 129      * for this printing attribute value.
 130      * <P>
 131      * For class JobHoldUntil, the category is class JobHoldUntil itself.
 132      *
 133      * @return  Printing attribute class (category), an instance of class
 134      *          {@link java.lang.Class java.lang.Class}.
 135      */
 136     public final Class<? extends Attribute> getCategory() {
 137         return JobHoldUntil.class;
 138     }
 139 
 140     /**
 141      * Get the name of the category of which this attribute value is an
 142      * instance.
 143      * <P>
 144      * For class JobHoldUntil, the category name is {@code "job-hold-until"}.
 145      *
 146      * @return  Attribute category name.
 147      */
 148     public final String getName() {
 149         return "job-hold-until";
 150     }
 151 
 152 }
< prev index next >