--- a/jdk/src/java.desktop/share/classes/javax/print/AttributeException.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/AttributeException.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,27 +28,22 @@
import javax.print.attribute.Attribute;
/**
- * Interface AttributeException is a mixin interface which a subclass of
- * {@link
- * PrintException PrintException} can implement to report an error condition
- * involving one or more printing attributes that a particular Print
+ * Interface {@code AttributeException} is a mixin interface which a subclass of
+ * {@link PrintException PrintException} can implement to report an error
+ * condition involving one or more printing attributes that a particular Print
* Service instance does not support. Either the attribute is not supported at
* all, or the attribute is supported but the particular specified value is not
- * supported. The Print Service API does not define any print exception
- * classes that implement interface AttributeException, that being left to the
+ * supported. The Print Service API does not define any print exception classes
+ * that implement interface {@code AttributeException}, that being left to the
* Print Service implementor's discretion.
- *
*/
-
public interface AttributeException {
-
/**
* Returns the array of printing attribute classes for which the Print
- * Service instance does not support the attribute at all, or null if
- * there are no such attributes. The objects in the returned array are
- * classes that extend the base interface
- * {@link javax.print.attribute.Attribute Attribute}.
+ * Service instance does not support the attribute at all, or {@code null}
+ * if there are no such attributes. The objects in the returned array are
+ * classes that extend the base interface {@link Attribute Attribute}.
*
* @return unsupported attribute classes
*/
@@ -57,10 +52,10 @@
/**
* Returns the array of printing attributes for which the Print Service
* instance supports the attribute but does not support that particular
- * value of the attribute, or null if there are no such attribute values.
+ * value of the attribute, or {@code null} if there are no such attribute
+ * values.
*
* @return unsupported attribute values
*/
public Attribute[] getUnsupportedValues();
-
- }
+}
--- a/jdk/src/java.desktop/share/classes/javax/print/CancelablePrintJob.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/CancelablePrintJob.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,52 +26,47 @@
package javax.print;
/**
- * This interface is used by a printing application to cancel a
- * print job. This interface extends {@link DocPrintJob}. A
- * {@code DocPrintJob} implementation returned from a print
- * service implements this interface if the print job can be
- * cancelled. Before trying to cancel
- * a print job, the client needs to test if the
- * {@code DocPrintJob} object returned from the print service
- * actually implements this interface. Clients should never assume
- * that a {@code DocPrintJob} implements this interface. A
- * print service might support cancellation only for certain types
- * of print data and representation class names. This means that
- * only some of the {@code DocPrintJob} objects returned from
- * a service will implement this interface.
+ * This interface is used by a printing application to cancel a print job. This
+ * interface extends {@link DocPrintJob}. A {@code DocPrintJob} implementation
+ * returned from a print service implements this interface if the print job can
+ * be cancelled. Before trying to cancel a print job, the client needs to test
+ * if the {@code DocPrintJob} object returned from the print service actually
+ * implements this interface. Clients should never assume that a
+ * {@code DocPrintJob} implements this interface. A print service might support
+ * cancellation only for certain types of print data and representation class
+ * names. This means that only some of the {@code DocPrintJob} objects returned
+ * from a service will implement this interface.
* <p>
- * Service implementors are encouraged to implement this optional interface
- * and to deliver a javax.print.event.PrintJobEvent.JOB_CANCELLED event
- * to any listeners if a job is successfully cancelled with an
- * implementation of this interface. Services should also note that an
- * implementation of this method may be made from a separate client thread
- * than that which made the print request. Thus the implementation of
- * this interface must be made thread safe.
+ * Service implementors are encouraged to implement this optional interface and
+ * to deliver a {@link javax.print.event.PrintJobEvent#JOB_CANCELED} event to
+ * any listeners if a job is successfully cancelled with an implementation of
+ * this interface. Services should also note that an implementation of this
+ * method may be made from a separate client thread than that which made the
+ * print request. Thus the implementation of this interface must be made thread
+ * safe.
*/
-
public interface CancelablePrintJob extends DocPrintJob {
/**
* Stops further processing of a print job.
* <p>
- * If a service supports this method it cannot be concluded that
- * job cancellation will always succeed. A job may not be able to be
- * cancelled once it has reached and passed some point in its processing.
- * A successful cancellation means only that the entire job was not
- * printed, some portion may already have printed when cancel returns.
+ * If a service supports this method it cannot be concluded that job
+ * cancellation will always succeed. A job may not be able to be cancelled
+ * once it has reached and passed some point in its processing. A successful
+ * cancellation means only that the entire job was not printed, some portion
+ * may already have printed when cancel returns.
* <p>
- * The service will throw a PrintException if the cancellation did not
- * succeed. A job which has not yet been submitted for printing should
- * throw this exception.
- * Cancelling an already successfully cancelled Print Job is not
- * considered an error and will always succeed.
+ * The service will throw a {@code PrintException} if the cancellation did
+ * not succeed. A job which has not yet been submitted for printing should
+ * throw this exception. Cancelling an already successfully cancelled Print
+ * Job is not considered an error and will always succeed.
* <p>
* Cancellation in some services may be a lengthy process, involving
- * requests to a server and processing of its print queue. Clients
- * may wish to execute cancel in a thread which does not affect
- * application execution.
- * @throws PrintException if the job could not be successfully cancelled.
+ * requests to a server and processing of its print queue. Clients may wish
+ * to execute cancel in a thread which does not affect application
+ * execution.
+ *
+ * @throws PrintException if the job could not be successfully cancelled
*/
public void cancel() throws PrintException;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/Doc.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/Doc.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,181 +25,165 @@
package javax.print;
+import java.io.IOException;
import java.io.InputStream;
-import java.io.IOException;
import java.io.Reader;
import javax.print.attribute.DocAttributeSet;
-
/**
- * Interface Doc specifies the interface for an object that supplies one piece
- * of print data for a Print Job. "Doc" is a short, easy-to-pronounce term
+ * Interface {@code Doc} specifies the interface for an object that supplies one
+ * piece of print data for a Print Job. "Doc" is a short, easy-to-pronounce term
* that means "a piece of print data." The client passes to the Print Job an
- * object that implements interface Doc, and the Print Job calls methods on
- * that object to obtain the print data. The Doc interface lets a Print Job:
- * <UL>
- * <LI>
- * Determine the format, or "doc flavor" (class {@link DocFlavor DocFlavor}),
- * in which the print data is available. A doc flavor designates the print
- * data format (a MIME type) and the representation class of the object
- * from which the print data comes.
- *
- * <LI>
- * Obtain the print data representation object, which is an instance of the
- * doc flavor's representation class. The Print Job can then obtain the actual
- * print data from the representation object.
- *
- * <LI>
- * Obtain the printing attributes that specify additional characteristics of
- * the doc or that specify processing instructions to be applied to the doc.
- * Printing attributes are defined in package {@link javax.print.attribute
- * javax.print.attribute}. The doc returns its printing attributes stored in
- * an {@link javax.print.attribute.DocAttributeSet javax.print.attribute.DocAttributeSet}.
- * </UL>
- * <P>
- * Each method in an implementation of interface Doc is permitted always to
- * return the same object each time the method is called.
- * This has implications
- * for a Print Job or other caller of a doc object whose print data
+ * object that implements interface {@code Doc}, and the Print Job calls methods
+ * on that object to obtain the print data. The {@code Doc} interface lets a
+ * Print Job:
+ * <ul>
+ * <li>Determine the format, or "doc flavor" (class
+ * {@link DocFlavor DocFlavor}), in which the print data is available. A doc
+ * flavor designates the print data format (a MIME type) and the
+ * representation class of the object from which the print data comes.
+ * <li>Obtain the print data representation object, which is an instance of
+ * the doc flavor's representation class. The Print Job can then obtain the
+ * actual print data from the representation object.
+ * <li>Obtain the printing attributes that specify additional characteristics
+ * of the doc or that specify processing instructions to be applied to the
+ * doc. Printing attributes are defined in package
+ * {@link javax.print.attribute}. The doc returns its printing attributes
+ * stored in an {@link DocAttributeSet javax.print.attribute.DocAttributeSet}.
+ * </ul>
+ * Each method in an implementation of interface {@code Doc} is permitted always
+ * to return the same object each time the method is called. This has
+ * implications for a Print Job or other caller of a doc object whose print data
* representation object "consumes" the print data as the caller obtains the
* print data, such as a print data representation object which is a stream.
- * Once the Print Job has called {@link #getPrintData()
- * getPrintData()} and obtained the stream, any further calls to
- * {@link #getPrintData() getPrintData()} will return the same
- * stream object upon which reading may already be in progress, <I>not</I> a new
- * stream object that will re-read the print data from the beginning. Specifying
- * a doc object to behave this way simplifies the implementation of doc objects,
- * and is justified on the grounds that a particular doc is intended to convey
- * print data only to one Print Job, not to several different Print Jobs. (To
- * convey the same print data to several different Print Jobs, you have to
- * create several different doc objects on top of the same print data source.)
- * <P>
- * Interface Doc affords considerable implementation flexibility. The print data
- * might already be in existence when the doc object is constructed. In this
- * case the objects returned by the doc's methods can be supplied to the doc's
- * constructor, be stored in the doc ahead of time, and simply be returned when
- * called for. Alternatively, the print data might not exist yet when the doc
- * object is constructed. In this case the doc object might provide a "lazy"
+ * Once the Print Job has called {@link #getPrintData() getPrintData()} and
+ * obtained the stream, any further calls to {@link #getPrintData()
+ * getPrintData()} will return the same stream object upon which reading may
+ * already be in progress, <i>not</i> a new stream object that will re-read the
+ * print data from the beginning. Specifying a doc object to behave this way
+ * simplifies the implementation of doc objects, and is justified on the grounds
+ * that a particular doc is intended to convey print data only to one Print Job,
+ * not to several different Print Jobs. (To convey the same print data to
+ * several different Print Jobs, you have to create several different doc
+ * objects on top of the same print data source.)
+ * <p>
+ * Interface {@code Doc} affords considerable implementation flexibility. The
+ * print data might already be in existence when the doc object is constructed.
+ * In this case the objects returned by the doc's methods can be supplied to the
+ * doc's constructor, be stored in the doc ahead of time, and simply be returned
+ * when called for. Alternatively, the print data might not exist yet when the
+ * doc object is constructed. In this case the doc object might provide a "lazy"
* implementation that generates the print data representation object (and/or
* the print data) only when the Print Job calls for it (when the Print Job
* calls the {@link #getPrintData() getPrintData()} method).
- * <P>
+ * <p>
* There is no restriction on the number of client threads that may be
* simultaneously accessing the same doc. Therefore, all implementations of
- * interface Doc must be designed to be multiple thread safe.
+ * interface {@code Doc} must be designed to be multiple thread safe.
* <p>
* However there can only be one consumer of the print data obtained from a
- * Doc.
+ * {@code Doc}.
* <p>
- * If print data is obtained from the client as a stream, by calling Doc's
- * {@code getReaderForText()} or {@code getStreamForBytes()}
- * methods, or because the print data source is already an InputStream or
- * Reader, then the print service should always close these streams for the
- * client on all job completion conditions. With the following caveat.
- * If the print data is itself a stream, the service will always close it.
- * If the print data is otherwise something that can be requested as a stream,
- * the service will only close the stream if it has obtained the stream before
- * terminating. That is, just because a print service might request data as
- * a stream does not mean that it will, with the implications that Doc
+ * If print data is obtained from the client as a stream, by calling
+ * {@code Doc}'s {@code getReaderForText()} or {@code getStreamForBytes()}
+ * methods, or because the print data source is already an {@code InputStream}
+ * or {@code Reader}, then the print service should always close these streams
+ * for the client on all job completion conditions. With the following caveat.
+ * If the print data is itself a stream, the service will always close it. If
+ * the print data is otherwise something that can be requested as a stream, the
+ * service will only close the stream if it has obtained the stream before
+ * terminating. That is, just because a print service might request data as a
+ * stream does not mean that it will, with the implications that {@code Doc}
* implementors which rely on the service to close them should create such
* streams only in response to a request from the service.
- * <HR>
*/
public interface Doc {
/**
- * Determines the doc flavor in which this doc object will supply its
- * piece of print data.
+ * Determines the doc flavor in which this doc object will supply its piece
+ * of print data.
*
- * @return Doc flavor.
+ * @return doc flavor
*/
public DocFlavor getDocFlavor();
/**
* Obtains the print data representation object that contains this doc
- * object's piece of print data in the format corresponding to the
- * supported doc flavor.
- * The {@code getPrintData()} method returns an instance of
- * the representation class whose name is given by {@link
- * #getDocFlavor() getDocFlavor()}.{@link
- * DocFlavor#getRepresentationClassName()
- * getRepresentationClassName()}, and the return value can be cast
- * from class Object to that representation class.
+ * object's piece of print data in the format corresponding to the supported
+ * doc flavor. The {@code getPrintData()} method returns an instance of the
+ * representation class whose name is given by{@link #getDocFlavor()
+ * getDocFlavor()}.{@link DocFlavor#getRepresentationClassName()
+ * getRepresentationClassName()}, and the return value can be cast from
+ * class {@code Object} to that representation class.
*
- * @return Print data representation object.
- *
- * @exception IOException
- * Thrown if the representation class is a stream and there was an I/O
- * error while constructing the stream.
+ * @return print data representation object
+ * @throws IOException if the representation class is a stream and there was
+ * an I/O error while constructing the stream
*/
public Object getPrintData() throws IOException;
/**
* Obtains the set of printing attributes for this doc object. If the
* returned attribute set includes an instance of a particular attribute
- * <I>X,</I> the printer must use that attribute value for this doc,
- * overriding any value of attribute <I>X</I> in the job's attribute set.
- * If the returned attribute set does not include an instance
- * of a particular attribute <I>X</I> or if null is returned, the printer
- * must consult the job's attribute set to obtain the value for
- * attribute <I>X,</I> and if not found there, the printer must use an
+ * <i>X,</i> the printer must use that attribute value for this doc,
+ * overriding any value of attribute <i>X</i> in the job's attribute set. If
+ * the returned attribute set does not include an instance of a particular
+ * attribute <i>X</i> or if {@code null} is returned, the printer must
+ * consult the job's attribute set to obtain the value for attribute
+ * <i>X,</i> and if not found there, the printer must use an
* implementation-dependent default value. The returned attribute set is
* unmodifiable.
*
- * @return Unmodifiable set of printing attributes for this doc, or null
- * to obtain all attribute values from the job's attribute
- * set.
+ * @return unmodifiable set of printing attributes for this doc, or
+ * {@code null} to obtain all attribute values from the job's
+ * attribute set
*/
public DocAttributeSet getAttributes();
/**
- * Obtains a reader for extracting character print data from this doc.
- * The Doc implementation is required to support this method if the
- * DocFlavor has one of the following print data representation classes,
- * and return null otherwise:
- * <UL>
- * <LI> char[]
- * <LI> java.lang.String
- * <LI> java.io.Reader
- * </UL>
+ * Obtains a reader for extracting character print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes, and return {@code null} otherwise:
+ * <ul>
+ * <li>char[]
+ * <li>java.lang.String
+ * <li>java.io.Reader
+ * </ul>
* The doc's print data representation object is used to construct and
- * return a Reader for reading the print data as a stream of characters
- * from the print data representation object.
- * However, if the print data representation object is itself a Reader,
- * then the print data representation object is simply returned.
+ * return a {@code Reader} for reading the print data as a stream of
+ * characters from the print data representation object. However, if the
+ * print data representation object is itself a {@code Reader}, then the
+ * print data representation object is simply returned.
*
- * @return Reader for reading the print data characters from this doc.
- * If a reader cannot be provided because this doc does not meet
- * the criteria stated above, null is returned.
- *
- * @exception IOException
- * Thrown if there was an I/O error while creating the reader.
+ * @return reader for reading the print data characters from this doc. If a
+ * reader cannot be provided because this doc does not meet the
+ * criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the reader
*/
public Reader getReaderForText() throws IOException;
/**
- * Obtains an input stream for extracting byte print data from this
- * doc. The Doc implementation is required to support this method if
- * the DocFlavor has one of the following print data representation
- * classes, and return null otherwise:
- * <UL>
- * <LI> byte[]
- * <LI> java.io.InputStream
- * </UL>
+ * Obtains an input stream for extracting byte print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes, and return {@code null} otherwise:
+ * <ul>
+ * <li>byte[]
+ * <li>java.io.InputStream
+ * </ul>
* This doc's print data representation object is obtained, then an input
* stream for reading the print data from the print data representation
* object as a stream of bytes is created and returned. However, if the
* print data representation object is itself an input stream, then the
* print data representation object is simply returned.
*
- * @return Input stream for reading the print data bytes from this doc. If
- * an input stream cannot be provided because this doc does not
- * meet the criteria stated above, null is returned.
- *
- * @exception IOException
- * Thrown if there was an I/O error while creating the input stream.
+ * @return input stream for reading the print data bytes from this doc. If
+ * an input stream cannot be provided because this doc does not meet
+ * the criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the input
+ * stream
*/
public InputStream getStreamForBytes() throws IOException;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/DocFlavor.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/DocFlavor.java Thu Aug 31 15:47:34 2017 -0700
@@ -30,447 +30,376 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
-
/**
- * Class {@code DocFlavor} encapsulates an object that specifies the
- * format in which print data is supplied to a {@link DocPrintJob}.
- * "Doc" is a short, easy-to-pronounce term that means "a piece of print data."
- * The print data format, or "doc flavor", consists of two things:
- * <UL>
- * <LI>
- * <B>MIME type.</B> This is a Multipurpose Internet Mail Extensions (MIME)
- * media type (as defined in <A HREF="http://www.ietf.org/rfc/rfc2045.txt">RFC
- * 2045</A> and <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>)
- * that specifies how the print data is to be interpreted.
- * The charset of text data should be the IANA MIME-preferred name, or its
- * canonical name if no preferred name is specified. Additionally a few
- * historical names supported by earlier versions of the Java platform may
- * be recognized.
- * See <a href="../../java/lang/package-summary.html#charenc">
- * character encodings</a> for more information on the character encodings
- * supported on the Java platform.
+ * Class {@code DocFlavor} encapsulates an object that specifies the format in
+ * which print data is supplied to a {@link DocPrintJob}. "Doc" is a short,
+ * easy-to-pronounce term that means "a piece of print data." The print data
+ * format, or "doc flavor", consists of two things:
+ * <ul>
+ * <li><b>MIME type.</b> This is a Multipurpose Internet Mail Extensions
+ * (MIME) media type (as defined in
+ * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> and
+ * <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>) that specifies
+ * how the print data is to be interpreted. The charset of text data should be
+ * the IANA MIME-preferred name, or its canonical name if no preferred name is
+ * specified. Additionally a few historical names supported by earlier
+ * versions of the Java platform may be recognized. See
+ * <a href="../../java/lang/package-summary.html#charenc">character encodings
+ * </a> for more information on the character encodings supported on the Java
+ * platform.
+ * <li><b>Representation class name.</b> This specifies the fully-qualified
+ * name of the class of the object from which the actual print data comes, as
+ * returned by the {@link Class#getName() Class.getName()} method. (Thus the
+ * class name for {@code byte[]} is {@code "[B"}, for {@code char[]} it is
+ * {@code "[C"}.)
+ * </ul>
+ * A {@code DocPrintJob} obtains its print data by means of interface
+ * {@link Doc Doc}. A {@code Doc} object lets the {@code DocPrintJob} determine
+ * the doc flavor the client can supply. A {@code Doc} object also lets the
+ * {@code DocPrintJob} obtain an instance of the doc flavor's representation
+ * class, from which the {@code DocPrintJob} then obtains the actual print data.
*
- * <LI>
- * <B>Representation class name.</B> This specifies the fully-qualified name of
- * the class of the object from which the actual print data comes, as returned
- * by the {@link java.lang.Class#getName() Class.getName()} method.
- * (Thus the class name for {@code byte[]} is {@code "[B"}, for
- * {@code char[]} it is {@code "[C"}.)
- * </UL>
- * <P>
- * A {@code DocPrintJob} obtains its print data by means of interface
- * {@link Doc Doc}. A {@code Doc} object lets the {@code DocPrintJob}
- * determine the doc flavor the client can supply. A {@code Doc} object
- * also lets the {@code DocPrintJob} obtain an instance of the doc flavor's
- * representation class, from which the {@code DocPrintJob} then obtains
- * the actual print data.
- *
- * <HR>
- * <H3>Client Formatted Print Data</H3>
- * There are two broad categories of print data, client formatted print data
- * and service formatted print data.
- * <P>
- * For <B>client formatted print data</B>, the client determines or knows the
- * print data format.
- * For example the client may have a JPEG encoded image, a URL for
- * HTML code, or a disk file containing plain text in some encoding,
- * possibly obtained from an external source, and
- * requires a way to describe the data format to the print service.
+ * <hr>
+ * <h3>Client Formatted Print Data</h3>
+ * There are two broad categories of print data, client formatted print data and
+ * service formatted print data.
+ * <p>
+ * For <b>client formatted print data</b>, the client determines or knows the
+ * print data format. For example the client may have a JPEG encoded image, a
+ * {@code URL} for HTML code, or a disk file containing plain text in some
+ * encoding, possibly obtained from an external source, and requires a way to
+ * describe the data format to the print service.
* <p>
* The doc flavor's representation class is a conduit for the JPS
- * {@code DocPrintJob} to obtain a sequence of characters or
- * bytes from the client. The
- * doc flavor's MIME type is one of the standard media types telling how to
- * interpret the sequence of characters or bytes. For a list of standard media
- * types, see the Internet Assigned Numbers Authority's (IANA's) <A
- * HREF="http://www.iana.org/assignments/media-types/">Media Types
- * Directory</A>. Interface {@link Doc Doc} provides two utility operations,
+ * {@code DocPrintJob} to obtain a sequence of characters or bytes from the
+ * client. The doc flavor's MIME type is one of the standard media types telling
+ * how to interpret the sequence of characters or bytes. For a list of standard
+ * media types, see the Internet Assigned Numbers Authority's (IANA's)
+ * <a href="http://www.iana.org/assignments/media-types/">Media Types Directory
+ * </a>. Interface {@link Doc Doc} provides two utility operations,
* {@link Doc#getReaderForText() getReaderForText} and
- * {@link Doc#getStreamForBytes() getStreamForBytes()}, to help a
- * {@code Doc} object's client extract client formatted print data.
- * <P>
+ * {@link Doc#getStreamForBytes() getStreamForBytes()}, to help a {@code Doc}
+ * object's client extract client formatted print data.
+ * <p>
* For client formatted print data, the print data representation class is
* typically one of the following (although other representation classes are
* permitted):
- * <UL>
- * <LI>
- * Character array ({@code char[]}) -- The print data consists of the
- * Unicode characters in the array.
- *
- * <LI>
- * {@code String} --
- * The print data consists of the Unicode characters in the string.
- *
- * <LI>
- * Character stream ({@link java.io.Reader java.io.Reader})
- * -- The print data consists of the Unicode characters read from the stream
- * up to the end-of-stream.
- *
- * <LI>
- * Byte array ({@code byte[]}) -- The print data consists of the bytes in
- * the array. The bytes are encoded in the character set specified by the doc
- * flavor's MIME type. If the MIME type does not specify a character set, the
- * default character set is US-ASCII.
+ * <ul>
+ * <li>Character array ({@code char[]}) -- The print data consists of the
+ * Unicode characters in the array.
+ * <li>{@code String} -- The print data consists of the Unicode characters in
+ * the string.
+ * <li>Character stream ({@link java.io.Reader java.io.Reader}) -- The print
+ * data consists of the Unicode characters read from the stream up to the
+ * end-of-stream.
+ * <li>Byte array ({@code byte[]}) -- The print data consists of the bytes in
+ * the array. The bytes are encoded in the character set specified by the doc
+ * flavor's MIME type. If the MIME type does not specify a character set, the
+ * default character set is US-ASCII.
+ * <li>Byte stream ({@link java.io.InputStream java.io.InputStream}) -- The
+ * print data consists of the bytes read from the stream up to the
+ * end-of-stream. The bytes are encoded in the character set specified by the
+ * doc flavor's MIME type. If the MIME type does not specify a character set,
+ * the default character set is US-ASCII.
+ * <li>Uniform Resource Locator ({@link java.net.URL URL}) -- The print data
+ * consists of the bytes read from the URL location. The bytes are encoded in
+ * the character set specified by the doc flavor's MIME type. If the MIME type
+ * does not specify a character set, the default character set is US-ASCII.
+ * When the representation class is a {@code URL}, the print service itself
+ * accesses and downloads the document directly from its {@code URL} address,
+ * without involving the client. The service may be some form of network print
+ * service which is executing in a different environment. This means you
+ * should not use a {@code URL} print data flavor to print a document at a
+ * restricted {@code URL} that the client can see but the printer cannot see.
+ * This also means you should not use a {@code URL} print data flavor to print
+ * a document stored in a local file that is not available at a {@code URL}
+ * accessible independently of the client. For example, a file that is not
+ * served up by an HTTP server or FTP server. To print such documents, let the
+ * client open an input stream on the {@code URL} or file and use an input
+ * stream data flavor.
+ * </ul>
*
- * <LI>
- * Byte stream ({@link java.io.InputStream java.io.InputStream}) --
- * The print data consists of the bytes read from the stream up to the
- * end-of-stream. The bytes are encoded in the character set specified by the
- * doc flavor's MIME type. If the MIME type does not specify a character set,
- * the default character set is US-ASCII.
-
- * <LI>
- * Uniform Resource Locator ({@link java.net.URL URL})
- * -- The print data consists of the bytes read from the URL location.
- * The bytes are encoded in the character set specified by the doc flavor's
- * MIME type. If the MIME type does not specify a character set, the default
- * character set is US-ASCII.
- * <P>
- * When the representation class is a URL, the print service itself accesses
- * and downloads the document directly from its URL address, without involving
- * the client. The service may be some form of network print service which
- * is executing in a different environment.
- * This means you should not use a URL print data flavor to print a
- * document at a restricted URL that the client can see but the printer cannot
- * see. This also means you should not use a URL print data flavor to print a
- * document stored in a local file that is not available at a URL
- * accessible independently of the client.
- * For example, a file that is not served up by an HTTP server or FTP server.
- * To print such documents, let the client open an input stream on the URL
- * or file and use an input stream data flavor.
- * </UL>
- *
- * <HR>
+ * <hr>
* <h3>Default and Platform Encodings</h3>
- * <P>
* For byte print data where the doc flavor's MIME type does not include a
* {@code charset} parameter, the Java Print Service instance assumes the
* US-ASCII character set by default. This is in accordance with
- * <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>, which says the
- * default character set is US-ASCII. Note that US-ASCII is a subset of
- * UTF-8, so in the future this may be widened if a future RFC endorses
- * UTF-8 as the default in a compatible manner.
+ * <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>, which says the
+ * default character set is US-ASCII. Note that US-ASCII is a subset of UTF-8,
+ * so in the future this may be widened if a future RFC endorses UTF-8 as the
+ * default in a compatible manner.
* <p>
- * Also note that this is different than the behaviour of the Java runtime
- * when interpreting a stream of bytes as text data. That assumes the
- * default encoding for the user's locale. Thus, when spooling a file in local
- * encoding to a Java Print Service it is important to correctly specify
- * the encoding. Developers working in the English locales should
- * be particularly conscious of this, as their platform encoding corresponds
- * to the default mime charset. By this coincidence that particular
- * case may work without specifying the encoding of platform data.
+ * Also note that this is different than the behaviour of the Java runtime when
+ * interpreting a stream of bytes as text data. That assumes the default
+ * encoding for the user's locale. Thus, when spooling a file in local encoding
+ * to a Java Print Service it is important to correctly specify the encoding.
+ * Developers working in the English locales should be particularly conscious of
+ * this, as their platform encoding corresponds to the default mime charset. By
+ * this coincidence that particular case may work without specifying the
+ * encoding of platform data.
* <p>
* Every instance of the Java virtual machine has a default character encoding
* determined during virtual-machine startup and typically depends upon the
- * locale and charset being used by the underlying operating system.
- * In a distributed environment there is no guarantee that two VM share
- * the same default encoding. Thus clients which want to stream platform
- * encoded text data from the host platform to a Java Print Service instance
- * must explicitly declare the charset and not rely on defaults.
+ * locale and charset being used by the underlying operating system. In a
+ * distributed environment there is no guarantee that two VM share the same
+ * default encoding. Thus clients which want to stream platform encoded text
+ * data from the host platform to a Java Print Service instance must explicitly
+ * declare the charset and not rely on defaults.
* <p>
* The preferred form is the official IANA primary name for an encoding.
- * Applications which stream text data should always specify the charset
- * in the mime type, which necessitates obtaining the encoding of the host
- * platform for data (eg files) stored in that platform's encoding.
- * A CharSet which corresponds to this and is suitable for use in a
- * mime-type for a DocFlavor can be obtained
- * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding}
- * This may not always be the primary IANA name but is guaranteed to be
- * understood by this VM.
- * For common flavors, the pre-defined *HOST DocFlavors may be used.
+ * Applications which stream text data should always specify the charset in the
+ * mime type, which necessitates obtaining the encoding of the host platform for
+ * data (eg files) stored in that platform's encoding. A {@code CharSet} which
+ * corresponds to this and is suitable for use in a mime-type for a
+ * {@code DocFlavor} can be obtained from
+ * {@link DocFlavor#hostEncoding DocFlavor.hostEncoding} This may not always be
+ * the primary IANA name but is guaranteed to be understood by this VM. For
+ * common flavors, the pre-defined *HOST {@code DocFlavors} may be used.
* <p>
- * See <a href="../../java/lang/package-summary.html#charenc">
- * character encodings</a> for more information on the character encodings
- * supported on the Java platform.
- * <HR>
- * <h3>Recommended DocFlavors</h3>
- * <P>
- * The Java Print Service API does not define any mandatorily supported
- * DocFlavors.
- * However, here are some examples of MIME types that a Java Print Service
- * instance might support for client formatted print data.
- * Nested classes inside class DocFlavor declare predefined static
- * constant DocFlavor objects for these example doc flavors; class DocFlavor's
- * constructor can be used to create an arbitrary doc flavor.
- * <UL>
- * <LI>Preformatted text
- * <table class="striped">
- * <caption>MIME-Types and their descriptions</caption>
- * <thead>
- * <TR>
- * <TH>MIME-Type</TH><TH>Description</TH>
- * </TR>
- * </thead>
- * <tbody>
- * <TR>
- * <TD>{@code "text/plain"}</TD>
- * <TD>Plain text in the default character set (US-ASCII)</TD>
- * </TR>
- * <TR>
- * <TD><code>"text/plain; charset=<I>xxx</I>"</code></TD>
- * <TD>Plain text in character set <I>xxx</I></TD>
- * </TR>
- * <TR>
- * <TD>{@code "text/html"}</TD>
- * <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>
- * </TR>
- * <TR>
- * <TD><code>"text/html; charset=<I>xxx</I>"</code></TD>
- * <TD>HyperText Markup Language in character set <I>xxx</I></TD>
- * </TR>
- * </tbody>
- * </TABLE>
- * <P>
- * In general, preformatted text print data is provided either in a character
- * oriented representation class (character array, String, Reader) or in a
- * byte oriented representation class (byte array, InputStream, URL).
- *
- * <LI>Preformatted page description language (PDL) documents
+ * See <a href="../../java/lang/package-summary.html#charenc">character
+ * encodings</a> for more information on the character encodings supported on
+ * the Java platform.
*
- * <table class="striped">
- * <caption>MIME-Types and their descriptions</caption>
- * <thead>
- * <TR>
- * <TH>MIME-Type</TH><TH>Description</TH>
- * </TR>
- * </thead>
- * <tbody>
- * <TR>
- * <TD>{@code "application/pdf"}</TD>
- * <TD>Portable Document Format document</TD>
- * </TR>
- * <TR>
- * <TD>{@code "application/postscript"}</TD>
- * <TD>PostScript document</TD>
- * </TR>
- * <TR>
- * <TD>{@code "application/vnd.hp-PCL"}</TD>
- * <TD>Printer Control Language document</TD>
- * </TR>
- * </tbody>
- * </TABLE>
- * <P>
- * In general, preformatted PDL print data is provided in a byte oriented
- * representation class (byte array, InputStream, URL).
- *
- * <LI>Preformatted images
+ * <hr>
+ * <h3>Recommended DocFlavors</h3>
+ * The Java Print Service API does not define any mandatorily supported
+ * {@code DocFlavors}. However, here are some examples of MIME types that a Java
+ * Print Service instance might support for client formatted print data. Nested
+ * classes inside class {@code DocFlavor} declare predefined static constant
+ * {@code DocFlavor} objects for these example doc flavors; class
+ * {@code DocFlavor}'s constructor can be used to create an arbitrary doc
+ * flavor.
+ * <ul>
+ * <li>Preformatted text
+ * <table class="striped">
+ * <caption>MIME-Types and their descriptions</caption>
+ * <thead>
+ * <tr>
+ * <th>MIME-Type
+ * <th>Description
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>{@code "text/plain"}
+ * <td>Plain text in the default character set (US-ASCII)
+ * <tr>
+ * <td><code> "text/plain; charset=<i>xxx</i>"</code>
+ * <td>Plain text in character set <i>xxx</i>
+ * <tr>
+ * <td>{@code "text/html"}
+ * <td>HyperText Markup Language in the default character set (US-ASCII)
+ * <tr>
+ * <td><code> "text/html; charset=<i>xxx</i>"</code>
+ * <td>HyperText Markup Language in character set <i>xxx</i>
+ * </tbody>
+ * </table>
+ * In general, preformatted text print data is provided either in a character
+ * oriented representation class (character array, String, Reader) or in a
+ * byte oriented representation class (byte array, InputStream, URL).
+ * <li>Preformatted page description language (PDL) documents
+ * <table class="striped">
+ * <caption>MIME-Types and their descriptions</caption>
+ * <thead>
+ * <tr>
+ * <th>MIME-Type
+ * <th>Description
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>{@code "application/pdf"}
+ * <td>Portable Document Format document
+ * <tr>
+ * <td>{@code "application/postscript"}
+ * <td>PostScript document
+ * <tr>
+ * <td>{@code "application/vnd.hp-PCL"}
+ * <td>Printer Control Language document
+ * </tbody>
+ * </table>
+ * In general, preformatted PDL print data is provided in a byte oriented
+ * representation class (byte array, {@code InputStream}, {@code URL}).
+ * <li>Preformatted images
+ * <table class="striped">
+ * <caption>MIME-Types and their descriptions</caption>
+ * <thead>
+ * <tr>
+ * <th>MIME-Type
+ * <th>Description
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>{@code "image/gif"}
+ * <td>Graphics Interchange Format image
+ * <tr>
+ * <td>{@code "image/jpeg"}
+ * <td>Joint Photographic Experts Group image
+ * <tr>
+ * <td>{@code "image/png"}
+ * <td>Portable Network Graphics image
+ * </tbody>
+ * </table>
+ * In general, preformatted image print data is provided in a byte oriented
+ * representation class (byte array, {@code InputStream}, {@code URL}).
+ * <li>Preformatted autosense print data
+ * <table class="striped">
+ * <caption>MIME-Types and their descriptions</caption>
+ * <thead>
+ * <tr>
+ * <th>MIME-Type
+ * <th>Description
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>{@code "application/octet-stream"}
+ * <td>The print data format is unspecified (just an octet stream)
+ * </tbody>
+ * </table>
+ * The printer decides how to interpret the print data; the way this
+ * "autosensing" works is implementation dependent. In general, preformatted
+ * autosense print data is provided in a byte oriented representation class
+ * (byte array, {@code InputStream}, {@code URL}).
+ * </ul>
*
- * <table class="striped">
- * <caption>MIME-Types and their descriptions</caption>
- * <thead>
- * <TR>
- * <TH>MIME-Type</TH><TH>Description</TH>
- * </TR>
- * </thead>
- * <tbody>
- * <TR>
- * <TD>{@code "image/gif"}</TD>
- * <TD>Graphics Interchange Format image</TD>
- * </TR>
- * <TR>
- * <TD>{@code "image/jpeg"}</TD>
- * <TD>Joint Photographic Experts Group image</TD>
- * </TR>
- * <TR>
- * <TD>{@code "image/png"}</TD>
- * <TD>Portable Network Graphics image</TD>
- * </TR>
- * </tbody>
- * </TABLE>
- * <P>
- * In general, preformatted image print data is provided in a byte oriented
- * representation class (byte array, InputStream, URL).
- *
- * <LI>Preformatted autosense print data
- *
- * <table class="striped">
- * <caption>MIME-Types and their descriptions</caption>
- * <thead>
- * <TR>
- * <TH>MIME-Type</TH><TH>Description</TH>
- * </TR>
- * </thead>
- * <tbody>
- * <TR>
- * <TD>{@code "application/octet-stream"}</TD>
- * <TD>The print data format is unspecified (just an octet stream)</TD>
- * </TR>
- * </tbody>
- * </TABLE>
- * <P>
- * The printer decides how to interpret the print data; the way this
- * "autosensing" works is implementation dependent. In general, preformatted
- * autosense print data is provided in a byte oriented representation class
- * (byte array, InputStream, URL).
- * </UL>
- *
- * <HR>
- * <H3>Service Formatted Print Data</H3>
- * <P>
- * For <B>service formatted print data</B>, the Java Print Service instance
+ * <hr>
+ * <h3>Service Formatted Print Data</h3>
+ * For <b>service formatted print data</b>, the Java Print Service instance
* determines the print data format. The doc flavor's representation class
* denotes an interface whose methods the {@code DocPrintJob} invokes to
- * determine the content to be printed -- such as a renderable image
- * interface or a Java printable interface.
- * The doc flavor's MIME type is the special value
- * {@code "application/x-java-jvm-local-objectref"} indicating the client
- * will supply a reference to a Java object that implements the interface
- * named as the representation class.
- * This MIME type is just a placeholder; what's
+ * determine the content to be printed -- such as a renderable image interface
+ * or a Java printable interface. The doc flavor's MIME type is the special
+ * value {@code "application/x-java-jvm-local-objectref"} indicating the client
+ * will supply a reference to a Java object that implements the interface named
+ * as the representation class. This MIME type is just a placeholder; what's
* important is the print data representation class.
- * <P>
+ * <p>
* For service formatted print data, the print data representation class is
* typically one of the following (although other representation classes are
- * permitted). Nested classes inside class DocFlavor declare predefined static
- * constant DocFlavor objects for these example doc flavors; class DocFlavor's
- * constructor can be used to create an arbitrary doc flavor.
- * <UL>
- * <LI>
- * Renderable image object -- The client supplies an object that implements
- * interface
- * {@link java.awt.image.renderable.RenderableImage RenderableImage}. The
- * printer calls methods
- * in that interface to obtain the image to be printed.
- *
- * <LI>
- * Printable object -- The client supplies an object that implements interface
- * {@link java.awt.print.Printable Printable}.
- * The printer calls methods in that interface to obtain the pages to be
- * printed, one by one.
- * For each page, the printer supplies a graphics context, and whatever the
- * client draws in that graphics context gets printed.
- *
- * <LI>
- * Pageable object -- The client supplies an object that implements interface
- * {@link java.awt.print.Pageable Pageable}. The printer calls
- * methods in that interface to obtain the pages to be printed, one by one.
- * For each page, the printer supplies a graphics context, and whatever
- * the client draws in that graphics context gets printed.
- * </UL>
- *
- * <HR>
+ * permitted). Nested classes inside class {@code DocFlavor} declare predefined
+ * static constant {@code DocFlavor} objects for these example doc flavors;
+ * class {@code DocFlavor}'s constructor can be used to create an arbitrary doc
+ * flavor.
+ * <ul>
+ * <li>Renderable image object -- The client supplies an object that
+ * implements interface
+ * {@link java.awt.image.renderable.RenderableImage RenderableImage}. The
+ * printer calls methods in that interface to obtain the image to be printed.
+ * <li>Printable object -- The client supplies an object that implements
+ * interface {@link java.awt.print.Printable Printable}. The printer calls
+ * methods in that interface to obtain the pages to be printed, one by one.
+ * For each page, the printer supplies a graphics context, and whatever the
+ * client draws in that graphics context gets printed.
+ * <li>Pageable object -- The client supplies an object that implements
+ * interface {@link java.awt.print.Pageable Pageable}. The printer calls
+ * methods in that interface to obtain the pages to be printed, one by one.
+ * For each page, the printer supplies a graphics context, and whatever the
+ * client draws in that graphics context gets printed.
+ * </ul>
*
- * <HR>
- * <H3>Pre-defined Doc Flavors</H3>
- * A Java Print Service instance is not <B><I>required</I></B> to support the
- * following print data formats and print data representation classes. In
- * fact, a developer using this class should <b>never</b> assume that a
- * particular print service supports the document types corresponding to
- * these pre-defined doc flavors. Always query the print service
- * to determine what doc flavors it supports. However,
- * developers who have print services that support these doc flavors are
- * encouraged to refer to the predefined singleton instances created here.
- * <UL>
- * <LI>
- * Plain text print data provided through a byte stream. Specifically, the
- * following doc flavors are recommended to be supported:
- * <BR>·
- * {@code ("text/plain", "java.io.InputStream")}
- * <BR>·
- * {@code ("text/plain; charset=us-ascii", "java.io.InputStream")}
- * <BR>·
- * {@code ("text/plain; charset=utf-8", "java.io.InputStream")}
- *
- * <LI>
- * Renderable image objects. Specifically, the following doc flavor is
- * recommended to be supported:
- * <BR>·
- * {@code ("application/x-java-jvm-local-objectref", "java.awt.image.renderable.RenderableImage")}
- * </UL>
- * <P>
- * A Java Print Service instance is allowed to support any other doc flavors
- * (or none) in addition to the above mandatory ones, at the implementation's
+ * <hr>
+ * <h3>Pre-defined Doc Flavors</h3>
+ * A Java Print Service instance is not <b><i>required</i></b> to support the
+ * following print data formats and print data representation classes. In fact,
+ * a developer using this class should <b>never</b> assume that a particular
+ * print service supports the document types corresponding to these pre-defined
+ * doc flavors. Always query the print service to determine what doc flavors it
+ * supports. However, developers who have print services that support these doc
+ * flavors are encouraged to refer to the predefined singleton instances created
+ * here.
+ * <ul>
+ * <li>Plain text print data provided through a byte stream. Specifically, the
+ * following doc flavors are recommended to be supported:
+ * <br>·
+ * {@code ("text/plain", "java.io.InputStream")}
+ * <br>·
+ * {@code ("text/plain; charset=us-ascii", "java.io.InputStream")}
+ * <br>·
+ * {@code ("text/plain; charset=utf-8", "java.io.InputStream")}
+ * <li>Renderable image objects. Specifically, the following doc flavor is
+ * recommended to be supported:
+ * <br>·
+ * {@code ("application/x-java-jvm-local-objectref", "java.awt.image.renderable.RenderableImage")}
+ * </ul>
+ * A Java Print Service instance is allowed to support any other doc flavors (or
+ * none) in addition to the above mandatory ones, at the implementation's
* choice.
- * <P>
+ * <p>
* Support for the above doc flavors is desirable so a printing client can rely
* on being able to print on any JPS printer, regardless of which doc flavors
* the printer supports. If the printer doesn't support the client's preferred
* doc flavor, the client can at least print plain text, or the client can
* convert its data to a renderable image and print the image.
- * <P>
+ * <p>
* Furthermore, every Java Print Service instance must fulfill these
* requirements for processing plain text print data:
- * <UL>
- * <LI>
- * The character pair carriage return-line feed (CR-LF) means
- * "go to column 1 of the next line."
- * <LI>
- * A carriage return (CR) character standing by itself means
- * "go to column 1 of the next line."
- * <LI>
- * A line feed (LF) character standing by itself means
- * "go to column 1 of the next line."
- * </UL>
- * <P>
+ * <ul>
+ * <li>The character pair carriage return-line feed (CR-LF) means "go to
+ * column 1 of the next line."
+ * <li>A carriage return (CR) character standing by itself means "go to column
+ * 1 of the next line."
+ * <li>A line feed (LF) character standing by itself means "go to column 1 of
+ * the next line."
+ * </ul>
* The client must itself perform all plain text print data formatting not
* addressed by the above requirements.
*
- * <H3>Design Rationale</H3>
- * <P>
- * Class DocFlavor in package javax.print.data is similar to class
- * {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class
- * {@code DataFlavor}
- * is not used in the Java Print Service (JPS) API
- * for three reasons which are all rooted in allowing the JPS API to be
- * shared by other print services APIs which may need to run on Java profiles
- * which do not include all of the Java Platform, Standard Edition.
- * <OL TYPE=1>
- * <LI>
- * The JPS API is designed to be used in Java profiles which do not support
- * AWT.
- *
- * <LI>
- * The implementation of class {@code java.awt.datatransfer.DataFlavor}
- * does not guarantee that equivalent data flavors will have the same
- * serialized representation. DocFlavor does, and can be used in services
- * which need this.
+ * <h3>Design Rationale</h3>
+ * Class {@code DocFlavor} in package {@code javax.print} is similar to class
+ * {@link java.awt.datatransfer.DataFlavor}. Class {@code DataFlavor} is not
+ * used in the Java Print Service (JPS) API for three reasons which are all
+ * rooted in allowing the JPS API to be shared by other print services APIs
+ * which may need to run on Java profiles which do not include all of the Java
+ * Platform, Standard Edition.
+ * <ol type=1>
+ * <li>The JPS API is designed to be used in Java profiles which do not
+ * support AWT.
+ * <li>The implementation of class {@code java.awt.datatransfer.DataFlavor}
+ * does not guarantee that equivalent data flavors will have the same
+ * serialized representation. {@code DocFlavor} does, and can be used in
+ * services which need this.
+ * <li>The implementation of class {@code java.awt.datatransfer.DataFlavor}
+ * includes a human presentable name as part of the serialized representation.
+ * This is not appropriate as part of a service matching constraint.
+ * </ol>
+ * Class {@code DocFlavor}'s serialized representation uses the following
+ * canonical form of a MIME type string. Thus, two doc flavors with MIME types
+ * that are not identical but that are equivalent (that have the same canonical
+ * form) may be considered equal.
+ * <ul>
+ * <li>The media type, media subtype, and parameters are retained, but all
+ * comments and whitespace characters are discarded.
+ * <li>The media type, media subtype, and parameter names are converted to
+ * lowercase.
+ * <li>The parameter values retain their original case, except a charset
+ * parameter value for a text media type is converted to lowercase.
+ * <li>Quote characters surrounding parameter values are removed.
+ * <li>Quoting backslash characters inside parameter values are removed.
+ * <li>The parameters are arranged in ascending order of parameter name.
+ * </ul>
+ * Class {@code DocFlavor}'s serialized representation also contains the
+ * fully-qualified class <i>name</i> of the representation class (a
+ * {@code String} object), rather than the representation class itself (a
+ * {@code Class} object). This allows a client to examine the doc flavors a Java
+ * Print Service instance supports without having to load the representation
+ * classes, which may be problematic for limited-resource clients.
*
- * <LI>
- * The implementation of class {@code java.awt.datatransfer.DataFlavor}
- * includes a human presentable name as part of the serialized representation.
- * This is not appropriate as part of a service matching constraint.
- * </OL>
- * <P>
- * Class DocFlavor's serialized representation uses the following
- * canonical form of a MIME type string. Thus, two doc flavors with MIME types
- * that are not identical but that are equivalent (that have the same
- * canonical form) may be considered equal.
- * <UL>
- * <LI> The media type, media subtype, and parameters are retained, but all
- * comments and whitespace characters are discarded.
- * <LI> The media type, media subtype, and parameter names are converted to
- * lowercase.
- * <LI> The parameter values retain their original case, except a charset
- * parameter value for a text media type is converted to lowercase.
- * <LI> Quote characters surrounding parameter values are removed.
- * <LI> Quoting backslash characters inside parameter values are removed.
- * <LI> The parameters are arranged in ascending order of parameter name.
- * </UL>
- * <P>
- * Class DocFlavor's serialized representation also contains the
- * fully-qualified class <I>name</I> of the representation class
- * (a String object), rather than the representation class itself
- * (a Class object). This allows a client to examine the doc flavors a
- * Java Print Service instance supports without having
- * to load the representation classes, which may be problematic for
- * limited-resource clients.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class DocFlavor implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4512080796965449721L;
/**
- * A String representing the host operating system encoding.
- * This will follow the conventions documented in
+ * A string representing the host operating system encoding. This will
+ * follow the conventions documented in
* <a href="http://www.ietf.org/rfc/rfc2278.txt">
* <i>RFC 2278: IANA Charset Registration Procedures</i></a>
* except where historical names are returned for compatibility with
- * previous versions of the Java platform.
- * The value returned from method is valid only for the VM which
- * returns it, for use in a DocFlavor.
- * This is the charset for all the "HOST" pre-defined DocFlavors in
+ * previous versions of the Java platform. The value returned from method is
+ * valid only for the VM which returns it, for use in a {@code DocFlavor}.
+ * This is the charset for all the "HOST" pre-defined {@code DocFlavors} in
* the executing VM.
*/
public static final String hostEncoding;
@@ -488,6 +417,7 @@
/**
* Representation class name.
+ *
* @serial
*/
private String myClassName;
@@ -497,21 +427,17 @@
*/
private transient String myStringValue = null;
-
/**
* Constructs a new doc flavor object from the given MIME type and
* representation class name. The given MIME type is converted into
* canonical form and stored internally.
*
- * @param mimeType MIME media type string.
- * @param className Fully-qualified representation class name.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null or
- * {@code className} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string
+ * @param className fully-qualified representation class name
+ * @throws NullPointerException if {@code mimeType} or {@code className} is
+ * {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey the
+ * syntax for a MIME media type string
*/
public DocFlavor(String mimeType, String className) {
if (className == null) {
@@ -522,8 +448,9 @@
}
/**
- * Returns this doc flavor object's MIME type string based on the
- * canonical form. Each parameter value is enclosed in quotes.
+ * Returns this doc flavor object's MIME type string based on the canonical
+ * form. Each parameter value is enclosed in quotes.
+ *
* @return the mime type
*/
public String getMimeType() {
@@ -532,6 +459,7 @@
/**
* Returns this doc flavor object's media type (from the MIME type).
+ *
* @return the media type
*/
public String getMediaType() {
@@ -540,6 +468,7 @@
/**
* Returns this doc flavor object's media subtype (from the MIME type).
+ *
* @return the media sub-type
*/
public String getMediaSubtype() {
@@ -547,19 +476,18 @@
}
/**
- * Returns a {@code String} representing a MIME
- * parameter.
- * Mime types may include parameters which are usually optional.
- * The charset for text types is a commonly useful example.
- * This convenience method will return the value of the specified
- * parameter if one was specified in the mime type for this flavor.
+ * Returns a {@code String} representing a MIME parameter. Mime types may
+ * include parameters which are usually optional. The charset for text types
+ * is a commonly useful example. This convenience method will return the
+ * value of the specified parameter if one was specified in the mime type
+ * for this flavor.
*
- * @param paramName the name of the paramater. This name is internally
- * converted to the canonical lower case format before performing
- * the match.
- * @return String representing a mime parameter, or
- * null if that parameter is not in the mime type string.
- * @exception NullPointerException if paramName is null.
+ * @param paramName the name of the parameter. This name is internally
+ * converted to the canonical lower case format before performing
+ * the match.
+ * @return a string representing a mime parameter, or {@code null} if that
+ * parameter is not in the mime type string
+ * @throws NullPointerException if paramName is {@code null}
*/
public String getParameter(String paramName) {
return myMimeType.getParameterMap().get(paramName.toLowerCase());
@@ -567,7 +495,8 @@
/**
* Returns the name of this doc flavor object's representation class.
- * @return the name of the representation class.
+ *
+ * @return the name of the representation class
*/
public String getRepresentationClassName() {
return myClassName;
@@ -576,10 +505,9 @@
/**
* Converts this {@code DocFlavor} to a string.
*
- * @return MIME type string based on the canonical form. Each parameter
- * value is enclosed in quotes.
- * A "class=" parameter is appended to the
- * MIME type string to indicate the representation class name.
+ * @return MIME type string based on the canonical form. Each parameter
+ * value is enclosed in quotes. A "class=" parameter is appended to
+ * the MIME type string to indicate the representation class name.
*/
public String toString() {
return getStringValue();
@@ -593,22 +521,21 @@
}
/**
- * Determines if this doc flavor object is equal to the given object.
- * The two are equal if the given object is not null, is an instance
- * of {@code DocFlavor}, has a MIME type equivalent to this doc
- * flavor object's MIME type (that is, the MIME types have the same media
- * type, media subtype, and parameters), and has the same representation
- * class name as this doc flavor object. Thus, if two doc flavor objects'
- * MIME types are the same except for comments, they are considered equal.
- * However, two doc flavor objects with MIME types of "text/plain" and
- * "text/plain; charset=US-ASCII" are not considered equal, even though
- * they represent the same media type (because the default character
- * set for plain text is US-ASCII).
+ * Determines if this doc flavor object is equal to the given object. The
+ * two are equal if the given object is not {@code null}, is an instance of
+ * {@code DocFlavor}, has a MIME type equivalent to this doc flavor object's
+ * MIME type (that is, the MIME types have the same media type, media
+ * subtype, and parameters), and has the same representation class name as
+ * this doc flavor object. Thus, if two doc flavor objects' MIME types are
+ * the same except for comments, they are considered equal. However, two doc
+ * flavor objects with MIME types of "text/plain" and "text/plain;
+ * charset=US-ASCII" are not considered equal, even though they represent
+ * the same media type (because the default character set for plain text is
+ * US-ASCII).
*
- * @param obj Object to test.
- *
- * @return True if this doc flavor object equals {@code obj}, false
- * otherwise.
+ * @param obj {@code Object} to test
+ * @return {@code true} if this doc flavor object equals {@code obj},
+ * {@code false} otherwise
*/
public boolean equals(Object obj) {
return
@@ -619,6 +546,8 @@
/**
* Returns this doc flavor object's string value.
+ *
+ * @return the string value
*/
private String getStringValue() {
if (myStringValue == null) {
@@ -630,8 +559,9 @@
/**
* Write the instance to a stream (ie serialize the object).
*
+ * @param s the output stream
* @throws IOException if I/O errors occur while writing to the underlying
- * stream
+ * stream
*/
private void writeObject(ObjectOutputStream s) throws IOException {
@@ -642,14 +572,15 @@
/**
* Reconstitute an instance from a stream (that is, deserialize it).
*
+ * @param s the input stream
* @throws ClassNotFoundException if the class of a serialized object could
- * not be found.
+ * not be found
* @throws IOException if I/O errors occur while reading from the underlying
- * stream
- * @serialData
- * The serialised form of a DocFlavor is the String naming the
- * representation class followed by the String representing the canonical
- * form of the mime type.
+ * stream
+ * @serialData The serialised form of a {@code DocFlavor} is the
+ * {@code String} naming the representation class followed by
+ * the {@code String} representing the canonical form of the
+ * mime type
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException {
@@ -659,167 +590,140 @@
}
/**
- * Class DocFlavor.BYTE_ARRAY provides predefined static constant
- * DocFlavor objects for example doc flavors using a byte array
+ * Class {@code DocFlavor.BYTE_ARRAY} provides predefined static constant
+ * {@code DocFlavor} objects for example doc flavors using a byte array
* ({@code byte[]}) as the print data representation class.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class BYTE_ARRAY extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -9065578006593857475L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of {@code "[B"} (byte array).
- *
- * @param mimeType MIME media type string.
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "[B"} (byte array).
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string
*/
public BYTE_ARRAY (String mimeType) {
super (mimeType, "[B");
}
/**
- * Doc flavor with MIME type = {@code "text/plain"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "[B"} (byte array).
+ * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_HOST =
new BYTE_ARRAY ("text/plain; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-8"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"},
+ * print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 =
new BYTE_ARRAY ("text/plain; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
+ * print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 =
new BYTE_ARRAY ("text/plain; charset=utf-16");
-
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
+ * {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE =
new BYTE_ARRAY ("text/plain; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
+ * {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE =
new BYTE_ARRAY ("text/plain; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=us-ascii"},
- * print data representation class name =
- * {@code "[B"} (byte array).
+ * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"},
+ * print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII =
new BYTE_ARRAY ("text/plain; charset=us-ascii");
/**
- * Doc flavor with MIME type = {@code "text/html"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "[B"} (byte array).
+ * Doc flavor with MIME type = {@code "text/html"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_HOST =
new BYTE_ARRAY ("text/html; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-8"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print
+ * data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_UTF_8 =
new BYTE_ARRAY ("text/html; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
+ * print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_UTF_16 =
new BYTE_ARRAY ("text/html; charset=utf-16");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
+ * {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_UTF_16BE =
new BYTE_ARRAY ("text/html; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
+ * {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_UTF_16LE =
new BYTE_ARRAY ("text/html; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=us-ascii"},
- * print data representation class name =
- * {@code "[B"} (byte array).
+ * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"},
+ * print data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY TEXT_HTML_US_ASCII =
new BYTE_ARRAY ("text/html; charset=us-ascii");
/**
- * Doc flavor with MIME type = {@code "application/pdf"}, print
- * data representation class name = {@code "[B"} (byte array).
+ * Doc flavor with MIME type = {@code "application/pdf"}, print data
+ * representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf");
/**
- * Doc flavor with MIME type = {@code "application/postscript"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "application/postscript"}, print
+ * data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY POSTSCRIPT =
new BYTE_ARRAY ("application/postscript");
/**
- * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"},
- * print data representation class name = {@code "[B"} (byte
- * array).
+ * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print
+ * data representation class name = {@code "[B"} (byte array).
*/
public static final BYTE_ARRAY PCL =
new BYTE_ARRAY ("application/vnd.hp-PCL");
@@ -843,376 +747,337 @@
public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png");
/**
- * Doc flavor with MIME type =
- * {@code "application/octet-stream"},
- * print data representation class name = {@code "[B"} (byte
- * array). The client must determine that data described
- * using this DocFlavor is valid for the printer.
+ * Doc flavor with MIME type = {@code "application/octet-stream"}, print
+ * data representation class name = {@code "[B"} (byte array). The
+ * client must determine that data described using this
+ * {@code DocFlavor} is valid for the printer.
*/
public static final BYTE_ARRAY AUTOSENSE =
new BYTE_ARRAY ("application/octet-stream");
-
}
/**
- * Class DocFlavor.INPUT_STREAM provides predefined static constant
- * DocFlavor objects for example doc flavors using a byte stream ({@link
- * java.io.InputStream java.io.InputStream}) as the print
- * data representation class.
+ * Class {@code DocFlavor.INPUT_STREAM} provides predefined static constant
+ * {@code DocFlavor} objects for example doc flavors using a byte stream
+ * ({@link java.io.InputStream java.io.InputStream}) as the print data
+ * representation class.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class INPUT_STREAM extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7045842700749194127L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of
- * {@code "java.io.InputStream"} (byte stream).
- *
- * @param mimeType MIME media type string.
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "java.io.InputStream"} (byte
+ * stream).
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string.
*/
public INPUT_STREAM (String mimeType) {
super (mimeType, "java.io.InputStream");
}
/**
- * Doc flavor with MIME type = {@code "text/plain"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_HOST =
new INPUT_STREAM ("text/plain; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-8"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"},
+ * print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_UTF_8 =
new INPUT_STREAM ("text/plain; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
+ * print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_UTF_16 =
new INPUT_STREAM ("text/plain; charset=utf-16");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
* {@code "java.io.InputStream"} (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE =
new INPUT_STREAM ("text/plain; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
* {@code "java.io.InputStream"} (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE =
new INPUT_STREAM ("text/plain; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=us-ascii"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"},
+ * print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_PLAIN_US_ASCII =
new INPUT_STREAM ("text/plain; charset=us-ascii");
/**
- * Doc flavor with MIME type = {@code "text/html"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_HTML_HOST =
new INPUT_STREAM ("text/html; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-8"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print
+ * data representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM TEXT_HTML_UTF_8 =
new INPUT_STREAM ("text/html; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
+ * print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_HTML_UTF_16 =
new INPUT_STREAM ("text/html; charset=utf-16");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
* {@code "java.io.InputStream"} (byte stream).
*/
public static final INPUT_STREAM TEXT_HTML_UTF_16BE =
new INPUT_STREAM ("text/html; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
* {@code "java.io.InputStream"} (byte stream).
*/
public static final INPUT_STREAM TEXT_HTML_UTF_16LE =
new INPUT_STREAM ("text/html; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=us-ascii"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"},
+ * print data representation class name = {@code "java.io.InputStream"}
+ * (byte stream).
*/
public static final INPUT_STREAM TEXT_HTML_US_ASCII =
new INPUT_STREAM ("text/html; charset=us-ascii");
-
/**
- * Doc flavor with MIME type = {@code "application/pdf"}, print
- * data representation class name = {@code "java.io.InputStream"}
- * (byte stream).
+ * Doc flavor with MIME type = {@code "application/pdf"}, print data
+ * representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf");
/**
- * Doc flavor with MIME type = {@code "application/postscript"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "application/postscript"}, print
+ * data representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM POSTSCRIPT =
new INPUT_STREAM ("application/postscript");
/**
- * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print
+ * data representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM PCL =
new INPUT_STREAM ("application/vnd.hp-PCL");
/**
* Doc flavor with MIME type = {@code "image/gif"}, print data
- * representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif");
/**
* Doc flavor with MIME type = {@code "image/jpeg"}, print data
- * representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg");
/**
* Doc flavor with MIME type = {@code "image/png"}, print data
- * representation class name =
- * {@code "java.io.InputStream"} (byte stream).
+ * representation class name = {@code "java.io.InputStream"} (byte
+ * stream).
*/
public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png");
/**
- * Doc flavor with MIME type =
- * {@code "application/octet-stream"},
- * print data representation class name =
- * {@code "java.io.InputStream"} (byte stream).
- * The client must determine that data described
- * using this DocFlavor is valid for the printer.
+ * Doc flavor with MIME type = {@code "application/octet-stream"}, print
+ * data representation class name = {@code "java.io.InputStream"} (byte
+ * stream). The client must determine that data described using this
+ * {@code DocFlavor} is valid for the printer.
*/
public static final INPUT_STREAM AUTOSENSE =
new INPUT_STREAM ("application/octet-stream");
-
}
/**
- * Class DocFlavor.URL provides predefined static constant DocFlavor
- * objects.
- * For example doc flavors using a Uniform Resource Locator ({@link
- * java.net.URL java.net.URL}) as the print data
+ * Class {@code DocFlavor.URL} provides predefined static constant
+ * {@code DocFlavor} objects. For example doc flavors using a Uniform
+ * Resource Locator ({@link java.net.URL java.net.URL}) as the print data
* representation class.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class URL extends DocFlavor {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2936725788144902062L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of {@code "java.net.URL"}.
- *
- * @param mimeType MIME media type string.
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "java.net.URL"}.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string
*/
public URL (String mimeType) {
super (mimeType, "java.net.URL");
}
/**
- * Doc flavor with MIME type = {@code "text/plain"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_PLAIN_HOST =
new URL ("text/plain; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-8"},
- * print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"},
+ * print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_PLAIN_UTF_8 =
new URL ("text/plain; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16"},
- * print data representation class name =
- * {@code java.net.URL""} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
+ * print data representation class name = {@code java.net.URL""} (byte
+ * stream).
*/
public static final URL TEXT_PLAIN_UTF_16 =
new URL ("text/plain; charset=utf-16");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
* {@code "java.net.URL"} (byte stream).
*/
public static final URL TEXT_PLAIN_UTF_16BE =
new URL ("text/plain; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
* {@code "java.net.URL"} (byte stream).
*/
public static final URL TEXT_PLAIN_UTF_16LE =
new URL ("text/plain; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/plain; charset=us-ascii"},
- * print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"},
+ * print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_PLAIN_US_ASCII =
new URL ("text/plain; charset=us-ascii");
/**
- * Doc flavor with MIME type = {@code "text/html"},
- * encoded in the host platform encoding.
- * See {@link DocFlavor#hostEncoding hostEncoding}
- * Print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html"}, encoded in the host
+ * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}.
+ * Print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_HTML_HOST =
new URL ("text/html; charset="+hostEncoding);
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-8"},
- * print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print
+ * data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_HTML_UTF_8 =
new URL ("text/html; charset=utf-8");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16"},
- * print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
+ * print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_HTML_UTF_16 =
new URL ("text/html; charset=utf-16");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16be"}
- * (big-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"}
+ * (big-endian byte ordering), print data representation class name =
* {@code "java.net.URL"} (byte stream).
*/
public static final URL TEXT_HTML_UTF_16BE =
new URL ("text/html; charset=utf-16be");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=utf-16le"}
- * (little-endian byte ordering),
- * print data representation class name =
+ * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"}
+ * (little-endian byte ordering), print data representation class name =
* {@code "java.net.URL"} (byte stream).
*/
public static final URL TEXT_HTML_UTF_16LE =
new URL ("text/html; charset=utf-16le");
/**
- * Doc flavor with MIME type =
- * {@code "text/html; charset=us-ascii"},
- * print data representation class name =
- * {@code "java.net.URL"} (byte stream).
+ * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"},
+ * print data representation class name = {@code "java.net.URL"} (byte
+ * stream).
*/
public static final URL TEXT_HTML_US_ASCII =
new URL ("text/html; charset=us-ascii");
-
/**
- * Doc flavor with MIME type = {@code "application/pdf"}, print
- * data representation class name = {@code "java.net.URL"}.
+ * Doc flavor with MIME type = {@code "application/pdf"}, print data
+ * representation class name = {@code "java.net.URL"}.
*/
public static final URL PDF = new URL ("application/pdf");
/**
- * Doc flavor with MIME type = {@code "application/postscript"},
- * print data representation class name = {@code "java.net.URL"}.
+ * Doc flavor with MIME type = {@code "application/postscript"}, print
+ * data representation class name = {@code "java.net.URL"}.
*/
public static final URL POSTSCRIPT = new URL ("application/postscript");
/**
- * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"},
- * print data representation class name = {@code "java.net.URL"}.
+ * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print
+ * data representation class name = {@code "java.net.URL"}.
*/
public static final URL PCL = new URL ("application/vnd.hp-PCL");
@@ -1235,42 +1100,39 @@
public static final URL PNG = new URL ("image/png");
/**
- * Doc flavor with MIME type =
- * {@code "application/octet-stream"},
- * print data representation class name = {@code "java.net.URL"}.
- * The client must determine that data described
- * using this DocFlavor is valid for the printer.
+ * Doc flavor with MIME type = {@code "application/octet-stream"}, print
+ * data representation class name = {@code "java.net.URL"}. The client
+ * must determine that data described using this {@code DocFlavor} is
+ * valid for the printer.
*/
public static final URL AUTOSENSE = new URL ("application/octet-stream");
-
}
/**
- * Class DocFlavor.CHAR_ARRAY provides predefined static constant
- * DocFlavor objects for example doc flavors using a character array
- * ({@code char[]}) as the print data representation class. As such,
- * the character set is Unicode.
+ * Class {@code DocFlavor.CHAR_ARRAY} provides predefined static constant
+ * {@code DocFlavor} objects for example doc flavors using a character array
+ * ({@code char[]}) as the print data representation class. As such, the
+ * character set is Unicode.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class CHAR_ARRAY extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8720590903724405128L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of
- * {@code "[C"} (character array).
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "[C"} (character array).
*
- * @param mimeType MIME media type string. If it is a text media
- * type, it is assumed to contain a
- * {@code "charset=utf-16"} parameter.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string. If it is a text media type,
+ * it is assumed to contain a {@code "charset=utf-16"}
+ * parameter.
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string
*/
public CHAR_ARRAY (String mimeType) {
super (mimeType, "[C");
@@ -1278,47 +1140,46 @@
/**
* Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
- * print data representation class name =
- * {@code "[C"} (character array).
+ * print data representation class name = {@code "[C"} (character
+ * array).
*/
public static final CHAR_ARRAY TEXT_PLAIN =
new CHAR_ARRAY ("text/plain; charset=utf-16");
/**
* Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
- * print data representation class name =
- * {@code "[C"} (character array).
+ * print data representation class name = {@code "[C"} (character
+ * array).
*/
public static final CHAR_ARRAY TEXT_HTML =
new CHAR_ARRAY ("text/html; charset=utf-16");
-
}
/**
- * Class DocFlavor.STRING provides predefined static constant DocFlavor
- * objects for example doc flavors using a string ({@link java.lang.String
- * java.lang.String}) as the print data representation class.
+ * Class {@code DocFlavor.STRING} provides predefined static constant
+ * {@code DocFlavor} objects for example doc flavors using a string
+ * ({@link String java.lang.String}) as the print data representation class.
* As such, the character set is Unicode.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class STRING extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4414407504887034035L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of {@code "java.lang.String"}.
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "java.lang.String"}.
*
- * @param mimeType MIME media type string. If it is a text media
- * type, it is assumed to contain a
- * {@code "charset=utf-16"} parameter.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string. If it is a text media type,
+ * it is assumed to contain a {@code "charset=utf-16"}
+ * parameter.
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string
*/
public STRING (String mimeType) {
super (mimeType, "java.lang.String");
@@ -1326,47 +1187,45 @@
/**
* Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
- * print data representation class name =
- * {@code "java.lang.String"}.
+ * print data representation class name = {@code "java.lang.String"}.
*/
public static final STRING TEXT_PLAIN =
new STRING ("text/plain; charset=utf-16");
/**
* Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
- * print data representation class name =
- * {@code "java.lang.String"}.
+ * print data representation class name = {@code "java.lang.String"}.
*/
public static final STRING TEXT_HTML =
new STRING ("text/html; charset=utf-16");
}
/**
- * Class DocFlavor.READER provides predefined static constant DocFlavor
- * objects for example doc flavors using a character stream ({@link
- * java.io.Reader java.io.Reader}) as the print data
+ * Class {@code DocFlavor.READER} provides predefined static constant
+ * {@code DocFlavor} objects for example doc flavors using a character
+ * stream ({@link java.io.Reader java.io.Reader}) as the print data
* representation class. As such, the character set is Unicode.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class READER extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7100295812579351567L;
/**
- * Constructs a new doc flavor with the given MIME type and a print
- * data representation class name of\
- * {@code "java.io.Reader"} (character stream).
+ * Constructs a new doc flavor with the given MIME type and a print data
+ * representation class name of {@code "java.io.Reader"} (character
+ * stream).
*
- * @param mimeType MIME media type string. If it is a text media
- * type, it is assumed to contain a
- * {@code "charset=utf-16"} parameter.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code mimeType} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code mimeType} does not
- * obey the syntax for a MIME media type string.
+ * @param mimeType MIME media type string. If it is a text media type,
+ * it is assumed to contain a {@code "charset=utf-16"}
+ * parameter.
+ * @throws NullPointerException if {@code mimeType} is {@code null}
+ * @throws IllegalArgumentException if {@code mimeType} does not obey
+ * the syntax for a MIME media type string
*/
public READER (String mimeType) {
super (mimeType, "java.io.Reader");
@@ -1374,16 +1233,16 @@
/**
* Doc flavor with MIME type = {@code "text/plain; charset=utf-16"},
- * print data representation class name =
- * {@code "java.io.Reader"} (character stream).
+ * print data representation class name = {@code "java.io.Reader"}
+ * (character stream).
*/
public static final READER TEXT_PLAIN =
new READER ("text/plain; charset=utf-16");
/**
* Doc flavor with MIME type = {@code "text/html; charset=utf-16"},
- * print data representation class name =
- * {@code "java.io.Reader"} (character stream).
+ * print data representation class name = {@code "java.io.Reader"}
+ * (character stream).
*/
public static final READER TEXT_HTML =
new READER ("text/html; charset=utf-16");
@@ -1391,27 +1250,27 @@
}
/**
- * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant
- * DocFlavor objects for example doc flavors for service formatted print
- * data.
+ * Class {@code DocFlavor.SERVICE_FORMATTED} provides predefined static
+ * constant {@code DocFlavor} objects for example doc flavors for service
+ * formatted print data.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public static class SERVICE_FORMATTED extends DocFlavor {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6181337766266637256L;
/**
* Constructs a new doc flavor with a MIME type of
- * {@code "application/x-java-jvm-local-objectref"} indicating
- * service formatted print data and the given print data
- * representation class name.
+ * {@code "application/x-java-jvm-local-objectref"} indicating service
+ * formatted print data and the given print data representation class
+ * name.
*
- * @param className Fully-qualified representation class name.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code className} is
- * null.
+ * @param className fully-qualified representation class name
+ * @throws NullPointerException if {@code className} is {@code null}
*/
public SERVICE_FORMATTED (String className) {
super ("application/x-java-jvm-local-objectref", className);
@@ -1420,8 +1279,8 @@
/**
* Service formatted print data doc flavor with print data
* representation class name =
- * {@code "java.awt.image.renderable.RenderableImage"}
- * (renderable image object).
+ * {@code "java.awt.image.renderable.RenderableImage"} (renderable image
+ * object).
*/
public static final SERVICE_FORMATTED RENDERABLE_IMAGE =
new SERVICE_FORMATTED("java.awt.image.renderable.RenderableImage");
@@ -1443,5 +1302,4 @@
new SERVICE_FORMATTED ("java.awt.print.Pageable");
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,146 +29,132 @@
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.event.PrintJobAttributeListener;
import javax.print.event.PrintJobListener;
-import javax.print.PrintException;
/**
- *
- * This interface represents a print job that can print a specified
- * document with a set of job attributes. An object implementing
- * this interface is obtained from a print service.
- *
+ * This interface represents a print job that can print a specified document
+ * with a set of job attributes. An object implementing this interface is
+ * obtained from a print service.
*/
-
public interface DocPrintJob {
/**
- * Determines the {@link PrintService} object to which this print job
- * object is bound.
+ * Determines the {@link PrintService} object to which this print job object
+ * is bound.
*
- * @return {@code PrintService} object.
- *
+ * @return {@code PrintService} object
*/
public PrintService getPrintService();
/**
- * Obtains this Print Job's set of printing attributes.
- * The returned attribute set object is unmodifiable.
- * The returned attribute set object is a "snapshot" of this Print Job's
- * attribute set at the time of the {@link #getAttributes()} method
- * call; that is, the returned attribute set's object's contents will
- * not be updated if this Print Job's attribute set's contents change
- * in the future. To detect changes in attribute values, call
- * {@code getAttributes()} again and compare the new attribute
- * set to the previous attribute set; alternatively, register a
- * listener for print job events.
- * The returned value may be an empty set but should not be null.
+ * Obtains this Print Job's set of printing attributes. The returned
+ * attribute set object is unmodifiable. The returned attribute set object
+ * is a "snapshot" of this Print Job's attribute set at the time of the
+ * {@code getAttributes()} method call; that is, the returned attribute
+ * set's object's contents will not be updated if this Print Job's attribute
+ * set's contents change in the future. To detect changes in attribute
+ * values, call {@code getAttributes()} again and compare the new attribute
+ * set to the previous attribute set; alternatively, register a listener for
+ * print job events. The returned value may be an empty set but should not
+ * be {@code null}.
+ *
* @return the print job attributes
*/
public PrintJobAttributeSet getAttributes();
/**
- * Registers a listener for event occurring during this print job.
- * If listener is null, no exception is thrown and no action is
- * performed.
- * If listener is already registered, it will be registered again.
+ * Registers a listener for event occurring during this print job. If
+ * listener is {@code null}, no exception is thrown and no action is
+ * performed. If listener is already registered, it will be registered
+ * again.
+ *
+ * @param listener the object implementing the listener interface
* @see #removePrintJobListener
- *
- * @param listener The object implementing the listener interface
- *
*/
public void addPrintJobListener(PrintJobListener listener);
/**
- * Removes a listener from this print job.
- * This method performs no function, nor does it throw an exception,
- * if the listener specified by the argument was not previously added
- * to this component. If listener is null, no exception is thrown and
- * no action is performed. If a listener was registered more than once
- * only one of the registrations will be removed.
+ * Removes a listener from this print job. This method performs no function,
+ * nor does it throw an exception, if the listener specified by the argument
+ * was not previously added to this print job. If listener is {@code null},
+ * no exception is thrown and no action is performed. If a listener was
+ * registered more than once only one of the registrations will be removed.
+ *
+ * @param listener the object implementing the listener interface
* @see #addPrintJobListener
- *
- * @param listener The object implementing the listener interface
*/
public void removePrintJobListener(PrintJobListener listener);
/**
- * Registers a listener for changes in the specified attributes.
- * If listener is null, no exception is thrown and no action is
- * performed.
- * To determine the attribute updates that may be reported by this job,
- * a client can call {@code getAttributes()} and identify the
- * subset that are interesting and likely to be reported to the
- * listener. Clients expecting to be updated about changes in a
- * specific job attribute should verify it is in that set, but
- * updates about an attribute will be made only if it changes and this
- * is detected by the job. Also updates may be subject to batching
- * by the job. To minimize overhead in print job processing it is
- * recommended to listen on only that subset of attributes which
- * are likely to change.
- * If the specified set is empty no attribute updates will be reported
- * to the listener.
- * If the attribute set is null, then this means to listen on all
- * dynamic attributes that the job supports. This may result in no
- * update notifications if a job can not report any attribute updates.
+ * Registers a listener for changes in the specified attributes. If listener
+ * is {@code null}, no exception is thrown and no action is performed. To
+ * determine the attribute updates that may be reported by this job, a
+ * client can call {@code getAttributes()} and identify the subset that are
+ * interesting and likely to be reported to the listener. Clients expecting
+ * to be updated about changes in a specific job attribute should verify it
+ * is in that set, but updates about an attribute will be made only if it
+ * changes and this is detected by the job. Also updates may be subject to
+ * batching by the job. To minimize overhead in print job processing it is
+ * recommended to listen on only that subset of attributes which are likely
+ * to change. If the specified set is empty no attribute updates will be
+ * reported to the listener. If the attribute set is {@code null}, then this
+ * means to listen on all dynamic attributes that the job supports. This may
+ * result in no update notifications if a job can not report any attribute
+ * updates.
+ * <p>
+ * If listener is already registered, it will be registered again.
*
- * If listener is already registered, it will be registered again.
+ * @param listener the object implementing the listener interface
+ * @param attributes the attributes to listen on, or {@code null} to mean
+ * all attributes that can change, as determined by the job
* @see #removePrintJobAttributeListener
- *
- * @param listener The object implementing the listener interface
- * @param attributes The attributes to listen on, or null to mean
- * all attributes that can change, as determined by the job.
*/
public void addPrintJobAttributeListener(
PrintJobAttributeListener listener,
PrintJobAttributeSet attributes);
/**
- * Removes an attribute listener from this print job.
- * This method performs no function, nor does it throw an exception,
- * if the listener specified by the argument was not previously added
- * to this component. If the listener is null, no exception is thrown
- * and no action is performed.
- * If a listener is registered more than once, even for a different
- * set of attributes, no guarantee is made which listener is removed.
+ * Removes an attribute listener from this print job. This method performs
+ * no function, nor does it throw an exception, if the listener specified by
+ * the argument was not previously added to this print job. If the listener
+ * is {@code null}, no exception is thrown and no action is performed. If a
+ * listener is registered more than once, even for a different set of
+ * attributes, no guarantee is made which listener is removed.
+ *
+ * @param listener the object implementing the listener interface
* @see #addPrintJobAttributeListener
- *
- * @param listener The object implementing the listener interface
- *
*/
public void removePrintJobAttributeListener(
PrintJobAttributeListener listener);
/**
- * Prints a document with the specified job attributes.
- * This method should only be called once for a given print job.
- * Calling it again will not result in a new job being spooled to
- * the printer. The service implementation will define policy
- * for service interruption and recovery.
+ * Prints a document with the specified job attributes. This method should
+ * only be called once for a given print job. Calling it again will not
+ * result in a new job being spooled to the printer. The service
+ * implementation will define policy for service interruption and recovery.
* When the print method returns, printing may not yet have completed as
* printing may happen asynchronously, perhaps in a different thread.
- * Application clients which want to monitor the success or failure
- * should register a PrintJobListener.
+ * Application clients which want to monitor the success or failure should
+ * register a {@code PrintJobListener}.
* <p>
* Print service implementors should close any print data streams (ie
- * Reader or InputStream implementations) that they obtain
- * from the client doc. Robust clients may still wish to verify this.
- * An exception is always generated if a {@code DocFlavor} cannot
- * be printed.
- *
- * @param doc The document to be printed. If must be a flavor
- * supported by this PrintJob.
+ * {@code Reader} or {@code InputStream} implementations) that they obtain
+ * from the client doc. Robust clients may still wish to verify this. An
+ * exception is always generated if a {@code DocFlavor} cannot be printed.
*
- * @param attributes The job attributes to be applied to this print job.
- * If this parameter is null then the default attributes are used.
- * @throws PrintException The exception additionally may implement
- * an interface that more precisely describes the cause of the
- * exception
- * <ul>
- * <li>FlavorException.
- * If the document has a flavor not supported by this print job.
- * <li>AttributeException.
- * If one or more of the attributes are not valid for this print job.
- * </ul>
+ * @param doc the document to be printed. It must be a flavor supported by
+ * this PrintJob.
+ * @param attributes the job attributes to be applied to this print job. If
+ * this parameter is {@code null} then the default attributes are
+ * used.
+ * @throws PrintException the exception additionally may implement an
+ * interface that more precisely describes the cause of the
+ * exception
+ * <ul>
+ * <li>{@code FlavorException}. If the document has a flavor not
+ * supported by this print job.
+ * <li>{@code AttributeException}. If one or more of the
+ * attributes are not valid for this print job.
+ * </ul>
*/
public void print(Doc doc, PrintRequestAttributeSet attributes)
throws PrintException;
--- a/jdk/src/java.desktop/share/classes/javax/print/FlavorException.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/FlavorException.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,20 @@
package javax.print;
-import javax.print.DocFlavor;
-
/**
- * Interface FlavorException is a mixin interface which a subclass of {@link
- * PrintException PrintException} can implement to report an error condition
- * involving a doc flavor or flavors (class {@link javax.print.DocFlavor
- * DocFlavor}). The Print Service API does not define any print exception
- * classes that implement interface FlavorException, that being left to the
- * Print Service implementor's discretion.
- *
+ * Interface {@code FlavorException} is a mixin interface which a subclass of
+ * {@link PrintException PrintException} can implement to report an error
+ * condition involving a doc flavor or flavors (class {@link DocFlavor}). The
+ * Print Service API does not define any print exception classes that implement
+ * interface {@code FlavorException}, that being left to the Print Service
+ * implementor's discretion.
*/
public interface FlavorException {
/**
* Returns the unsupported flavors.
- * @return the unsupported doc flavors.
+ *
+ * @return the unsupported doc flavors
*/
public DocFlavor[] getUnsupportedFlavors();
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/MimeType.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/MimeType.java Thu Aug 31 15:47:34 2017 -0700
@@ -26,7 +26,6 @@
package javax.print;
import java.io.Serializable;
-
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Iterator;
@@ -36,63 +35,63 @@
import java.util.Vector;
/**
- * Class MimeType encapsulates a Multipurpose Internet Mail Extensions (MIME)
- * media type as defined in <A HREF="http://www.ietf.org/rfc/rfc2045.txt">RFC
- * 2045</A> and <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>. A
- * MIME type object is part of a {@link DocFlavor DocFlavor} object and
- * specifies the format of the print data.
- * <P>
- * Class MimeType is similar to the like-named
- * class in package {@link java.awt.datatransfer java.awt.datatransfer}. Class
- * java.awt.datatransfer.MimeType is not used in the Jini Print Service API
- * for two reasons:
- * <OL TYPE=1>
- * <LI>
- * Since not all Java profiles include the AWT, the Jini Print Service should
- * not depend on an AWT class.
- * <LI>
- * The implementation of class java.awt.datatransfer.MimeType does not
- * guarantee
- * that equivalent MIME types will have the same serialized representation.
- * Thus, since the Jini Lookup Service (JLUS) matches service attributes based
- * on equality of serialized representations, JLUS searches involving MIME
- * types encapsulated in class java.awt.datatransfer.MimeType may incorrectly
- * fail to match.
- * </OL>
- * <P>
+ * Class {@code MimeType} encapsulates a Multipurpose Internet Mail Extensions
+ * (MIME) media type as defined in
+ * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> and
+ * <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>. A MIME type
+ * object is part of a {@link DocFlavor DocFlavor} object and specifies the
+ * format of the print data.
+ * <p>
+ * Class {@code MimeType} is similar to the like-named class in package
+ * {@link java.awt.datatransfer java.awt.datatransfer}. Class
+ * {@link java.awt.datatransfer.MimeType} is not used in the Jini Print Service
+ * API for two reasons:
+ * <ol type=1>
+ * <li>Since not all Java profiles include the AWT, the Jini Print Service
+ * should not depend on an AWT class.
+ * <li>The implementation of class {@code java.awt.datatransfer.MimeType} does
+ * not guarantee that equivalent MIME types will have the same serialized
+ * representation. Thus, since the Jini Lookup Service (JLUS) matches service
+ * attributes based on equality of serialized representations, JLUS searches
+ * involving MIME types encapsulated in class
+ * {@code java.awt.datatransfer.MimeType} may incorrectly fail to match.
+ * </ol>
* Class MimeType's serialized representation is based on the following
* canonical form of a MIME type string. Thus, two MIME types that are not
- * identical but that are equivalent (that have the same canonical form) will
- * be considered equal by the JLUS's matching algorithm.
- * <UL>
- * <LI> The media type, media subtype, and parameters are retained, but all
- * comments and whitespace characters are discarded.
- * <LI> The media type, media subtype, and parameter names are converted to
- * lowercase.
- * <LI> The parameter values retain their original case, except a charset
- * parameter value for a text media type is converted to lowercase.
- * <LI> Quote characters surrounding parameter values are removed.
- * <LI> Quoting backslash characters inside parameter values are removed.
- * <LI> The parameters are arranged in ascending order of parameter name.
- * </UL>
+ * identical but that are equivalent (that have the same canonical form) will be
+ * considered equal by the JLUS's matching algorithm.
+ * <ul>
+ * <li>The media type, media subtype, and parameters are retained, but all
+ * comments and whitespace characters are discarded.
+ * <li>The media type, media subtype, and parameter names are converted to
+ * lowercase.
+ * <li>The parameter values retain their original case, except a charset
+ * parameter value for a text media type is converted to lowercase.
+ * <li>Quote characters surrounding parameter values are removed.
+ * <li>Quoting backslash characters inside parameter values are removed.
+ * <li>The parameters are arranged in ascending order of parameter name.
+ * </ul>
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
class MimeType implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2785720609362367683L;
/**
- * Array of strings that hold pieces of this MIME type's canonical form.
- * If the MIME type has <I>n</I> parameters, <I>n</I> >= 0, then the
+ * Array of strings that hold pieces of this MIME type's canonical form. If
+ * the MIME type has <i>n</i> parameters, <i>n</i> >= 0, then the
* strings in the array are:
- * <BR>Index 0 -- Media type.
- * <BR>Index 1 -- Media subtype.
- * <BR>Index 2<I>i</I>+2 -- Name of parameter <I>i</I>,
- * <I>i</I>=0,1,...,<I>n</I>-1.
- * <BR>Index 2<I>i</I>+3 -- Value of parameter <I>i</I>,
- * <I>i</I>=0,1,...,<I>n</I>-1.
- * <BR>Parameters are arranged in ascending order of parameter name.
+ * <br>Index 0 -- Media type.
+ * <br>Index 1 -- Media subtype.
+ * <br>Index 2<i>i</i>+2 -- Name of parameter <i>i</i>,
+ * <i>i</i>=0,1,...,<i>n</i>-1.
+ * <br>Index 2<i>i</i>+3 -- Value of parameter <i>i</i>,
+ * <i>i</i>=0,1,...,<i>n</i>-1.
+ * <br>Parameters are arranged in ascending order of parameter name.
* @serial
*/
private String[] myPieces;
@@ -116,7 +115,17 @@
* Parameter map entry.
*/
private class ParameterMapEntry implements Map.Entry<String, String> {
+
+ /**
+ * The index of the entry.
+ */
private int myIndex;
+
+ /**
+ * Constructs a new parameter map entry.
+ *
+ * @param theIndex the index of the entry
+ */
public ParameterMapEntry(int theIndex) {
myIndex = theIndex;
}
@@ -144,6 +153,10 @@
* Parameter map entry set iterator.
*/
private class ParameterMapEntrySetIterator implements Iterator<Map.Entry<String, String>> {
+
+ /**
+ * The current index of the iterator.
+ */
private int myIndex = 2;
public boolean hasNext() {
return myIndex < myPieces.length;
@@ -187,16 +200,13 @@
}
/**
- * Construct a new MIME type object from the given string. The given
- * string is converted into canonical form and stored internally.
- *
- * @param s MIME media type string.
+ * Construct a new MIME type object from the given string. The given string
+ * is converted into canonical form and stored internally.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code s} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code s} does not obey the
- * syntax for a MIME media type string.
+ * @param s MIME media type string
+ * @throws NullPointerException if {@code s} is {@code null}
+ * @throws IllegalArgumentException if {@code s} does not obey the syntax
+ * for a MIME media type string
*/
public MimeType(String s) {
parse (s);
@@ -205,6 +215,8 @@
/**
* Returns this MIME type object's MIME type string based on the canonical
* form. Each parameter value is enclosed in quotes.
+ *
+ * @return the mime type
*/
public String getMimeType() {
return getStringValue();
@@ -212,6 +224,8 @@
/**
* Returns this MIME type object's media type.
+ *
+ * @return the media type
*/
public String getMediaType() {
return myPieces[0];
@@ -219,6 +233,8 @@
/**
* Returns this MIME type object's media subtype.
+ *
+ * @return the media subtype
*/
public String getMediaSubtype() {
return myPieces[1];
@@ -226,11 +242,11 @@
/**
* Returns an unmodifiable map view of the parameters in this MIME type
- * object. Each entry in the parameter map view consists of a parameter
- * name String (key) mapping to a parameter value String. If this MIME
- * type object has no parameters, an empty map is returned.
+ * object. Each entry in the parameter map view consists of a parameter name
+ * {@code String} (key) mapping to a parameter value {@code String}. If this
+ * MIME type object has no parameters, an empty map is returned.
*
- * @return Parameter map for this MIME type object.
+ * @return parameter map for this MIME type object
*/
public Map<String, String> getParameterMap() {
if (myParameterMap == null) {
@@ -242,8 +258,8 @@
/**
* Converts this MIME type object to a string.
*
- * @return MIME type string based on the canonical form. Each parameter
- * value is enclosed in quotes.
+ * @return MIME type string based on the canonical form. Each parameter
+ * value is enclosed in quotes.
*/
public String toString() {
return getStringValue();
@@ -258,19 +274,18 @@
/**
* Determine if this MIME type object is equal to the given object. The two
- * are equal if the given object is not null, is an instance of class
- * net.jini.print.data.MimeType, and has the same canonical form as this
- * MIME type object (that is, has the same type, subtype, and parameters).
- * Thus, if two MIME type objects are the same except for comments, they are
- * considered equal. However, "text/plain" and "text/plain;
- * charset=us-ascii" are not considered equal, even though they represent
- * the same media type (because the default character set for plain text is
- * US-ASCII).
+ * are equal if the given object is not {@code null}, is an instance of
+ * class {@code javax.print.data.MimeType}, and has the same canonical form
+ * as this MIME type object (that is, has the same type, subtype, and
+ * parameters). Thus, if two MIME type objects are the same except for
+ * comments, they are considered equal. However, "text/plain" and
+ * "text/plain; charset=us-ascii" are not considered equal, even though they
+ * represent the same media type (because the default character set for
+ * plain text is US-ASCII).
*
- * @param obj Object to test.
- *
- * @return True if this MIME type object equals {@code obj}, false
- * otherwise.
+ * @param obj {@code object} to test
+ * @return {@code true} if this MIME type object equals {@code obj},
+ * {@code false} otherwise
*/
public boolean equals (Object obj) {
return(obj != null &&
@@ -280,6 +295,8 @@
/**
* Returns this MIME type's string value in canonical form.
+ *
+ * @return the MIME type's string value in canonical form
*/
private String getStringValue() {
if (myStringValue == null) {
@@ -300,8 +317,8 @@
return myStringValue;
}
-// Hidden classes, constants, and operations for parsing a MIME media type
-// string.
+ // Hidden classes, constants, and operations for parsing a MIME media type
+ // string.
// Lexeme types.
private static final int TOKEN_LEXEME = 0;
@@ -310,7 +327,9 @@
private static final int EOF_LEXEME = 3;
private static final int ILLEGAL_LEXEME = 4;
- // Class for a lexical analyzer.
+ /**
+ *Class for a lexical analyzer.
+ */
private static class LexicalAnalyzer {
protected String mySource;
protected int mySourceLength;
@@ -459,18 +478,19 @@
break;
}
}
-
}
-
}
/**
- * Returns a lowercase version of the given string. The lowercase version
- * is constructed by applying Character.toLowerCase() to each character of
- * the given string, which maps characters to lowercase using the rules of
- * Unicode. This mapping is the same regardless of locale, whereas the
- * mapping of String.toLowerCase() may be different depending on the
+ * Returns a lowercase version of the given string. The lowercase version is
+ * constructed by applying {@code Character.toLowerCase()} to each character
+ * of the given string, which maps characters to lowercase using the rules
+ * of Unicode. This mapping is the same regardless of locale, whereas the
+ * mapping of {@code String.toLowerCase()} may be different depending on the
* default locale.
+ *
+ * @param s the string
+ * @return the lowercase version of the string
*/
private static String toUnicodeLowerCase(String s) {
int n = s.length();
@@ -483,6 +503,9 @@
/**
* Returns a version of the given string with backslashes removed.
+ *
+ * @param s the string
+ * @return the string with backslashes removed
*/
private static String removeBackslashes(String s) {
int n = s.length();
@@ -503,6 +526,10 @@
/**
* Returns a version of the string surrounded by quotes and with interior
* quotes preceded by a backslash.
+ *
+ * @param s the string
+ * @return the string surrounded by quotes and with interior quotes preceded
+ * by a backslash
*/
private static String addQuotes(String s) {
int n = s.length();
@@ -524,20 +551,17 @@
/**
* Parses the given string into canonical pieces and stores the pieces in
* {@link #myPieces myPieces}.
- * <P>
+ * <p>
* Special rules applied:
- * <UL>
- * <LI> If the media type is text, the value of a charset parameter is
- * converted to lowercase.
- * </UL>
+ * <ul>
+ * <li>If the media type is text, the value of a charset parameter is
+ * converted to lowercase.
+ * </ul>
*
- * @param s MIME media type string.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code s} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code s} does not obey the
- * syntax for a MIME media type string.
+ * @param s MIME media type string
+ * @throws NullPointerException if {@code s} is {@code null}
+ * @throws IllegalArgumentException if {@code s} does not obey the syntax
+ * for a MIME media type string
*/
private void parse(String s) {
// Initialize.
--- a/jdk/src/java.desktop/share/classes/javax/print/MultiDoc.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/MultiDoc.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,54 +28,52 @@
import java.io.IOException;
/**
- * Interface MultiDoc specifies the interface for an object that supplies more
- * than one piece of print data for a Print Job. "Doc" is a short,
+ * Interface {@code MultiDoc} specifies the interface for an object that
+ * supplies more than one piece of print data for a Print Job. "Doc" is a short,
* easy-to-pronounce term that means "a piece of print data," and a "multidoc"
- * is a group of several docs. The client passes to the Print Job an object
- * that implements interface MultiDoc, and the Print Job calls methods on
- * that object to obtain the print data.
- * <P>
- * Interface MultiDoc provides an abstraction similar to a "linked list" of
- * docs. A multidoc object is like a node in the linked list, containing the
+ * is a group of several docs. The client passes to the Print Job an object that
+ * implements interface {@code MultiDoc}, and the Print Job calls methods on
+ * that object to obtain the print data.
+ * <p>
+ * Interface {@code MultiDoc} provides an abstraction similar to a "linked list"
+ * of docs. A multidoc object is like a node in the linked list, containing the
* current doc in the list and a pointer to the next node (multidoc) in the
- * list. The Print Job can call the multidoc's {@link #getDoc()
- * getDoc()} method to get the current doc. When it's ready to go
- * on to the next doc, the Print Job can call the multidoc's {@link #next()
- * next()} method to get the next multidoc, which contains the
- * next doc. So Print Job code for accessing a multidoc might look like this:
- * <PRE>
+ * list. The Print Job can call the multidoc's {@link #getDoc() getDoc()} method
+ * to get the current doc. When it's ready to go on to the next doc, the Print
+ * Job can call the multidoc's {@link #next() next()} method to get the next
+ * multidoc, which contains the next doc. So Print Job code for accessing a
+ * multidoc might look like this:
+ *
+ * <pre>
* void processMultiDoc(MultiDoc theMultiDoc) {
*
* MultiDoc current = theMultiDoc;
-
+ *
* while (current != null) {
* processDoc (current.getDoc());
* current = current.next();
* }
* }
- * </PRE>
- * <P>
- * Of course, interface MultiDoc can be implemented in any way that fulfills
- * the contract; it doesn't have to use a linked list in the implementation.
- * <P>
- * To get all the print data for a multidoc print job, a Print Service
- * proxy could use either of two patterns:
- * <OL TYPE=1>
- * <LI>
- * The <B>interleaved</B> pattern: Get the doc from the current multidoc. Get
- * the print data representation object from the current doc. Get all the print
- * data from the print data representation object. Get the next multidoc from
- * the current multidoc, and repeat until there are no more. (The code example
- * above uses the interleaved pattern.)
- *
- * <LI>
- * The <B>all-at-once</B> pattern: Get the doc from the current multidoc, and
- * save the doc in a list. Get the next multidoc from the current multidoc, and
- * repeat until there are no more. Then iterate over the list of saved docs. Get
- * the print data representation object from the current doc. Get all the print
- * data from the print data representation object. Go to the next doc in the
- * list, and repeat until there are no more.
- * </OL>
+ * </pre>
+ * Of course, interface {@code MultiDoc} can be implemented in any way that
+ * fulfills the contract; it doesn't have to use a linked list in the
+ * implementation.
+ * <p>
+ * To get all the print data for a multidoc print job, a Print Service proxy
+ * could use either of two patterns:
+ * <ol type=1>
+ * <li>The <b>interleaved</b> pattern: Get the doc from the current multidoc.
+ * Get the print data representation object from the current doc. Get all the
+ * print data from the print data representation object. Get the next multidoc
+ * from the current multidoc, and repeat until there are no more. (The code
+ * example above uses the interleaved pattern.)
+ * <li>The <b>all-at-once</b> pattern: Get the doc from the current multidoc,
+ * and save the doc in a list. Get the next multidoc from the current
+ * multidoc, and repeat until there are no more. Then iterate over the list of
+ * saved docs. Get the print data representation object from the current doc.
+ * Get all the print data from the print data representation object. Go to the
+ * next doc in the list, and repeat until there are no more.
+ * </ol>
* Now, consider a printing client that is generating print data on the fly and
* does not have the resources to store more than one piece of print data at a
* time. If the print service proxy used the all-at-once pattern to get the
@@ -83,41 +81,37 @@
* to keep all the docs' print data around until the print service proxy comes
* back and asks for them, which the client is not able to do. To work with such
* a client, the print service proxy must use the interleaved pattern.
- * <P>
+ * <p>
* To address this problem, and to simplify the design of clients providing
-* multiple docs to a Print Job, every Print Service proxy that supports
- * multidoc print jobs is required to access a MultiDoc object using the
- * interleaved pattern. That is, given a MultiDoc object, the print service
- * proxy will call {@link #getDoc() getDoc()} one or more times
- * until it successfully obtains the current Doc object. The print service proxy
+ * multiple docs to a Print Job, every Print Service proxy that supports
+ * multidoc print jobs is required to access a {@code MultiDoc} object using the
+ * interleaved pattern. That is, given a {@code MultiDoc} object, the print
+ * service proxy will call {@link #getDoc() getDoc()} one or more times until it
+ * successfully obtains the current {@code Doc} object. The print service proxy
* will then obtain the current doc's print data, not proceeding until all the
* print data is obtained or an unrecoverable error occurs. If it is able to
- * continue, the print service proxy will then call {@link #next()
- * next()} one or more times until it successfully obtains either
- * the next MultiDoc object or an indication that there are no more. An
- * implementation of interface MultiDoc can assume the print service proxy will
- * follow this interleaved pattern; for any other pattern of usage, the MultiDoc
- * implementation's behavior is unspecified.
- * <P>
+ * continue, the print service proxy will then call {@link #next() next()} one
+ * or more times until it successfully obtains either the next {@code MultiDoc}
+ * object or an indication that there are no more. An implementation of
+ * interface {@code MultiDoc} can assume the print service proxy will follow
+ * this interleaved pattern; for any other pattern of usage, the
+ * {@code MultiDoc} implementation's behavior is unspecified.
+ * <p>
* There is no restriction on the number of client threads that may be
* simultaneously accessing the same multidoc. Therefore, all implementations of
* interface MultiDoc must be designed to be multiple thread safe. In fact, a
* client thread could be adding docs to the end of the (conceptual) list while
* a Print Job thread is simultaneously obtaining docs from the beginning of the
* list; provided the multidoc object synchronizes the threads properly, the two
- * threads will not interfere with each other
+ * threads will not interfere with each other.
*/
-
public interface MultiDoc {
-
/**
* Obtain the current doc object.
*
- * @return Current doc object.
- *
- * @exception IOException
- * Thrown if a error occurred reading the document.
+ * @return current doc object
+ * @throws IOException if an error occurred when reading the document
*/
public Doc getDoc() throws IOException;
@@ -125,12 +119,9 @@
* Go to the multidoc object that contains the next doc object in the
* sequence of doc objects.
*
- * @return Multidoc object containing the next doc object, or null if
- * there are no further doc objects.
- *
- * @exception IOException
- * Thrown if an error occurred locating the next document
+ * @return multidoc object containing the next doc object, or {@code null}
+ * if there are no further doc objects
+ * @throws IOException if an error occurred locating the next document
*/
public MultiDoc next() throws IOException;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintJob.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintJob.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,39 +28,35 @@
import javax.print.attribute.PrintRequestAttributeSet;
/**
- *
- * Obtained from a MultiDocPrintService, a MultiDocPrintJob can print a
- * specified collection of documents as a single print job with a set of
+ * Obtained from a {@code MultiDocPrintService}, a {@code MultiDocPrintJob} can
+ * print a specified collection of documents as a single print job with a set of
* job attributes.
*/
-
public interface MultiDocPrintJob extends DocPrintJob {
- /**
- * Print a MultiDoc with the specified job attributes.
- * This method should only be called once for a given print job.
- * Calling it again will not result in a new job being spooled to
- * the printer. The service implementation will define policy
- * for service interruption and recovery. Application clients which
- * want to monitor the success or failure should register a
- * PrintJobListener.
- *
- * @param multiDoc The documents to be printed. ALL must be a flavor
- * supported by the PrintJob {@literal &} PrintService.
+ /**
+ * Print a {@code MultiDoc} with the specified job attributes. This method
+ * should only be called once for a given print job. Calling it again will
+ * not result in a new job being spooled to the printer. The service
+ * implementation will define policy for service interruption and recovery.
+ * Application clients which want to monitor the success or failure should
+ * register a {@code PrintJobListener}.
*
- * @param attributes The job attributes to be applied to this print job.
- * If this parameter is null then the default attributes are used.
- *
- * @throws PrintException The exception additionally may implement
- * an interfaces which more precisely describes the cause of the exception
- * <ul>
- * <li>FlavorException.
- * If the document has a flavor not supported by this print job.
- * <li>AttributeException.
- * If one or more of the attributes are not valid for this print job.
- * </ul>
+ * @param multiDoc the documents to be printed. ALL must be a flavor
+ * supported by the PrintJob {@literal &} PrintService.
+ * @param attributes the job attributes to be applied to this print job. If
+ * this parameter is {@code null} then the default attributes are
+ * used.
+ * @throws PrintException the exception additionally may implement an
+ * interfaces which more precisely describes the cause of the
+ * exception
+ * <ul>
+ * <li>{@code FlavorException}. If the document has a flavor not
+ * supported by this print job.
+ * <li>{@code AttributeException}. If one or more of the
+ * attributes are not valid for this print job.
+ * </ul>
*/
public void print(MultiDoc multiDoc, PrintRequestAttributeSet attributes)
throws PrintException;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintService.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintService.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,18 @@
package javax.print;
-
- /** Interface MultiPrintService is the factory for a MultiDocPrintJob.
- * A MultiPrintService
- * describes the capabilities of a Printer and can be queried regarding
- * a printer's supported attributes.
- */
+/**
+ * Interface {@code MultiPrintService} is the factory for a
+ * {@code MultiDocPrintJob}. A {@code MultiPrintService} describes the
+ * capabilities of a printer and can be queried regarding a printer's supported
+ * attributes.
+ */
public interface MultiDocPrintService extends PrintService {
/**
* Create a job which can print a multiDoc.
- * @return a MultiDocPrintJob
+ *
+ * @return a {@code MultiDocPrintJob}
*/
public MultiDocPrintJob createMultiDocPrintJob();
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/PrintException.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/PrintException.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,16 @@
package javax.print;
/**
- * Class PrintException encapsulates a printing-related error condition that
- * occurred while using a Print Service instance. This base class
- * furnishes only a string description of the error. Subclasses furnish more
- * detailed information if applicable.
- *
+ * Class {@code PrintException} encapsulates a printing-related error condition
+ * that occurred while using a Print Service instance. This base class furnishes
+ * only a string description of the error. Subclasses furnish more detailed
+ * information if applicable.
*/
public class PrintException extends Exception {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -5932531546705242471L;
/**
@@ -45,7 +48,7 @@
/**
* Construct a print exception with the given detail message.
*
- * @param s Detail message, or null if no detail message.
+ * @param s detail message, or {@code null} if no detail message
*/
public PrintException (String s) {
super (s);
@@ -54,20 +57,20 @@
/**
* Construct a print exception chaining the supplied exception.
*
- * @param e Chained exception.
+ * @param e chained exception
*/
public PrintException (Exception e) {
super ( e);
}
/**
- * Construct a print exception with the given detail message
- * and chained exception.
- * @param s Detail message, or null if no detail message.
- * @param e Chained exception.
+ * Construct a print exception with the given detail message and chained
+ * exception.
+ *
+ * @param s detail message, or {@code null} if no detail message
+ * @param e chained exception
*/
public PrintException (String s, Exception e) {
super (s, e);
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/PrintService.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/PrintService.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,19 @@
package javax.print;
-import java.util.Locale;
-
import javax.print.attribute.Attribute;
import javax.print.attribute.AttributeSet;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.event.PrintServiceAttributeListener;
-
/**
- * Interface PrintService is the factory for a DocPrintJob. A PrintService
- * describes the capabilities of a Printer and can be queried regarding
- * a printer's supported attributes.
- * <P>
+ * Interface {@code PrintService} is the factory for a {@code DocPrintJob}. A
+ * {@code PrintService} describes the capabilities of a printer and can be
+ * queried regarding a printer's supported attributes.
+ * <p>
* Example:
- * <PRE>{@code
+ * <pre>{@code
* DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
* PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
* aset.add(MediaSizeName.ISO_A4);
@@ -56,299 +53,263 @@
* } catch (PrintException e) {
* }
* }
- * }</PRE>
+ * }</pre>
*/
public interface PrintService {
- /** Returns a String name for this print service which may be used
- * by applications to request a particular print service.
- * In a suitable context, such as a name service, this name must be
- * unique.
- * In some environments this unique name may be the same as the user
- * friendly printer name defined as the
- * {@link javax.print.attribute.standard.PrinterName PrinterName}
- * attribute.
- * @return name of the service.
- */
+ /**
+ * Returns a string name for this print service which may be used by
+ * applications to request a particular print service. In a suitable
+ * context, such as a name service, this name must be unique. In some
+ * environments this unique name may be the same as the user friendly
+ * printer name defined as the
+ * {@link javax.print.attribute.standard.PrinterName PrinterName} attribute.
+ *
+ * @return name of the service
+ */
public String getName();
/**
- * Creates and returns a PrintJob capable of handling data from
- * any of the supported document flavors.
- * @return a DocPrintJob object
+ * Creates and returns a {@code PrintJob} capable of handling data from any
+ * of the supported document flavors.
+ *
+ * @return a {@code DocPrintJob} object
*/
public DocPrintJob createPrintJob();
/**
- * Registers a listener for events on this PrintService.
- * @param listener a PrintServiceAttributeListener, which
- * monitors the status of a print service
+ * Registers a listener for events on this {@code PrintService}.
+ *
+ * @param listener a PrintServiceAttributeListener, which monitors the
+ * status of a print service
* @see #removePrintServiceAttributeListener
*/
public void addPrintServiceAttributeListener(
PrintServiceAttributeListener listener);
/**
- * Removes the print-service listener from this print service.
- * This means the listener is no longer interested in
- * {@code PrintService} events.
- * @param listener a PrintServiceAttributeListener object
+ * Removes the print-service listener from this print service. This means
+ * the listener is no longer interested in {@code PrintService} events.
+ *
+ * @param listener a {@code PrintServiceAttributeListener} object
* @see #addPrintServiceAttributeListener
*/
public void removePrintServiceAttributeListener(
PrintServiceAttributeListener listener);
/**
- * Obtains this print service's set of printer description attributes
- * giving this Print Service's status. The returned attribute set object
- * is unmodifiable. The returned attribute set object is a "snapshot" of
- * this Print Service's attribute set at the time of the
- * {@code getAttributes()} method call: that is, the returned
- * attribute set's contents will <I>not</I> be updated if this print
- * service's attribute set's contents change in the future. To detect
- * changes in attribute values, call {@code getAttributes()} again
- * and compare the new attribute set to the previous attribute set;
- * alternatively, register a listener for print service events.
+ * Obtains this print service's set of printer description attributes giving
+ * this Print Service's status. The returned attribute set object is
+ * unmodifiable. The returned attribute set object is a "snapshot" of this
+ * Print Service's attribute set at the time of the {@code getAttributes()}
+ * method call: that is, the returned attribute set's contents will
+ * <i>not</i> be updated if this print service's attribute set's contents
+ * change in the future. To detect changes in attribute values, call
+ * {@code getAttributes()} again and compare the new attribute set to the
+ * previous attribute set; alternatively, register a listener for print
+ * service events.
*
- * @return Unmodifiable snapshot of this Print Service's attribute set.
- * May be empty, but not null.
+ * @return unmodifiable snapshot of this Print Service's attribute set. May
+ * be empty, but not {@code null}.
*/
public PrintServiceAttributeSet getAttributes();
/**
- * Gets the value of the single specified service attribute.
- * This may be useful to clients which only need the value of one
- * attribute and want to minimize overhead.
- * @param <T> the type of the specified service attribute
- * @param category the category of a PrintServiceAttribute supported
- * by this service - may not be null.
- * @return the value of the supported attribute or null if the
- * attribute is not supported by this service.
- * @exception NullPointerException if the category is null.
- * @exception IllegalArgumentException
- * (unchecked exception) if {@code category} is not a
- * {@code Class} that implements interface
- *{@link javax.print.attribute.PrintServiceAttribute PrintServiceAttribute}.
+ * Gets the value of the single specified service attribute. This may be
+ * useful to clients which only need the value of one attribute and want to
+ * minimize overhead.
+ *
+ * @param <T> the type of the specified service attribute
+ * @param category the category of a {@code PrintServiceAttribute}
+ * supported by this service - may not be {@code null}
+ * @return the value of the supported attribute or {@code null} if the
+ * attribute is not supported by this service
+ * @throws NullPointerException if the category is {@code null}
+ * @throws IllegalArgumentException if {@code category} is not a
+ * {@code Class} that implements interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}
*/
public <T extends PrintServiceAttribute>
T getAttribute(Class<T> category);
/**
- * Determines the print data formats a client can specify when setting
- * up a job for this {@code PrintService}. A print data format is
- * designated by a "doc
- * flavor" (class {@link javax.print.DocFlavor DocFlavor})
- * consisting of a MIME type plus a print data representation class.
- * <P>
- * Note that some doc flavors may not be supported in combination
- * with all attributes. Use {@code getUnsupportedAttributes(..)}
- * to validate specific combinations.
+ * Determines the print data formats a client can specify when setting up a
+ * job for this {@code PrintService}. A print data format is designated by a
+ * "doc flavor" (class {@link DocFlavor DocFlavor}) consisting of a MIME
+ * type plus a print data representation class.
+ * <p>
+ * Note that some doc flavors may not be supported in combination with all
+ * attributes. Use {@code getUnsupportedAttributes(..)} to validate specific
+ * combinations.
*
- * @return Array of supported doc flavors, should have at least
- * one element.
- *
+ * @return array of supported doc flavors, should have at least one element
*/
public DocFlavor[] getSupportedDocFlavors();
/**
- * Determines if this print service supports a specific
- * {@code DocFlavor}. This is a convenience method to determine
- * if the {@code DocFlavor} would be a member of the result of
- * {@code getSupportedDocFlavors()}.
+ * Determines if this print service supports a specific {@code DocFlavor}.
+ * This is a convenience method to determine if the {@code DocFlavor} would
+ * be a member of the result of {@code getSupportedDocFlavors()}.
* <p>
- * Note that some doc flavors may not be supported in combination
- * with all attributes. Use {@code getUnsupportedAttributes(..)}
- * to validate specific combinations.
+ * Note that some doc flavors may not be supported in combination with all
+ * attributes. Use {@code getUnsupportedAttributes(..)} to validate specific
+ * combinations.
*
- * @param flavor the {@code DocFlavor} to query for support.
- * @return {@code true} if this print service supports the
- * specified {@code DocFlavor}; {@code false} otherwise.
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code flavor} is null.
+ * @param flavor the {@code DocFlavor} to query for support
+ * @return {@code true} if this print service supports the specified
+ * {@code DocFlavor}; {@code false} otherwise
+ * @throws NullPointerException if {@code flavor} is {@code null}
*/
public boolean isDocFlavorSupported(DocFlavor flavor);
-
/**
- * Determines the printing attribute categories a client can specify
- * when setting up a job for this print service.
- * A printing attribute category is
+ * Determines the printing attribute categories a client can specify when
+ * setting up a job for this print service. A printing attribute category is
* designated by a {@code Class} that implements interface
- * {@link javax.print.attribute.Attribute Attribute}. This method returns
- * just the attribute <I>categories</I> that are supported; it does not
- * return the particular attribute <I>values</I> that are supported.
- * <P>
- * This method returns all the printing attribute
- * categories this print service supports for any possible job.
- * Some categories may not be supported in a particular context (ie
- * for a particular {@code DocFlavor}).
- * Use one of the methods that include a {@code DocFlavor} to
- * validate the request before submitting it, such as
+ * {@link Attribute Attribute}. This method returns just the attribute
+ * <i>categories</i> that are supported; it does not return the particular
+ * attribute <i>values</i> that are supported.
+ * <p>
+ * This method returns all the printing attribute categories this print
+ * service supports for any possible job. Some categories may not be
+ * supported in a particular context (ie for a particular
+ * {@code DocFlavor}). Use one of the methods that include a
+ * {@code DocFlavor} to validate the request before submitting it, such as
* {@code getSupportedAttributeValues(..)}.
*
- * @return Array of printing attribute categories that the client can
- * specify as a doc-level or job-level attribute in a Print
- * Request. Each element in the array is a {@link java.lang.Class
- * Class} that implements interface {@link
- * javax.print.attribute.Attribute Attribute}.
- * The array is empty if no categories are supported.
+ * @return array of printing attribute categories that the client can
+ * specify as a doc-level or job-level attribute in a Print Request.
+ * Each element in the array is a {@link Class Class} that
+ * implements interface {@link Attribute Attribute}. The array is
+ * empty if no categories are supported.
*/
public Class<?>[] getSupportedAttributeCategories();
/**
- * Determines whether a client can specify the given printing
- * attribute category when setting up a job for this print service. A
- * printing attribute category is designated by a {@code Class}
- * that implements interface {@link javax.print.attribute.Attribute
- * Attribute}. This method tells whether the attribute <I>category</I> is
- * supported; it does not tell whether a particular attribute <I>value</I>
- * is supported.
+ * Determines whether a client can specify the given printing attribute
+ * category when setting up a job for this print service. A printing
+ * attribute category is designated by a {@code Class} that implements
+ * interface {@link Attribute Attribute}. This method
+ * tells whether the attribute <i>category</i> is supported; it does not
+ * tell whether a particular attribute <i>value</i> is supported.
* <p>
- * Some categories may not be supported in a particular context (ie
- * for a particular {@code DocFlavor}).
- * Use one of the methods which include a {@code DocFlavor} to
- * validate the request before submitting it, such as
+ * Some categories may not be supported in a particular context (ie for a
+ * particular {@code DocFlavor}). Use one of the methods which include a
+ * {@code DocFlavor} to validate the request before submitting it, such as
* {@code getSupportedAttributeValues(..)}.
- * <P>
- * This is a convenience method to determine if the category
- * would be a member of the result of
- * {@code getSupportedAttributeCategories()}.
- *
- * @param category Printing attribute category to test. It must be a
- * {@code Class} that implements
- * interface
- * {@link javax.print.attribute.Attribute Attribute}.
+ * <p>
+ * This is a convenience method to determine if the category would be a
+ * member of the result of {@code getSupportedAttributeCategories()}.
*
- * @return {@code true} if this print service supports
- * specifying a doc-level or
- * job-level attribute in {@code category} in a Print
- * Request; {@code false} if it doesn't.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code category} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code category} is not a
- * {@code Class} that implements interface
- * {@link javax.print.attribute.Attribute Attribute}.
+ * @param category printing attribute category to test. It must be a
+ * {@code Class} that implements interface
+ * {@link Attribute Attribute}.
+ * @return {@code true} if this print service supports specifying a
+ * doc-level or job-level attribute in {@code category} in a Print
+ * Request; {@code false} if it doesn't
+ * @throws NullPointerException if {@code category} is {@code null}
+ * @throws IllegalArgumentException if {@code category} is not a
+ * {@code Class} that implements interface
+ * {@link Attribute Attribute}
*/
public boolean
isAttributeCategorySupported(Class<? extends Attribute> category);
/**
- * Determines this print service's default printing attribute value in
- * the given category. A printing attribute value is an instance of
- * a class that implements interface
- * {@link javax.print.attribute.Attribute Attribute}. If a client sets
- * up a print job and does not specify any attribute value in the
- * given category, this Print Service will use the
- * default attribute value instead.
+ * Determines this print service's default printing attribute value in the
+ * given category. A printing attribute value is an instance of a class that
+ * implements interface {@link Attribute Attribute}. If a client sets up a
+ * print job and does not specify any attribute value in the given category,
+ * this Print Service will use the default attribute value instead.
* <p>
- * Some attributes may not be supported in a particular context (ie
- * for a particular {@code DocFlavor}).
- * Use one of the methods that include a {@code DocFlavor} to
- * validate the request before submitting it, such as
+ * Some attributes may not be supported in a particular context (ie for a
+ * particular {@code DocFlavor}). Use one of the methods that include a
+ * {@code DocFlavor} to validate the request before submitting it, such as
* {@code getSupportedAttributeValues(..)}.
- * <P>
- * Not all attributes have a default value. For example the
- * service will not have a defaultvalue for {@code RequestingUser}
- * i.e. a null return for a supported category means there is no
- * service default value for that category. Use the
- * {@code isAttributeCategorySupported(Class)} method to
- * distinguish these cases.
+ * <p>
+ * Not all attributes have a default value. For example the service will not
+ * have a default value for {@code RequestingUser} i.e. a {@code null}
+ * return for a supported category means there is no service default value
+ * for that category. Use the {@code isAttributeCategorySupported(Class)}
+ * method to distinguish these cases.
*
- * @param category Printing attribute category for which the default
- * attribute value is requested. It must be a {@link
- * java.lang.Class Class} that implements interface
- * {@link javax.print.attribute.Attribute
- * Attribute}.
- *
- * @return Default attribute value for {@code category}, or null
- * if this Print Service does not support specifying a doc-level or
- * job-level attribute in {@code category} in a Print
- * Request, or the service does not have a default value
- * for this attribute.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code category} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code category} is not a
- * {@link java.lang.Class Class} that implements interface {@link
- * javax.print.attribute.Attribute Attribute}.
+ * @param category printing attribute category for which the default
+ * attribute value is requested. It must be a {@link Class Class}
+ * that implements interface {@link Attribute Attribute}.
+ * @return default attribute value for {@code category}, or {@code null} if
+ * this Print Service does not support specifying a doc-level or
+ * job-level attribute in {@code category} in a Print Request, or
+ * the service does not have a default value for this attribute
+ * @throws NullPointerException if {@code category} is {@code null}
+ * @throws IllegalArgumentException if {@code category} is not a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}
*/
public Object
getDefaultAttributeValue(Class<? extends Attribute> category);
/**
- * Determines the printing attribute values a client can specify in
- * the given category when setting up a job for this print service. A
- * printing
+ * Determines the printing attribute values a client can specify in the
+ * given category when setting up a job for this print service. A printing
* attribute value is an instance of a class that implements interface
- * {@link javax.print.attribute.Attribute Attribute}.
- * <P>
- * If {@code flavor} is null and {@code attributes} is null
- * or is an empty set, this method returns all the printing attribute
- * values this Print Service supports for any possible job. If
- * {@code flavor} is not null or {@code attributes} is not
- * an empty set, this method returns just the printing attribute values
- * that are compatible with the given doc flavor and/or set of attributes.
- * That is, a null return value may indicate that specifying this attribute
- * is incompatible with the specified DocFlavor.
- * Also if DocFlavor is not null it must be a flavor supported by this
- * PrintService, else IllegalArgumentException will be thrown.
- * <P>
- * If the {@code attributes} parameter contains an Attribute whose
- * category is the same as the {@code category} parameter, the service
- * must ignore this attribute in the AttributeSet.
+ * {@link Attribute Attribute}.
* <p>
- * {@code DocAttribute}s which are to be specified on the
- * {@code Doc} must be included in this set to accurately
- * represent the context.
+ * If {@code flavor} is {@code null} and {@code attributes} is {@code null}
+ * or is an empty set, this method returns all the printing attribute values
+ * this Print Service supports for any possible job. If {@code flavor} is not
+ * {@code null} or {@code attributes} is not an empty set, this method
+ * returns just the printing attribute values that are compatible with the
+ * given doc flavor and/or set of attributes. That is, a {@code null} return
+ * value may indicate that specifying this attribute is incompatible with
+ * the specified DocFlavor. Also if {@code DocFlavor} is not {@code null} it
+ * must be a flavor supported by this {@code PrintService}, else
+ * {@code IllegalArgumentException} will be thrown.
* <p>
- * This method returns an Object because different printing attribute
- * categories indicate the supported attribute values in different ways.
- * The documentation for each printing attribute in package {@link
- * javax.print.attribute.standard javax.print.attribute.standard}
+ * If the {@code attributes} parameter contains an {@code Attribute} whose
+ * category is the same as the {@code category} parameter, the service must
+ * ignore this attribute in the {@code AttributeSet}.
+ * <p>
+ * {@code DocAttribute}s which are to be specified on the {@code Doc} must
+ * be included in this set to accurately represent the context.
+ * <p>
+ * This method returns an {@code Object} because different printing
+ * attribute categories indicate the supported attribute values in different
+ * ways. The documentation for each printing attribute in package
+ * {@link javax.print.attribute.standard javax.print.attribute.standard}
* describes how each attribute indicates its supported values. Possible
* ways of indicating support include:
- * <UL>
- * <LI>
- * Return a single instance of the attribute category to indicate that any
- * value is legal -- used, for example, by an attribute whose value is an
- * arbitrary text string. (The value of the returned attribute object is
- * irrelevant.)
- * <LI>
- * Return an array of one or more instances of the attribute category,
- * containing the legal values -- used, for example, by an attribute with
- * a list of enumerated values. The type of the array is an array of the
- * specified attribute category type as returned by its
- * {@code getCategory(Class)}.
- * <LI>
- * Return a single object (of some class other than the attribute category)
- * that indicates bounds on the legal values -- used, for example, by an
- * integer-valued attribute that must lie within a certain range.
- * </UL>
+ * <ul>
+ * <li>Return a single instance of the attribute category to indicate that
+ * any value is legal -- used, for example, by an attribute whose value is
+ * an arbitrary text string. (The value of the returned attribute object
+ * is irrelevant.)
+ * <li>Return an array of one or more instances of the attribute category,
+ * containing the legal values -- used, for example, by an attribute with
+ * a list of enumerated values. The type of the array is an array of the
+ * specified attribute category type as returned by its
+ * {@code getCategory(Class)}.
+ * <li>Return a single object (of some class other than the attribute
+ * category) that indicates bounds on the legal values -- used, for
+ * example, by an integer-valued attribute that must lie within a certain
+ * range.
+ * </ul>
*
- * @param category Printing attribute category to test. It must be a
- * {@link java.lang.Class Class} that implements
- * interface {@link
- * javax.print.attribute.Attribute Attribute}.
- * @param flavor Doc flavor for a supposed job, or null.
- * @param attributes Set of printing attributes for a supposed job
- * (both job-level attributes and document-level
- * attributes), or null.
- *
- * @return Object indicating supported values for {@code category},
- * or null if this Print Service does not support specifying a
- * doc-level or job-level attribute in {@code category} in
- * a Print Request.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code category} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code category} is not a
- * {@link java.lang.Class Class} that implements interface {@link
- * javax.print.attribute.Attribute Attribute}, or
- * {@code DocFlavor} is not supported by this service.
+ * @param category printing attribute category to test. It must be a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}.
+ * @param flavor doc flavor for a supposed job, or {@code null}
+ * @param attributes set of printing attributes for a supposed job (both
+ * job-level attributes and document-level attributes), or
+ * {@code null}
+ * @return object indicating supported values for {@code category}, or
+ * {@code null} if this Print Service does not support specifying a
+ * doc-level or job-level attribute in {@code category} in a Print
+ * Request
+ * @throws NullPointerException if {@code category} is {@code null}
+ * @throws IllegalArgumentException if {@code category} is not a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}, or {@code DocFlavor} is not
+ * supported by this service
*/
public Object
getSupportedAttributeValues(Class<? extends Attribute> category,
@@ -356,133 +317,121 @@
AttributeSet attributes);
/**
- * Determines whether a client can specify the given printing
- * attribute
- * value when setting up a job for this Print Service. A printing
- * attribute value is an instance of a class that implements interface
- * {@link javax.print.attribute.Attribute Attribute}.
- * <P>
- * If {@code flavor} is null and {@code attributes} is null or
- * is an empty set, this method tells whether this Print Service supports
+ * Determines whether a client can specify the given printing attribute
+ * value when setting up a job for this Print Service. A printing attribute
+ * value is an instance of a class that implements interface
+ * {@link Attribute Attribute}.
+ * <p>
+ * If {@code flavor} is {@code null} and {@code attributes} is {@code null}
+ * or is an empty set, this method tells whether this Print Service supports
* the given printing attribute value for some possible combination of doc
- * flavor and set of attributes. If {@code flavor} is not null or
- * {@code attributes} is not an empty set, this method tells whether
- * this Print Service supports the given printing attribute value in
- * combination with the given doc flavor and/or set of attributes.
+ * flavor and set of attributes. If {@code flavor} is not {@code null} or
+ * {@code attributes} is not an empty set, this method tells whether this
+ * Print Service supports the given printing attribute value in combination
+ * with the given doc flavor and/or set of attributes.
* <p>
- * Also if DocFlavor is not null it must be a flavor supported by this
- * PrintService, else IllegalArgumentException will be thrown.
+ * Also if {@code DocFlavor} is not {@code null} it must be a flavor
+ * supported by this {@code PrintService}, else
+ * {@code IllegalArgumentException} will be thrown.
* <p>
- * {@code DocAttribute}s which are to be specified on the
- * {@code Doc} must be included in this set to accurately
- * represent the context.
+ * {@code DocAttribute}s which are to be specified on the {@code Doc} must
+ * be included in this set to accurately represent the context.
* <p>
- * This is a convenience method to determine if the value
- * would be a member of the result of
- * {@code getSupportedAttributeValues(...)}.
+ * This is a convenience method to determine if the value would be a member
+ * of the result of {@code getSupportedAttributeValues(...)}.
*
- * @param attrval Printing attribute value to test.
- * @param flavor Doc flavor for a supposed job, or null.
- * @param attributes Set of printing attributes for a supposed job
- * (both job-level attributes and document-level
- * attributes), or null.
- *
- * @return True if this Print Service supports specifying
- * {@code attrval} as a doc-level or job-level attribute in a
- * Print Request, false if it doesn't.
- *
- * @exception NullPointerException
- * (unchecked exception) if {@code attrval} is null.
- * @exception IllegalArgumentException if flavor is not supported by
- * this PrintService.
+ * @param attrval printing attribute value to test
+ * @param flavor doc flavor for a supposed job, or {@code null}
+ * @param attributes set of printing attributes for a supposed job (both
+ * job-level attributes and document-level attributes), or
+ * {@code null}
+ * @return {@code true} if this Print Service supports specifying
+ * {@code attrval} as a doc-level or job-level attribute in a Print
+ * Request, {@code false} if it doesn't
+ * @throws NullPointerException if {@code attrval} is {@code null}
+ * @throws IllegalArgumentException if flavor is not supported by this
+ * {@code PrintService}
*/
public boolean isAttributeValueSupported(Attribute attrval,
DocFlavor flavor,
AttributeSet attributes);
-
/**
- * Identifies the attributes that are unsupported for a print request
- * in the context of a particular DocFlavor.
- * This method is useful for validating a potential print job and
- * identifying the specific attributes which cannot be supported.
- * It is important to supply only a supported DocFlavor or an
- * IllegalArgumentException will be thrown. If the
- * return value from this method is null, all attributes are supported.
+ * Identifies the attributes that are unsupported for a print request in the
+ * context of a particular {@code DocFlavor}. This method is useful for
+ * validating a potential print job and identifying the specific attributes
+ * which cannot be supported. It is important to supply only a supported
+ * {@code DocFlavor} or an {@code IllegalArgumentException} will be thrown.
+ * If the return value from this method is {@code null}, all attributes are
+ * supported.
* <p>
- * {@code DocAttribute}s which are to be specified on the
- * {@code Doc} must be included in this set to accurately
- * represent the context.
+ * {@code DocAttribute}s which are to be specified on the {@code Doc} must
+ * be included in this set to accurately represent the context.
* <p>
- * If the return value is non-null, all attributes in the returned
- * set are unsupported with this DocFlavor. The returned set does not
- * distinguish attribute categories that are unsupported from
+ * If the return value is {@code non-null}, all attributes in the returned
+ * set are unsupported with this {@code DocFlavor}. The returned set does
+ * not distinguish attribute categories that are unsupported from
* unsupported attribute values.
* <p>
- * A supported print request can then be created by removing
- * all unsupported attributes from the original attribute set,
- * except in the case that the DocFlavor is unsupported.
+ * A supported print request can then be created by removing all unsupported
+ * attributes from the original attribute set, except in the case that the
+ * {@code DocFlavor} is unsupported.
* <p>
- * If any attributes are unsupported only because they are in conflict
- * with other attributes then it is at the discretion of the service
- * to select the attribute(s) to be identified as the cause of the
- * conflict.
+ * If any attributes are unsupported only because they are in conflict with
+ * other attributes then it is at the discretion of the service to select
+ * the attribute(s) to be identified as the cause of the conflict.
* <p>
- * Use {@code isDocFlavorSupported()} to verify that a DocFlavor
- * is supported before calling this method.
+ * Use {@code isDocFlavorSupported()} to verify that a {@code DocFlavor} is
+ * supported before calling this method.
*
- * @param flavor Doc flavor to test, or null
- * @param attributes Set of printing attributes for a supposed job
- * (both job-level attributes and document-level
- * attributes), or null.
- *
- * @return null if this Print Service supports the print request
- * specification, else the unsupported attributes.
- *
- * @exception IllegalArgumentException if {@code flavor} is
- * not supported by this PrintService.
+ * @param flavor doc flavor to test, or {@code null}
+ * @param attributes set of printing attributes for a supposed job (both
+ * job-level attributes and document-level attributes), or
+ * {@code null}
+ * @return {@code null} if this Print Service supports the print request
+ * specification, else the unsupported attributes
+ * @throws IllegalArgumentException if {@code flavor} is not supported by
+ * this {@code PrintService}
*/
public AttributeSet getUnsupportedAttributes(DocFlavor flavor,
AttributeSet attributes);
/**
- * Returns a factory for UI components which allow users to interact
- * with the service in various roles.
- * Services which do not provide any UI should return null.
- * Print Services which do provide UI but want to be supported in
- * an environment with no UI support should ensure that the factory
- * is not initialised unless the application calls this method to
- * obtain the factory.
- * See {@code ServiceUIFactory} for more information.
- * @return null or a factory for UI components.
+ * Returns a factory for UI components which allow users to interact with
+ * the service in various roles. Services which do not provide any UI should
+ * return {@code null}. Print Services which do provide UI but want to be
+ * supported in an environment with no UI support should ensure that the
+ * factory is not initialised unless the application calls this method to
+ * obtain the factory. See {@code ServiceUIFactory} for more information.
+ *
+ * @return {@code null} or a factory for UI components
*/
public ServiceUIFactory getServiceUIFactory();
/**
- * Determines if two services are referring to the same underlying
- * service. Objects encapsulating a print service may not exhibit
- * equality of reference even though they refer to the same underlying
- * service.
+ * Determines if two services are referring to the same underlying service.
+ * Objects encapsulating a print service may not exhibit equality of
+ * reference even though they refer to the same underlying service.
* <p>
* Clients should call this method to determine if two services are
* referring to the same underlying service.
* <p>
- * Services must implement this method and return true only if the
- * service objects being compared may be used interchangeably by the
- * client.
+ * Services must implement this method and return {@code true} only if the
+ * service objects being compared may be used interchangeably by the client.
* Services are free to return the same object reference to an underlying
* service if that, but clients must not depend on equality of reference.
- * @param obj the reference object with which to compare.
- * @return true if this service is the same as the obj argument,
- * false otherwise.
+ *
+ * @param obj the reference object with which to compare
+ * @return {@code true} if this service is the same as the obj argument,
+ * {@code false} otherwise
*/
public boolean equals(Object obj);
/**
* This method should be implemented consistently with
* {@code equals(Object)}.
- * @return hash code of this object.
+ *
+ * @return hash code of this object
*/
public int hashCode();
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,56 +23,69 @@
* questions.
*/
-
package javax.print;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
+
import javax.print.attribute.AttributeSet;
import sun.awt.AppContext;
-import java.util.ServiceLoader;
-import java.util.ServiceConfigurationError;
-/** Implementations of this class provide lookup services for
- * print services (typically equivalent to printers) of a particular type.
- * <p>
- * Multiple implementations may be installed concurrently.
- * All implementations must be able to describe the located printers
- * as instances of a PrintService.
- * Typically implementations of this service class are located
- * automatically in JAR files (see the SPI JAR file specification).
- * These classes must be instantiable using a default constructor.
- * Alternatively applications may explicitly register instances
- * at runtime.
- * <p>
- * Applications use only the static methods of this abstract class.
- * The instance methods are implemented by a service provider in a subclass
- * and the unification of the results from all installed lookup classes
- * are reported by the static methods of this class when called by
- * the application.
- * <p>
- * A PrintServiceLookup implementor is recommended to check for the
- * SecurityManager.checkPrintJobAccess() to deny access to untrusted code.
- * Following this recommended policy means that untrusted code may not
- * be able to locate any print services. Downloaded applets are the most
- * common example of untrusted code.
- * <p>
- * This check is made on a per lookup service basis to allow flexibility in
- * the policy to reflect the needs of different lookup services.
- * <p>
- * Services which are registered by registerService(PrintService)
- * will not be included in lookup results if a security manager is
- * installed and its checkPrintJobAccess() method denies access.
- */
-
+/**
+ * Implementations of this class provide lookup services for print services
+ * (typically equivalent to printers) of a particular type.
+ * <p>
+ * Multiple implementations may be installed concurrently. All implementations
+ * must be able to describe the located printers as instances of a
+ * {@code PrintService}. Typically implementations of this service class are
+ * located automatically in JAR files (see the SPI JAR file specification).
+ * These classes must be instantiable using a default constructor. Alternatively
+ * applications may explicitly register instances at runtime.
+ * <p>
+ * Applications use only the static methods of this abstract class. The instance
+ * methods are implemented by a service provider in a subclass and the
+ * unification of the results from all installed lookup classes are reported by
+ * the static methods of this class when called by the application.
+ * <p>
+ * A {@code PrintServiceLookup} implementor is recommended to check for the
+ * {@code SecurityManager.checkPrintJobAccess()} to deny access to untrusted
+ * code. Following this recommended policy means that untrusted code may not be
+ * able to locate any print services. Downloaded applets are the most common
+ * example of untrusted code.
+ * <p>
+ * This check is made on a per lookup service basis to allow flexibility in the
+ * policy to reflect the needs of different lookup services.
+ * <p>
+ * Services which are registered by {@link #registerService(PrintService)} will
+ * not be included in lookup results if a security manager is installed and its
+ * {@code checkPrintJobAccess()} method denies access.
+ */
public abstract class PrintServiceLookup {
+ /**
+ * Contains a lists of services.
+ */
static class Services {
+
+ /**
+ * The list of lookup services.
+ */
private ArrayList<PrintServiceLookup> listOfLookupServices = null;
+
+ /**
+ * The list of registered services.
+ */
private ArrayList<PrintService> registeredServices = null;
}
+ /**
+ * Returns the services from the current appcontext.
+ *
+ * @return the services
+ */
private static Services getServicesForContext() {
Services services =
(Services)AppContext.getAppContext().get(Services.class);
@@ -83,21 +96,40 @@
return services;
}
+ /**
+ * Returns the list of lookup services.
+ *
+ * @return the list of lookup services
+ */
private static ArrayList<PrintServiceLookup> getListOfLookupServices() {
return getServicesForContext().listOfLookupServices;
}
+ /**
+ * Initialize the list of lookup services.
+ *
+ * @return the list of lookup services
+ */
private static ArrayList<PrintServiceLookup> initListOfLookupServices() {
ArrayList<PrintServiceLookup> listOfLookupServices = new ArrayList<>();
getServicesForContext().listOfLookupServices = listOfLookupServices;
return listOfLookupServices;
}
-
+ /**
+ * Returns the list of registered services.
+ *
+ * @return the list of registered services
+ */
private static ArrayList<PrintService> getRegisteredServices() {
return getServicesForContext().registeredServices;
}
+ /**
+ * Initialize the list of registered services.
+ *
+ * @return the list of registered services
+ */
private static ArrayList<PrintService> initRegisteredServices() {
ArrayList<PrintService> registeredServices = new ArrayList<>();
getServicesForContext().registeredServices = registeredServices;
@@ -108,14 +140,13 @@
* Locates print services capable of printing the specified
* {@link DocFlavor}.
*
- * @param flavor the flavor to print. If null, this constraint is not
- * used.
- * @param attributes attributes that the print service must support.
- * If null this constraint is not used.
- *
- * @return array of matching {@code PrintService} objects
- * representing print services that support the specified flavor
- * attributes. If no services match, the array is zero-length.
+ * @param flavor the flavor to print. If {@code null}, this constraint is
+ * not used.
+ * @param attributes attributes that the print service must support. If
+ * {@code null} this constraint is not used.
+ * @return array of matching {@code PrintService} objects representing print
+ * services that support the specified flavor attributes. If no
+ * services match, the array is zero-length.
*/
public static final PrintService[]
lookupPrintServices(DocFlavor flavor,
@@ -124,26 +155,23 @@
return list.toArray(new PrintService[list.size()]);
}
-
/**
- * Locates MultiDoc print Services capable of printing MultiDocs
- * containing all the specified doc flavors.
- * <P> This method is useful to help locate a service that can print
- * a {@code MultiDoc} in which the elements may be different
- * flavors. An application could perform this itself by multiple lookups
- * on each {@code DocFlavor} in turn and collating the results,
- * but the lookup service may be able to do this more efficiently.
+ * Locates {@code MultiDoc} print {@code Services} capable of printing
+ * {@code MultiDocs} containing all the specified doc flavors.
+ * <p>
+ * This method is useful to help locate a service that can print a
+ * {@code MultiDoc} in which the elements may be different flavors. An
+ * application could perform this itself by multiple lookups on each
+ * {@code DocFlavor} in turn and collating the results, but the lookup
+ * service may be able to do this more efficiently.
*
- * @param flavors the flavors to print. If null or empty this
- * constraint is not used.
- * Otherwise return only multidoc print services that can print all
- * specified doc flavors.
- * @param attributes attributes that the print service must
- * support. If null this constraint is not used.
- *
- * @return array of matching {@link MultiDocPrintService} objects.
- * If no services match, the array is zero-length.
- *
+ * @param flavors the flavors to print. If {@code null} or empty this
+ * constraint is not used. Otherwise return only multidoc print
+ * services that can print all specified doc flavors.
+ * @param attributes attributes that the print service must support. If
+ * {@code null} this constraint is not used.
+ * @return array of matching {@link MultiDocPrintService} objects. If no
+ * services match, the array is zero-length.
*/
public static final MultiDocPrintService[]
lookupMultiDocPrintServices(DocFlavor[] flavors,
@@ -152,28 +180,23 @@
return list.toArray(new MultiDocPrintService[list.size()]);
}
-
/**
- * Locates the default print service for this environment.
- * This may return null.
- * If multiple lookup services each specify a default, the
- * chosen service is not precisely defined, but a
- * platform native service, rather than an installed service,
- * is usually returned as the default. If there is no clearly
- * identifiable
- * platform native default print service, the default is the first
- * to be located in an implementation-dependent manner.
+ * Locates the default print service for this environment. This may return
+ * {@code null}. If multiple lookup services each specify a default, the
+ * chosen service is not precisely defined, but a platform native service,
+ * rather than an installed service, is usually returned as the default. If
+ * there is no clearly identifiable platform native default print service,
+ * the default is the first to be located in an implementation-dependent
+ * manner.
* <p>
- * This may include making use of any preferences API that is available
- * as part of the Java or native platform.
- * This algorithm may be overridden by a user setting the property
- * javax.print.defaultPrinter.
- * A service specified must be discovered to be valid and currently
- * available to be returned as the default.
+ * This may include making use of any preferences API that is available as
+ * part of the Java or native platform. This algorithm may be overridden by
+ * a user setting the property {@code javax.print.defaultPrinter}. A service
+ * specified must be discovered to be valid and currently available to be
+ * returned as the default.
*
- * @return the default PrintService.
+ * @return the default {@code PrintService}
*/
-
public static final PrintService lookupDefaultPrintService() {
Iterator<PrintServiceLookup> psIterator = getAllLookupServices().iterator();
@@ -190,19 +213,16 @@
return null;
}
-
/**
- * Allows an application to explicitly register a class that
- * implements lookup services. The registration will not persist
- * across VM invocations.
- * This is useful if an application needs to make a new service
- * available that is not part of the installation.
- * If the lookup service is already registered, or cannot be registered,
- * the method returns false.
+ * Allows an application to explicitly register a class that implements
+ * lookup services. The registration will not persist across VM invocations.
+ * This is useful if an application needs to make a new service available
+ * that is not part of the installation. If the lookup service is already
+ * registered, or cannot be registered, the method returns {@code false}.
*
- * @param sp an implementation of a lookup service.
- * @return {@code true} if the new lookup service is newly
- * registered; {@code false} otherwise.
+ * @param sp an implementation of a lookup service
+ * @return {@code true} if the new lookup service is newly registered;
+ * {@code false} otherwise
*/
public static boolean registerServiceProvider(PrintServiceLookup sp) {
synchronized (PrintServiceLookup.class) {
@@ -220,29 +240,24 @@
getListOfLookupServices().add(sp);
return true;
}
-
}
-
/**
- * Allows an application to directly register an instance of a
- * class which implements a print service.
- * The lookup operations for this service will be
- * performed by the PrintServiceLookup class using the attribute
- * values and classes reported by the service.
- * This may be less efficient than a lookup
- * service tuned for that service.
- * Therefore registering a {@code PrintServiceLookup} instance
- * instead is recommended.
- * The method returns true if this service is not previously
- * registered and is now successfully registered.
- * This method should not be called with StreamPrintService instances.
- * They will always fail to register and the method will return false.
- * @param service an implementation of a print service.
- * @return {@code true} if the service is newly
- * registered; {@code false} otherwise.
+ * Allows an application to directly register an instance of a class which
+ * implements a print service. The lookup operations for this service will
+ * be performed by the {@code PrintServiceLookup} class using the attribute
+ * values and classes reported by the service. This may be less efficient
+ * than a lookup service tuned for that service. Therefore registering a
+ * {@code PrintServiceLookup} instance instead is recommended. The method
+ * returns {@code true} if this service is not previously registered and is
+ * now successfully registered. This method should not be called with
+ * {@code StreamPrintService} instances. They will always fail to register
+ * and the method will return {@code false}.
+ *
+ * @param service an implementation of a print service
+ * @return {@code true} if the service is newly registered; {@code false}
+ * otherwise
*/
-
public static boolean registerService(PrintService service) {
synchronized (PrintServiceLookup.class) {
if (service == null || service instanceof StreamPrintService) {
@@ -262,68 +277,72 @@
}
}
-
- /**
- * Locates services that can be positively confirmed to support
- * the combination of attributes and DocFlavors specified.
- * This method is not called directly by applications.
- * <p>
- * Implemented by a service provider, used by the static methods
- * of this class.
- * <p>
- * The results should be the same as obtaining all the PrintServices
- * and querying each one individually on its support for the
- * specified attributes and flavors, but the process can be more
- * efficient by taking advantage of the capabilities of lookup services
- * for the print services.
- *
- * @param flavor of document required. If null it is ignored.
- * @param attributes required to be supported. If null this
- * constraint is not used.
- * @return array of matching PrintServices. If no services match, the
- * array is zero-length.
- */
+ /**
+ * Locates services that can be positively confirmed to support the
+ * combination of attributes and {@code DocFlavors} specified. This method
+ * is not called directly by applications.
+ * <p>
+ * Implemented by a service provider, used by the static methods of this
+ * class.
+ * <p>
+ * The results should be the same as obtaining all the {@code PrintServices}
+ * and querying each one individually on its support for the specified
+ * attributes and flavors, but the process can be more efficient by taking
+ * advantage of the capabilities of lookup services for the print services.
+ *
+ * @param flavor of document required. If {@code null} it is ignored.
+ * @param attributes required to be supported. If {@code null} this
+ * constraint is not used.
+ * @return array of matching {@code PrintServices}. If no services match,
+ * the array is zero-length.
+ */
public abstract PrintService[] getPrintServices(DocFlavor flavor,
AttributeSet attributes);
/**
- * Not called directly by applications.
- * Implemented by a service provider, used by the static methods
- * of this class.
- * @return array of all PrintServices known to this lookup service
- * class. If none are found, the array is zero-length.
+ * Not called directly by applications. Implemented by a service provider,
+ * used by the static methods of this class.
+ *
+ * @return array of all {@code PrintServices} known to this lookup service
+ * class. If none are found, the array is zero-length.
*/
public abstract PrintService[] getPrintServices() ;
-
- /**
- * Not called directly by applications.
- * <p>
- * Implemented by a service provider, used by the static methods
- * of this class.
- * <p>
- * Locates MultiDoc print services which can be positively confirmed
- * to support the combination of attributes and DocFlavors specified.
- *
- * @param flavors of documents required. If null or empty it is ignored.
- * @param attributes required to be supported. If null this
- * constraint is not used.
- * @return array of matching PrintServices. If no services match, the
- * array is zero-length.
- */
+ /**
+ * Not called directly by applications.
+ * <p>
+ * Implemented by a service provider, used by the static methods of this
+ * class.
+ * <p>
+ * Locates {@code MultiDoc} print services which can be positively confirmed
+ * to support the combination of attributes and {@code DocFlavors}
+ * specified.
+ *
+ * @param flavors of documents required. If {@code null} or empty it is
+ * ignored.
+ * @param attributes required to be supported. If {@code null} this
+ * constraint is not used.
+ * @return array of matching {@code PrintServices}. If no services match,
+ * the array is zero-length.
+ */
public abstract MultiDocPrintService[]
getMultiDocPrintServices(DocFlavor[] flavors,
AttributeSet attributes);
/**
- * Not called directly by applications.
- * Implemented by a service provider, and called by the print lookup
- * service
- * @return the default PrintService for this lookup service.
- * If there is no default, returns null.
+ * Not called directly by applications. Implemented by a service provider,
+ * and called by the print lookup service.
+ *
+ * @return the default {@code PrintService} for this lookup service. If
+ * there is no default, returns {@code null}.
*/
public abstract PrintService getDefaultPrintService();
+ /**
+ * Returns all lookup services for this environment.
+ *
+ * @return all lookup services for this environment
+ */
private static ArrayList<PrintServiceLookup> getAllLookupServices() {
synchronized (PrintServiceLookup.class) {
ArrayList<PrintServiceLookup> listOfLookupServices = getListOfLookupServices();
@@ -362,6 +381,18 @@
}
}
+ /**
+ * Locates print services capable of printing the specified
+ * {@link DocFlavor}.
+ *
+ * @param flavor the flavor to print. If {@code null}, this constraint is
+ * not used.
+ * @param attributes attributes that the print service must support. If
+ * {@code null} this constraint is not used.
+ * @return list of matching {@code PrintService} objects representing print
+ * services that support the specified flavor attributes. If no
+ * services match, the empty list is returned.
+ */
private static ArrayList<PrintService> getServices(DocFlavor flavor,
AttributeSet attributes) {
@@ -388,7 +419,9 @@
} catch (Exception e) {
}
}
- /* add any directly registered services */
+ /*
+ * add any directly registered services
+ */
ArrayList<PrintService> registeredServices = null;
try {
SecurityManager security = System.getSecurityManager();
@@ -418,6 +451,18 @@
return listOfServices;
}
+ /**
+ * Locates {@code MultiDoc} print {@code Services} capable of printing
+ * {@code MultiDocs} containing all the specified doc flavors.
+ *
+ * @param flavors the flavors to print. If {@code null} or empty this
+ * constraint is not used. Otherwise return only multidoc print
+ * services that can print all specified doc flavors.
+ * @param attributes attributes that the print service must support. If
+ * {@code null} this constraint is not used.
+ * @return list of matching {@link MultiDocPrintService} objects. If no
+ * services match, the empty list is returned.
+ */
private static ArrayList<MultiDocPrintService> getMultiDocServices(DocFlavor[] flavors,
AttributeSet attributes) {
@@ -438,7 +483,9 @@
} catch (Exception e) {
}
}
- /* add any directly registered services */
+ /*
+ * add any directly registered services
+ */
ArrayList<PrintService> registeredServices = null;
try {
SecurityManager security = System.getSecurityManager();
@@ -480,5 +527,4 @@
}
return listOfServices;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,99 +25,93 @@
package javax.print;
+import java.awt.Dialog;
+import java.awt.Frame;
import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
-import java.awt.Dialog;
-import java.awt.Frame;
-import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Window;
-import java.awt.KeyboardFocusManager;
+
import javax.print.attribute.Attribute;
import javax.print.attribute.AttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Destination;
import javax.print.attribute.standard.Fidelity;
+
import sun.print.DialogOwner;
-
import sun.print.ServiceDialog;
import sun.print.SunAlternateMedia;
-/** This class is a collection of UI convenience methods which provide a
+/**
+ * This class is a collection of UI convenience methods which provide a
* graphical user dialog for browsing print services looked up through the Java
* Print Service API.
* <p>
* The dialogs follow a standard pattern of acting as a continue/cancel option
- *for a user as well as allowing the user to select the print service to use
- *and specify choices such as paper size and number of copies.
+ * for a user as well as allowing the user to select the print service to use
+ * and specify choices such as paper size and number of copies.
* <p>
* The dialogs are designed to work with pluggable print services though the
* public APIs of those print services.
* <p>
* If a print service provides any vendor extensions these may be made
- * accessible to the user through a vendor supplied tab panel Component.
+ * accessible to the user through a vendor supplied tab panel {@code Component}.
* Such a vendor extension is encouraged to use Swing! and to support its
- * accessibility APIs.
- * The vendor extensions should return the settings as part of the
- * AttributeSet.
- * Applications which want to preserve the user settings should use those
- * settings to specify the print job.
- * Note that this class is not referenced by any other part of the Java
- * Print Service and may not be included in profiles which cannot depend
- * on the presence of the AWT packages.
+ * accessibility APIs. The vendor extensions should return the settings as part
+ * of the {@code AttributeSet}. Applications which want to preserve the user
+ * settings should use those settings to specify the print job. Note that this
+ * class is not referenced by any other part of the Java Print Service and may
+ * not be included in profiles which cannot depend on the presence of the AWT
+ * packages.
*/
-
public class ServiceUI {
-
/**
- * Presents a dialog to the user for selecting a print service (printer).
- * It is displayed at the location specified by the application and
- * is modal.
+ * Presents a dialog to the user for selecting a print service (printer). It
+ * is displayed at the location specified by the application and is modal.
* If the specification is invalid or would make the dialog not visible it
- * will be displayed at a location determined by the implementation.
- * The dialog blocks its calling thread and is application modal.
+ * will be displayed at a location determined by the implementation. The
+ * dialog blocks its calling thread and is application modal.
* <p>
* The dialog may include a tab panel with custom UI lazily obtained from
- * the PrintService's ServiceUIFactory when the PrintService is browsed.
- * The dialog will attempt to locate a MAIN_UIROLE first as a JComponent,
- * then as a Panel. If there is no ServiceUIFactory or no matching role
- * the custom tab will be empty or not visible.
+ * the {@code PrintService}'s {@code ServiceUIFactory} when the
+ * {@code PrintService} is browsed. The dialog will attempt to locate a
+ * {@code MAIN_UIROLE} first as a {@code JComponent}, then as a
+ * {@code Panel}. If there is no {@code ServiceUIFactory} or no matching
+ * role the custom tab will be empty or not visible.
* <p>
* The dialog returns the print service selected by the user if the user
- * OK's the dialog and null if the user cancels the dialog.
+ * OK's the dialog and {@code null} if the user cancels the dialog.
* <p>
- * An application must pass in an array of print services to browse.
- * The array must be non-null and non-empty.
- * Typically an application will pass in only PrintServices capable
- * of printing a particular document flavor.
+ * An application must pass in an array of print services to browse. The
+ * array must be {@code non-null} and non-empty. Typically an application
+ * will pass in only {@code PrintServices} capable of printing a particular
+ * document flavor.
* <p>
- * An application may pass in a PrintService to be initially displayed.
- * A non-null parameter must be included in the array of browsable
- * services.
- * If this parameter is null a service is chosen by the implementation.
+ * An application may pass in a {@code PrintService} to be initially
+ * displayed. A {@code non-null} parameter must be included in the array of
+ * browsable services. If this parameter is {@code null} a service is chosen
+ * by the implementation.
* <p>
- * An application may optionally pass in the flavor to be printed.
- * If this is non-null choices presented to the user can be better
- * validated against those supported by the services.
- * An application must pass in a PrintRequestAttributeSet for returning
- * user choices.
- * On calling the PrintRequestAttributeSet may be empty, or may contain
+ * An application may optionally pass in the flavor to be printed. If this
+ * is {@code non-null} choices presented to the user can be better validated
+ * against those supported by the services. An application must pass in a
+ * {@code PrintRequestAttributeSet} for returning user choices. On calling
+ * the {@code PrintRequestAttributeSet} may be empty, or may contain
* application-specified values.
* <p>
- * These are used to set the initial settings for the initially
- * displayed print service. Values which are not supported by the print
- * service are ignored. As the user browses print services, attributes
- * and values are copied to the new display. If a user browses a
- * print service which does not support a particular attribute-value, the
- * default for that service is used as the new value to be copied.
+ * These are used to set the initial settings for the initially displayed
+ * print service. Values which are not supported by the print service are
+ * ignored. As the user browses print services, attributes and values are
+ * copied to the new display. If a user browses a print service which does
+ * not support a particular attribute-value, the default for that service is
+ * used as the new value to be copied.
* <p>
* If the user cancels the dialog, the returned attributes will not reflect
* any changes made by the user.
- *
- * A typical basic usage of this method may be :
+ * <p>
+ * A typical basic usage of this method may be:
* <pre>{@code
* PrintService[] services = PrintServiceLookup.lookupPrintServices(
* DocFlavor.INPUT_STREAM.JPEG, null);
@@ -133,24 +127,25 @@
* }
* }</pre>
*
- * @param gc used to select screen. null means primary or default screen.
- * @param x location of dialog including border in screen coordinates
- * relative to the origin of {@code gc}.
- * @param y location of dialog including border in screen coordinates
- * relative to the origin of {@code gc}.
- * @param services to be browsable, must be non-null.
- * @param defaultService initial PrintService to display.
- * @param flavor the flavor to be printed, or null.
- * @param attributes on input is the initial application supplied
- * preferences. This cannot be null but may be empty.
- * On output the attributes reflect changes made by the user.
- * @return print service selected by the user, or null if the user
- * cancelled the dialog.
- * @throws HeadlessException if GraphicsEnvironment.isHeadless()
- * returns true.
- * @throws IllegalArgumentException if services is null or empty,
- * or attributes is null, or the initial PrintService is not in the
- * list of browsable services.
+ * @param gc used to select screen, {@code null} means primary or default
+ * screen
+ * @param x location of dialog including border in screen coordinates
+ * relative to the origin of {@code gc}
+ * @param y location of dialog including border in screen coordinates
+ * relative to the origin of {@code gc}
+ * @param services to be browsable, must be {@code non-null}
+ * @param defaultService initial {@code PrintService} to display
+ * @param flavor the flavor to be printed, or {@code null}
+ * @param attributes on input is the initial application supplied
+ * preferences. This cannot be {@code null} but may be empty. On
+ * output the attributes reflect changes made by the user.
+ * @return print service selected by the user, or {@code null} if the user
+ * cancelled the dialog
+ * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
+ * returns {@code true}
+ * @throws IllegalArgumentException if services is {@code null} or empty, or
+ * attributes is {@code null}, or the initial {@code PrintService}
+ * is not in the list of browsable services
*/
@SuppressWarnings("deprecation")
public static PrintService printDialog(GraphicsConfiguration gc,
@@ -220,8 +215,8 @@
// check if dialog exceed window bounds at left or bottom
// Then position the dialog by moving it by the amount it exceeds
// the window bounds
- // If it results in dialog moving beyond the window bounds at top/left
- // then position it at window top/left
+ // If it results in dialog moving beyond the window bounds at
+ // top/left then position it at window top/left
if (dlgBounds.x + dlgBounds.width > gcBounds.x + gcBounds.width) {
if ((gcBounds.x + gcBounds.width - dlgBounds.width) > gcBounds.x) {
x = (gcBounds.x + gcBounds.width) - dlgBounds.width;
@@ -315,8 +310,8 @@
*/
/**
- * Removes any attributes from the given AttributeSet that are
- * unsupported by the given PrintService/DocFlavor combination.
+ * Removes any attributes from the given {@code AttributeSet} that are
+ * unsupported by the given {@code PrintService/DocFlavor} combination.
*/
private static void removeUnsupportedAttributes(PrintService ps,
DocFlavor flavor,
--- a/jdk/src/java.desktop/share/classes/javax/print/ServiceUIFactory.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/ServiceUIFactory.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,21 +26,20 @@
package javax.print;
/**
- * Services may optionally provide UIs which allow different styles
- * of interaction in different roles.
- * One role may be end-user browsing and setting of print options.
- * Another role may be administering the print service.
+ * Services may optionally provide UIs which allow different styles of
+ * interaction in different roles. One role may be end-user browsing and setting
+ * of print options. Another role may be administering the print service.
* <p>
* Although the Print Service API does not presently provide standardised
- * support for administering a print service, monitoring of the print
- * service is possible and a UI may provide for private update mechanisms.
+ * support for administering a print service, monitoring of the print service is
+ * possible and a UI may provide for private update mechanisms.
* <p>
* The basic design intent is to allow applications to lazily locate and
- * initialize services only when needed without any API dependencies
- * except in an environment in which they are used.
+ * initialize services only when needed without any API dependencies except in
+ * an environment in which they are used.
* <p>
- * Swing UIs are preferred as they provide a more consistent {@literal L&F}
- * and can support accessibility APIs.
+ * Swing UIs are preferred as they provide a more consistent {@literal L&F} and
+ * can support accessibility APIs.
* <p>
* Example usage:
* <pre>
@@ -55,34 +54,29 @@
* }
* </pre>
*/
-
public abstract class ServiceUIFactory {
/**
- * Denotes a UI implemented as a Swing component.
- * The value of the String is the fully qualified classname :
- * "javax.swing.JComponent".
+ * Denotes a UI implemented as a Swing component. The value of the string is
+ * the fully qualified classname : "javax.swing.JComponent".
*/
public static final String JCOMPONENT_UI = "javax.swing.JComponent";
/**
- * Denotes a UI implemented as an AWT panel.
- * The value of the String is the fully qualified classname :
- * "java.awt.Panel"
+ * Denotes a UI implemented as an AWT panel. The value of the string is the
+ * fully qualified classname : "java.awt.Panel"
*/
public static final String PANEL_UI = "java.awt.Panel";
/**
- * Denotes a UI implemented as an AWT dialog.
- * The value of the String is the fully qualified classname :
- * "java.awt.Dialog"
+ * Denotes a UI implemented as an AWT dialog. The value of the string is the
+ * fully qualified classname : "java.awt.Dialog"
*/
public static final String DIALOG_UI = "java.awt.Dialog";
/**
- * Denotes a UI implemented as a Swing dialog.
- * The value of the String is the fully qualified classname :
- * "javax.swing.JDialog"
+ * Denotes a UI implemented as a Swing dialog. The value of the string is
+ * the fully qualified classname : "javax.swing.JDialog"
*/
public static final String JDIALOG_UI = "javax.swing.JDialog";
@@ -102,41 +96,38 @@
public static final int MAIN_UIROLE = 3;
/**
- * Not a valid role but role id's greater than this may be used
- * for private roles supported by a service. Knowledge of the
- * function performed by this role is required to make proper use
- * of it.
+ * Not a valid role but role id's greater than this may be used for private
+ * roles supported by a service. Knowledge of the function performed by this
+ * role is required to make proper use of it.
*/
public static final int RESERVED_UIROLE = 99;
+
/**
- * Get a UI object which may be cast to the requested UI type
- * by the application and used in its user interface.
+ * Get a UI object which may be cast to the requested UI type by the
+ * application and used in its user interface.
*
- * @param role requested. Must be one of the standard roles or
- * a private role supported by this factory.
- * @param ui type in which the role is requested.
- * @return the UI role or null if the requested UI role is not available
- * from this factory
- * @throws IllegalArgumentException if the role or ui is neither
- * one of the standard ones, nor a private one
- * supported by the factory.
+ * @param role requested. Must be one of the standard roles or a private
+ * role supported by this factory.
+ * @param ui type in which the role is requested
+ * @return the UI role or {@code null} if the requested UI role is not
+ * available from this factory
+ * @throws IllegalArgumentException if the role or ui is neither one of the
+ * standard ones, nor a private one supported by the factory
*/
public abstract Object getUI(int role, String ui) ;
/**
- * Given a UI role obtained from this factory obtain the UI
- * types available from this factory which implement this role.
- * The returned Strings should refer to the static variables defined
- * in this class so that applications can use equality of reference
- * ("==").
- * @param role to be looked up.
+ * Given a UI role obtained from this factory obtain the UI types available
+ * from this factory which implement this role. The returned {@code Strings}
+ * should refer to the static variables defined in this class so that
+ * applications can use equality of reference ("==").
+ *
+ * @param role to be looked up
* @return the UI types supported by this class for the specified role,
- * null if no UIs are available for the role.
- * @throws IllegalArgumentException is the role is a non-standard
- * role not supported by this factory.
+ * {@code null} if no UIs are available for the role
+ * @throws IllegalArgumentException is the role is a non-standard role not
+ * supported by this factory
*/
public abstract String[] getUIClassNamesForRole(int role) ;
-
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,60 +27,76 @@
import java.io.ByteArrayInputStream;
import java.io.CharArrayReader;
-import java.io.StringReader;
+import java.io.IOException;
import java.io.InputStream;
-import java.io.IOException;
import java.io.Reader;
+import java.io.StringReader;
+
import javax.print.attribute.AttributeSetUtilities;
import javax.print.attribute.DocAttributeSet;
/**
- * This class is an implementation of interface {@code Doc} that can
- * be used in many common printing requests.
- * It can handle all of the presently defined "pre-defined" doc flavors
- * defined as static variables in the DocFlavor class.
+ * This class is an implementation of interface {@code Doc} that can be used in
+ * many common printing requests. It can handle all of the presently defined
+ * "pre-defined" doc flavors defined as static variables in the
+ * {@code DocFlavor} class.
* <p>
* In particular this class implements certain required semantics of the
- * Doc specification as follows:
+ * {@code Doc} specification as follows:
* <ul>
- * <li>constructs a stream for the service if requested and appropriate.
- * <li>ensures the same object is returned for each call on a method.
- * <li>ensures multiple threads can access the Doc
- * <li>performs some validation of that the data matches the doc flavor.
+ * <li>constructs a stream for the service if requested and appropriate.
+ * <li>ensures the same object is returned for each call on a method.
+ * <li>ensures multiple threads can access the {@code Doc}
+ * <li>performs some validation of that the data matches the doc flavor.
* </ul>
- * Clients who want to re-use the doc object in other jobs,
- * or need a MultiDoc will not want to use this class.
+ * Clients who want to re-use the doc object in other jobs, or need a
+ * {@code MultiDoc} will not want to use this class.
* <p>
- * If the print data is a stream, or a print job requests data as a
- * stream, then {@code SimpleDoc} does not monitor if the service
- * properly closes the stream after data transfer completion or job
- * termination.
- * Clients may prefer to use provide their own implementation of doc that
- * adds a listener to monitor job completion and to validate that
- * resources such as streams are freed (ie closed).
+ * If the print data is a stream, or a print job requests data as a stream, then
+ * {@code SimpleDoc} does not monitor if the service properly closes the stream
+ * after data transfer completion or job termination. Clients may prefer to use
+ * provide their own implementation of doc that adds a listener to monitor job
+ * completion and to validate that resources such as streams are freed (ie
+ * closed).
*/
-
public final class SimpleDoc implements Doc {
+ /**
+ * The doc flavor in which this doc will supply its piece of print data.
+ */
private DocFlavor flavor;
+
+ /**
+ * The set of printing attributes for this doc.
+ */
private DocAttributeSet attributes;
+
+ /**
+ * The print data.
+ */
private Object printData;
+
+ /**
+ * The reader for extracting character print data from this doc.
+ */
private Reader reader;
+
+ /**
+ * The input stream for extracting byte print data from this doc.
+ */
private InputStream inStream;
/**
- * Constructs a {@code SimpleDoc} with the specified
- * print data, doc flavor and doc attribute set.
- * @param printData the print data object
- * @param flavor the {@code DocFlavor} object
- * @param attributes a {@code DocAttributeSet}, which can
- * be {@code null}
- * @throws IllegalArgumentException if {@code flavor} or
- * {@code printData} is {@code null}, or the
- * {@code printData} does not correspond
- * to the specified doc flavor--for example, the data is
- * not of the type specified as the representation in the
- * {@code DocFlavor}.
+ * Constructs a {@code SimpleDoc} with the specified print data, doc flavor
+ * and doc attribute set.
+ *
+ * @param printData the print data object
+ * @param flavor the {@code DocFlavor} object
+ * @param attributes a {@code DocAttributeSet}, which can be {@code null}
+ * @throws IllegalArgumentException if {@code flavor} or {@code printData}
+ * is {@code null}, or the {@code printData} does not correspond to
+ * the specified doc flavor--for example, the data is not of the
+ * type specified as the representation in the {@code DocFlavor}
*/
public SimpleDoc(Object printData,
DocFlavor flavor, DocAttributeSet attributes) {
@@ -110,11 +126,11 @@
this.printData = printData;
}
- /**
- * Determines the doc flavor in which this doc object will supply its
- * piece of print data.
+ /**
+ * Determines the doc flavor in which this doc object will supply its piece
+ * of print data.
*
- * @return Doc flavor.
+ * @return doc flavor
*/
public DocFlavor getDocFlavor() {
return flavor;
@@ -123,67 +139,60 @@
/**
* Obtains the set of printing attributes for this doc object. If the
* returned attribute set includes an instance of a particular attribute
- * <I>X,</I> the printer must use that attribute value for this doc,
- * overriding any value of attribute <I>X</I> in the job's attribute set.
- * If the returned attribute set does not include an instance
- * of a particular attribute <I>X</I> or if null is returned, the printer
- * must consult the job's attribute set to obtain the value for
- * attribute <I>X,</I> and if not found there, the printer must use an
+ * <i>X,</i> the printer must use that attribute value for this doc,
+ * overriding any value of attribute <i>X</i> in the job's attribute set. If
+ * the returned attribute set does not include an instance of a particular
+ * attribute <i>X</i> or if {@code null} is returned, the printer must
+ * consult the job's attribute set to obtain the value for attribute
+ * <i>X,</i> and if not found there, the printer must use an
* implementation-dependent default value. The returned attribute set is
* unmodifiable.
*
- * @return Unmodifiable set of printing attributes for this doc, or null
- * to obtain all attribute values from the job's attribute
- * set.
+ * @return unmodifiable set of printing attributes for this doc, or
+ * {@code null} to obtain all attribute values from the job's
+ * attribute set
*/
public DocAttributeSet getAttributes() {
return attributes;
}
- /*
+ /**
* Obtains the print data representation object that contains this doc
- * object's piece of print data in the format corresponding to the
- * supported doc flavor.
- * The {@code getPrintData()} method returns an instance of
- * the representation class whose name is given by
- * {@link DocFlavor#getRepresentationClassName() getRepresentationClassName},
- * and the return value can be cast
- * from class Object to that representation class.
+ * object's piece of print data in the format corresponding to the supported
+ * doc flavor. The {@code getPrintData()} method returns an instance of the
+ * representation class whose name is given by {@link #getDocFlavor()
+ * getDocFlavor()}.{@link DocFlavor#getRepresentationClassName()
+ * getRepresentationClassName()}, and the return value can be cast from
+ * class {@code Object} to that representation class.
*
- * @return Print data representation object.
- *
- * @exception IOException if the representation class is a stream and
- * there was an I/O error while constructing the stream.
+ * @return print data representation object
+ * @throws IOException if the representation class is a stream and there was
+ * an I/O error while constructing the stream
*/
public Object getPrintData() throws IOException {
return printData;
}
/**
- * Obtains a reader for extracting character print data from this doc.
- * The {@code Doc} implementation is required to support this
- * method if the {@code DocFlavor} has one of the following print
- * data representation classes, and return {@code null}
- * otherwise:
- * <UL>
- * <LI> {@code char[]}
- * <LI> {@code java.lang.String}
- * <LI> {@code java.io.Reader}
- * </UL>
+ * Obtains a reader for extracting character print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes, and return {@code null} otherwise:
+ * <ul>
+ * <li>{@code char[]}
+ * <li>{@code java.lang.String}
+ * <li>{@code java.io.Reader}
+ * </ul>
* The doc's print data representation object is used to construct and
- * return a {@code Reader} for reading the print data as a stream
- * of characters from the print data representation object.
- * However, if the print data representation object is itself a
- * {@code Reader} then the print data representation object is
- * simply returned.
+ * return a {@code Reader} for reading the print data as a stream of
+ * characters from the print data representation object. However, if the
+ * print data representation object is itself a {@code Reader} then the
+ * print data representation object is simply returned.
*
- * @return a {@code Reader} for reading the print data
- * characters from this doc.
- * If a reader cannot be provided because this doc does not meet
- * the criteria stated above, {@code null} is returned.
- *
- * @exception IOException if there was an I/O error while creating
- * the reader.
+ * @return a {@code Reader} for reading the print data characters from this
+ * doc. If a reader cannot be provided because this doc does not
+ * meet the criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the reader
*/
public Reader getReaderForText() throws IOException {
@@ -207,31 +216,25 @@
}
/**
- * Obtains an input stream for extracting byte print data from
- * this doc.
- * The {@code Doc} implementation is required to support this
- * method if the {@code DocFlavor} has one of the following print
- * data representation classes; otherwise this method
- * returns {@code null}:
- * <UL>
- * <LI> {@code byte[]}
- * <LI> {@code java.io.InputStream}
- * </UL>
- * The doc's print data representation object is obtained. Then, an
- * input stream for reading the print data
- * from the print data representation object as a stream of bytes is
- * created and returned.
- * However, if the print data representation object is itself an
- * input stream then the print data representation object is simply
- * returned.
+ * Obtains an input stream for extracting byte print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes; otherwise this method returns {@code null}:
+ * <ul>
+ * <li>{@code byte[]}
+ * <li>{@code java.io.InputStream}
+ * </ul>
+ * The doc's print data representation object is obtained. Then, an input
+ * stream for reading the print data from the print data representation
+ * object as a stream of bytes is created and returned. However, if the
+ * print data representation object is itself an input stream then the print
+ * data representation object is simply returned.
*
- * @return an {@code InputStream} for reading the print data
- * bytes from this doc. If an input stream cannot be
- * provided because this doc does not meet
- * the criteria stated above, {@code null} is returned.
- *
- * @exception IOException
- * if there was an I/O error while creating the input stream.
+ * @return an {@code InputStream} for reading the print data bytes from this
+ * doc. If an input stream cannot be provided because this doc does
+ * not meet the criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the input
+ * stream
*/
public InputStream getStreamForBytes() throws IOException {
@@ -250,5 +253,4 @@
}
return inStream;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,43 +28,47 @@
import java.io.OutputStream;
/**
- * This class extends {@link PrintService} and represents a
- * print service that prints data in different formats to a
- * client-provided output stream.
- * This is principally intended for services where
- * the output format is a document type suitable for viewing
- * or archiving.
- * The output format must be declared as a mime type.
- * This is equivalent to an output document flavor where the
- * representation class is always "java.io.OutputStream"
- * An instance of the {@code StreamPrintService} class is
- * obtained from a {@link StreamPrintServiceFactory} instance.
+ * This class extends {@link PrintService} and represents a print service that
+ * prints data in different formats to a client-provided output stream. This is
+ * principally intended for services where the output format is a document type
+ * suitable for viewing or archiving. The output format must be declared as a
+ * mime type. This is equivalent to an output document flavor where the
+ * representation class is always "java.io.OutputStream" An instance of the
+ * {@code StreamPrintService} class is obtained from a
+ * {@link StreamPrintServiceFactory} instance.
* <p>
* Note that a {@code StreamPrintService} is different from a
* {@code PrintService}, which supports a
- * {@link javax.print.attribute.standard.Destination Destination}
- * attribute. A {@code StreamPrintService} always requires an output
- * stream, whereas a {@code PrintService} optionally accepts a
- * {@code Destination}. A {@code StreamPrintService}
- * has no default destination for its formatted output.
- * Additionally a {@code StreamPrintService} is expected to generate
-output in
- * a format useful in other contexts.
- * StreamPrintService's are not expected to support the Destination attribute.
+ * {@link javax.print.attribute.standard.Destination Destination} attribute. A
+ * {@code StreamPrintService} always requires an output stream, whereas a
+ * {@code PrintService} optionally accepts a {@code Destination}. A
+ * {@code StreamPrintService} has no default destination for its formatted
+ * output. Additionally a {@code StreamPrintService} is expected to generate
+ * output in a format useful in other contexts. {@code StreamPrintService}'s are
+ * not expected to support the {@code Destination} attribute.
*/
-
public abstract class StreamPrintService implements PrintService {
+ /**
+ * The output stream to which this service will send formatted print data.
+ */
private OutputStream outStream;
+
+ /**
+ * Whether or not this {@code StreamPrintService} has been disposed.
+ */
private boolean disposed = false;
+ /**
+ * Constructs a {@code StreamPrintService} object.
+ */
private StreamPrintService() {
};
/**
- * Constructs a StreamPrintService object.
+ * Constructs a {@code StreamPrintService} object.
*
- * @param out stream to which to send formatted print data.
+ * @param out stream to which to send formatted print data
*/
protected StreamPrintService(OutputStream out) {
this.outStream = out;
@@ -73,42 +77,44 @@
/**
* Gets the output stream.
*
- * @return the stream to which this service will send formatted print data.
+ * @return the stream to which this service will send formatted print data
*/
public OutputStream getOutputStream() {
return outStream;
}
/**
- * Returns the document format emitted by this print service.
- * Must be in mimetype format, compatible with the mime type
- * components of DocFlavors @see DocFlavor.
- * @return mime type identifying the output format.
+ * Returns the document format emitted by this print service. Must be in
+ * mimetype format, compatible with the mime type components of
+ * {@code DocFlavors}
+ *
+ * @return mime type identifying the output format
+ * @see DocFlavor
*/
public abstract String getOutputFormat();
/**
- * Disposes this {@code StreamPrintService}.
- * If a stream service cannot be re-used, it must be disposed
- * to indicate this. Typically the client will call this method.
- * Services which write data which cannot meaningfully be appended to
- * may also dispose the stream. This does not close the stream. It
- * just marks it as not for further use by this service.
+ * Disposes this {@code StreamPrintService}. If a stream service cannot be
+ * re-used, it must be disposed to indicate this. Typically the client will
+ * call this method. Services which write data which cannot meaningfully be
+ * appended to may also dispose the stream. This does not close the stream.
+ * It just marks it as not for further use by this service.
*/
public void dispose() {
disposed = true;
}
/**
- * Returns a {@code boolean} indicating whether or not
- * this {@code StreamPrintService} has been disposed.
- * If this object has been disposed, will return true.
- * Used by services and client applications to recognize streams
- * to which no further data should be written.
- * @return if this {@code StreamPrintService} has been disposed
+ * Returns a {@code boolean} indicating whether or not this
+ * {@code StreamPrintService} has been disposed. If this object has been
+ * disposed, will return {@code true}. Used by services and client
+ * applications to recognize streams to which no further data should be
+ * written.
+ *
+ * @return {@code true} if this {@code StreamPrintService} has been
+ * disposed; {@code false} otherwise
*/
public boolean isDisposed() {
return disposed;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java Thu Aug 31 15:47:34 2017 -0700
@@ -26,40 +26,48 @@
package javax.print;
import java.io.OutputStream;
-
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
-import javax.print.DocFlavor;
+import javax.print.attribute.PrintRequestAttributeSet;
import sun.awt.AppContext;
-import java.util.ServiceLoader;
-import java.util.ServiceConfigurationError;
/**
* A {@code StreamPrintServiceFactory} is the factory for
- * {@link StreamPrintService} instances,
- * which can print to an output stream in a particular
- * document format described as a mime type.
- * A typical output document format may be Postscript(TM).
+ * {@link StreamPrintService} instances, which can print to an output stream in
+ * a particular document format described as a mime type. A typical output
+ * document format may be Postscript(TM).
* <p>
- * This class is implemented by a service and located by the
- * implementation using the {@link java.util.ServiceLoader} facility.
+ * This class is implemented by a service and located by the implementation
+ * using the {@link ServiceLoader} facility.
* <p>
* Applications locate instances of this class by calling the
* {@link #lookupStreamPrintServiceFactories(DocFlavor, String)} method.
* <p>
- * Applications can use a {@code StreamPrintService} obtained from a
- * factory in place of a {@code PrintService} which represents a
- * physical printer device.
+ * Applications can use a {@code StreamPrintService} obtained from a factory in
+ * place of a {@code PrintService} which represents a physical printer device.
*/
-
public abstract class StreamPrintServiceFactory {
+ /**
+ * Contains a list of factories.
+ */
static class Services {
+
+ /**
+ * The list of factories which will be stored per appcontext.
+ */
private ArrayList<StreamPrintServiceFactory> listOfFactories = null;
}
+ /**
+ * Returns the services from the current appcontext.
+ *
+ * @return the services
+ */
private static Services getServices() {
Services services =
(Services)AppContext.getAppContext().get(Services.class);
@@ -70,10 +78,20 @@
return services;
}
+ /**
+ * Returns the list of factories.
+ *
+ * @return the list of factories
+ */
private static ArrayList<StreamPrintServiceFactory> getListOfFactories() {
return getServices().listOfFactories;
}
+ /**
+ * Initialize the list of factories.
+ *
+ * @return the list of factories
+ */
private static ArrayList<StreamPrintServiceFactory> initListOfFactories() {
ArrayList<StreamPrintServiceFactory> listOfFactories = new ArrayList<>();
getServices().listOfFactories = listOfFactories;
@@ -81,26 +99,26 @@
}
/**
- * Locates factories for print services that can be used with
- * a print job to output a stream of data in the
- * format specified by {@code outputMimeType}.
+ * Locates factories for print services that can be used with a print job to
+ * output a stream of data in the format specified by
+ * {@code outputMimeType}.
* <p>
- * The {@code outputMimeType} parameter describes the document type that
- * you want to create, whereas the {@code flavor} parameter describes the
- * format in which the input data will be provided by the application
- * to the {@code StreamPrintService}.
+ * The {@code outputMimeType} parameter describes the document type that you
+ * want to create, whereas the {@code flavor} parameter describes the format
+ * in which the input data will be provided by the application to the
+ * {@code StreamPrintService}.
* <p>
- * Although null is an acceptable value to use in the lookup of stream
- * printing services, it's typical to search for a particular
- * desired format, such as Postscript(TM).
+ * Although {@code null} is an acceptable value to use in the lookup of
+ * stream printing services, it's typical to search for a particular desired
+ * format, such as Postscript(TM).
*
- * @param flavor of the input document type - null means match all
- * types.
- * @param outputMimeType representing the required output format, used to
- * identify suitable stream printer factories. A value of null means
- * match all formats.
- * @return matching factories for stream print service instance,
- * empty if no suitable factories could be located.
+ * @param flavor of the input document type - {@code null} means match all
+ * types
+ * @param outputMimeType representing the required output format, used to
+ * identify suitable stream printer factories. A value of
+ * {@code null} means match all formats.
+ * @return matching factories for stream print service instance, empty if no
+ * suitable factories could be located
*/
public static StreamPrintServiceFactory[]
lookupStreamPrintServiceFactories(DocFlavor flavor,
@@ -110,55 +128,56 @@
return list.toArray(new StreamPrintServiceFactory[list.size()]);
}
- /** Queries the factory for the document format that is emitted
- * by printers obtained from this factory.
+ /**
+ * Queries the factory for the document format that is emitted by printers
+ * obtained from this factory.
*
- * @return the output format described as a mime type.
+ * @return the output format described as a mime type
*/
public abstract String getOutputFormat();
/**
- * Queries the factory for the document flavors that can be accepted
- * by printers obtained from this factory.
- * @return array of supported doc flavors.
+ * Queries the factory for the document flavors that can be accepted by
+ * printers obtained from this factory.
+ *
+ * @return array of supported doc flavors
*/
public abstract DocFlavor[] getSupportedDocFlavors();
/**
- * Returns a {@code StreamPrintService} that can print to
- * the specified output stream.
- * The output stream is created and managed by the application.
- * It is the application's responsibility to close the stream and
- * to ensure that this Printer is not reused.
- * The application should not close this stream until any print job
- * created from the printer is complete. Doing so earlier may generate
- * a {@code PrinterException} and an event indicating that the
- * job failed.
+ * Returns a {@code StreamPrintService} that can print to the specified
+ * output stream. The output stream is created and managed by the
+ * application. It is the application's responsibility to close the stream
+ * and to ensure that this {@code Printer} is not reused. The application
+ * should not close this stream until any print job created from the printer
+ * is complete. Doing so earlier may generate a {@code PrinterException} and
+ * an event indicating that the job failed.
* <p>
- * Whereas a {@code PrintService} connected to a physical printer
- * can be reused,
- * a {@code StreamPrintService} connected to a stream cannot.
- * The underlying {@code StreamPrintService} may be disposed by
- * the print system with
- * the {@link StreamPrintService#dispose() dispose} method
- * before returning from the
- * {@link DocPrintJob#print(Doc, javax.print.attribute.PrintRequestAttributeSet) print}
- * method of {@code DocPrintJob} so that the print system knows
- * this printer is no longer usable.
- * This is equivalent to a physical printer going offline - permanently.
- * Applications may supply a null print stream to create a queryable
- * service. It is not valid to create a PrintJob for such a stream.
- * Implementations which allocate resources on construction should examine
- * the stream and may wish to only allocate resources if the stream is
- * non-null.
+ * Whereas a {@code PrintService} connected to a physical printer can be
+ * reused, a {@code StreamPrintService} connected to a stream cannot. The
+ * underlying {@code StreamPrintService} may be disposed by the print system
+ * with the {@link StreamPrintService#dispose() dispose} method before
+ * returning from the
+ * {@link DocPrintJob#print(Doc, PrintRequestAttributeSet) print} method of
+ * {@code DocPrintJob} so that the print system knows this printer is no
+ * longer usable. This is equivalent to a physical printer going offline -
+ * permanently. Applications may supply a {@code null} print stream to
+ * create a queryable service. It is not valid to create a {@code PrintJob}
+ * for such a stream. Implementations which allocate resources on
+ * construction should examine the stream and may wish to only allocate
+ * resources if the stream is {@code non-null}.
*
- * @param out destination stream for generated output.
- * @return a PrintService which will generate the format specified by the
- * DocFlavor supported by this Factory.
+ * @param out destination stream for generated output
+ * @return a {@code PrintService} which will generate the format specified
+ * by the {@code DocFlavor} supported by this factory
*/
public abstract StreamPrintService getPrintService(OutputStream out);
-
+ /**
+ * Returns all factories for print services.
+ *
+ * @return all factories
+ */
private static ArrayList<StreamPrintServiceFactory> getAllFactories() {
synchronized (StreamPrintServiceFactory.class) {
@@ -198,6 +217,15 @@
}
}
+ /**
+ * Checks if the array of {@code flavors} contains the {@code flavor}
+ * object.
+ *
+ * @param flavor the flavor
+ * @param flavors the array of flavors
+ * @return {@code true} if {@code flavors} contains the {@code flavor}
+ * object; {@code false} otherwise
+ */
private static boolean isMember(DocFlavor flavor, DocFlavor[] flavors) {
for (int f=0; f<flavors.length; f++ ) {
if (flavor.equals(flavors[f])) {
@@ -207,6 +235,21 @@
return false;
}
+ /**
+ * Utility method for {@link #lookupStreamPrintServiceFactories}.
+ * <p>
+ * Locates factories for print services that can be used with a print job to
+ * output a stream of data in the format specified by
+ * {@code outputMimeType}.
+ *
+ * @param flavor of the input document type - {@code null} means match all
+ * types
+ * @param outType representing the required output format, used to identify
+ * suitable stream printer factories. A value of {@code null} means
+ * match all formats.
+ * @return matching factories for stream print service instance, empty if no
+ * suitable factories could be located
+ */
private static ArrayList<StreamPrintServiceFactory> getFactories(DocFlavor flavor, String outType) {
if (flavor == null && outType == null) {
@@ -227,5 +270,4 @@
return list;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/URIException.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/URIException.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,46 +28,45 @@
import java.net.URI;
/**
- * Interface URIException is a mixin interface which a subclass of {@link
- * PrintException PrintException} can implement to report an error condition
- * involving a URI address. The Print Service API does not define any print
- * exception classes that implement interface URIException, that being left to
- * the Print Service implementor's discretion.
- *
+ * Interface {@code URIException} is a mixin interface which a subclass of
+ * {@link PrintException PrintException} can implement to report an error
+ * condition involving a {@code URI} address. The Print Service API does not
+ * define any print exception classes that implement interface
+ * {@code URIException}, that being left to the Print Service implementor's
+ * discretion.
*/
-
public interface URIException {
/**
- * Indicates that the printer cannot access the URI address.
- * For example, the printer might report this error if it goes to get
- * the print data and cannot even establish a connection to the
- * URI address.
+ * Indicates that the printer cannot access the {@code URI} address. For
+ * example, the printer might report this error if it goes to get the print
+ * data and cannot even establish a connection to the {@code URI} address.
*/
public static final int URIInaccessible = 1;
/**
- * Indicates that the printer does not support the URI
- * scheme ("http", "ftp", etc.) in the URI address.
+ * Indicates that the printer does not support the {@code URI} scheme
+ * ("http", "ftp", etc.) in the {@code URI} address.
*/
public static final int URISchemeNotSupported = 2;
/**
- * Indicates any kind of problem not specifically identified
- * by the other reasons.
+ * Indicates any kind of problem not specifically identified by the other
+ * reasons.
*/
public static final int URIOtherProblem = -1;
/**
- * Return the URI.
- * @return the URI that is the cause of this exception.
+ * Returns the {@code URI}.
+ *
+ * @return the {@code URI} that is the cause of this exception
*/
public URI getUnsupportedURI();
/**
- * Return the reason for the event.
- * @return one of the predefined reasons enumerated in this interface.
+ * Returns the reason of this exception.
+ *
+ * @return one of the predefined reasons enumerated in this interface
*/
public int getReason();
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,35 +28,34 @@
import java.io.Serializable;
/**
- * Interface Attribute is the base interface implemented by any and every
- * printing attribute class to indicate that the class represents a
+ * Interface {@code Attribute} is the base interface implemented by any and
+ * every printing attribute class to indicate that the class represents a
* printing attribute. All printing attributes are serializable.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public interface Attribute extends Serializable {
- /**
- * Get the printing attribute class which is to be used as the "category"
- * for this printing attribute value when it is added to an attribute set.
- *
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
- */
- public Class<? extends Attribute> getCategory();
+ /**
+ * Get the printing attribute class which is to be used as the "category"
+ * for this printing attribute value when it is added to an attribute set.
+ *
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
+ */
+ public Class<? extends Attribute> getCategory();
- /**
- * Get the name of the category of which this attribute value is an
- * instance.
- * <P>
- * <I>Note:</I> This method is intended to provide a default, nonlocalized
- * string for the attribute's category. If two attribute objects return the
- * same category from the {@code getCategory()} method, they should
- * return the same name from the {@code getName()} method.
- *
- * @return Attribute category name.
- */
- public String getName();
-
+ /**
+ * Get the name of the category of which this attribute value is an
+ * instance.
+ * <p>
+ * <i>Note:</i> This method is intended to provide a default, nonlocalized
+ * string for the attribute's category. If two attribute objects return the
+ * same category from the {@code getCategory()} method, they should return
+ * the same name from the {@code getName()} method.
+ *
+ * @return attribute category name
+ */
+ public String getName();
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,284 +26,240 @@
package javax.print.attribute;
/**
- * Interface AttributeSet specifies the interface for a set of printing
+ * Interface {@code AttributeSet} specifies the interface for a set of printing
* attributes. A printing attribute is an object whose class implements
* interface {@link Attribute Attribute}.
- * <P>
- * An attribute set contains a group of <I>attribute values,</I>
- * where duplicate values are not allowed in the set.
- * Furthermore, each value in an attribute set is
- * a member of some <I>category,</I> and at most one value in any particular
- * category is allowed in the set. For an attribute set, the values are {@link
- * Attribute Attribute} objects, and the categories are {@link java.lang.Class
- * Class} objects. An attribute's category is the class (or interface) at the
- * root of the class hierarchy for that kind of attribute. Note that an
- * attribute object's category may be a superclass of the attribute object's
- * class rather than the attribute object's class itself. An attribute
- * object's
- * category is determined by calling the {@link Attribute#getCategory()
- * getCategory()} method defined in interface {@link Attribute
- * Attribute}.
- * <P>
- * The interfaces of an AttributeSet resemble those of the Java Collections
- * API's java.util.Map interface, but is more restrictive in the types
- * it will accept, and combines keys and values into an Attribute.
- * <P>
- * Attribute sets are used in several places in the Print Service API. In
- * each context, only certain kinds of attributes are allowed to appear in the
+ * <p>
+ * An attribute set contains a group of <i>attribute values,</i> where duplicate
+ * values are not allowed in the set. Furthermore, each value in an attribute
+ * set is a member of some <i>category,</i> and at most one value in any
+ * particular category is allowed in the set. For an attribute set, the values
+ * are {@link Attribute Attribute} objects, and the categories are
+ * {@link Class Class} objects. An attribute's category is the class (or
+ * interface) at the root of the class hierarchy for that kind of attribute.
+ * Note that an attribute object's category may be a superclass of the attribute
+ * object's class rather than the attribute object's class itself. An attribute
+ * object's category is determined by calling the
+ * {@link Attribute#getCategory() getCategory()} method defined in interface
+ * {@link Attribute Attribute}.
+ * <p>
+ * The interfaces of an {@code AttributeSet} resemble those of the Java
+ * Collections API's {@code java.util.Map} interface, but is more restrictive in
+ * the types it will accept, and combines keys and values into an
+ * {@code Attribute}.
+ * <p>
+ * Attribute sets are used in several places in the Print Service API. In each
+ * context, only certain kinds of attributes are allowed to appear in the
* attribute set, as determined by the tagging interfaces which the attribute
- * class implements -- {@link DocAttribute DocAttribute}, {@link
- * PrintRequestAttribute PrintRequestAttribute}, {@link PrintJobAttribute
- * PrintJobAttribute}, and {@link PrintServiceAttribute
- * PrintServiceAttribute}.
+ * class implements -- {@link DocAttribute DocAttribute},
+ * {@link PrintRequestAttribute PrintRequestAttribute},
+ * {@link PrintJobAttribute PrintJobAttribute}, and
+ * {@link PrintServiceAttribute PrintServiceAttribute}.
* There are four specializations of an attribute set that are restricted to
- * contain just one of the four kinds of attribute -- {@link DocAttributeSet
- * DocAttributeSet}, {@link PrintRequestAttributeSet
- * PrintRequestAttributeSet},
- * {@link PrintJobAttributeSet PrintJobAttributeSet}, and {@link
- * PrintServiceAttributeSet PrintServiceAttributeSet}, respectively. Note that
- * many attribute classes implement more than one tagging interface and so may
- * appear in more than one context.
- * <UL>
- * <LI>
- * A {@link DocAttributeSet DocAttributeSet}, containing {@link DocAttribute
- * DocAttribute}s, specifies the characteristics of an individual doc and the
- * print job settings to be applied to an individual doc.
- *
- * <LI>
- * A {@link PrintRequestAttributeSet PrintRequestAttributeSet}, containing
- * {@link PrintRequestAttribute PrintRequestAttribute}s, specifies the
- * settings
- * to be applied to a whole print job and to all the docs in the print job.
- *
- * <LI>
- * A {@link PrintJobAttributeSet PrintJobAttributeSet}, containing {@link
- * PrintJobAttribute PrintJobAttribute}s, reports the status of a print job.
- *
- * <LI>
- * A {@link PrintServiceAttributeSet PrintServiceAttributeSet}, containing
- * {@link PrintServiceAttribute PrintServiceAttribute}s, reports the status of
- * a Print Service instance.
- * </UL>
- * <P>
+ * contain just one of the four kinds of attribute --
+ * {@link DocAttributeSet DocAttributeSet},
+ * {@link PrintRequestAttributeSet PrintRequestAttributeSet},
+ * {@link PrintJobAttributeSet PrintJobAttributeSet}, and
+ * {@link PrintServiceAttributeSet PrintServiceAttributeSet}, respectively. Note
+ * that many attribute classes implement more than one tagging interface and so
+ * may appear in more than one context.
+ * <ul>
+ * <li>A {@link DocAttributeSet DocAttributeSet}, containing
+ * {@link DocAttribute DocAttribute}s, specifies the characteristics of an
+ * individual doc and the print job settings to be applied to an individual
+ * doc.
+ * <li>A {@link PrintRequestAttributeSet PrintRequestAttributeSet}, containing
+ * {@link PrintRequestAttribute PrintRequestAttribute}s, specifies the
+ * settings to be applied to a whole print job and to all the docs in the
+ * print job.
+ * <li>A {@link PrintJobAttributeSet PrintJobAttributeSet}, containing
+ * {@link PrintJobAttribute PrintJobAttribute}s, reports the status of a print
+ * job.
+ * <li>A {@link PrintServiceAttributeSet PrintServiceAttributeSet}, containing
+ * {@link PrintServiceAttribute PrintServiceAttribute}s, reports the status of
+ * a Print Service instance.
+ * </ul>
* In some contexts, the client is only allowed to examine an attribute set's
* contents but not change them (the set is read-only). In other places, the
* client is allowed both to examine and to change an attribute set's contents
* (the set is read-write). For a read-only attribute set, calling a mutating
- * operation throws an UnmodifiableSetException.
- * <P>
+ * operation throws an {@code UnmodifiableSetException}.
+ * <p>
* The Print Service API provides one implementation of interface
- * AttributeSet, class {@link HashAttributeSet HashAttributeSet}.
- * A client can use class {@link
- * HashAttributeSet HashAttributeSet} or provide its own implementation of
- * interface AttributeSet. The Print Service API also provides
- * implementations of interface AttributeSet's subinterfaces -- classes {@link
- * HashDocAttributeSet HashDocAttributeSet},
- * {@link HashPrintRequestAttributeSet
- * HashPrintRequestAttributeSet}, {@link HashPrintJobAttributeSet
- * HashPrintJobAttributeSet}, and {@link HashPrintServiceAttributeSet
- * HashPrintServiceAttributeSet}.
+ * {@code AttributeSet}, class {@link HashAttributeSet HashAttributeSet}. A
+ * client can use class {@link HashAttributeSet HashAttributeSet} or provide its
+ * own implementation of interface {@code AttributeSet}. The Print Service API
+ * also provides implementations of interface {@code AttributeSet}'s
+ * subinterfaces -- classes
+ * {@link HashDocAttributeSet HashDocAttributeSet},
+ * {@link HashPrintRequestAttributeSet HashPrintRequestAttributeSet},
+ * {@link HashPrintJobAttributeSet HashPrintJobAttributeSet}, and
+ * {@link HashPrintServiceAttributeSet HashPrintServiceAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface AttributeSet {
-
/**
* Returns the attribute value which this attribute set contains in the
- * given attribute category. Returns {@code null} if this attribute set
- * does not contain any attribute value in the given attribute category.
- *
- * @param category Attribute category whose associated attribute value
- * is to be returned. It must be a
- * {@link java.lang.Class Class}
- * that implements interface {@link Attribute
- * Attribute}.
+ * given attribute category. Returns {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category.
*
- * @return The attribute value in the given attribute category contained
- * in this attribute set, or {@code null} if this attribute set
- * does not contain any attribute value in the given attribute
- * category.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code category} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code category} is not a
- * {@link java.lang.Class Class} that implements interface {@link
- * Attribute Attribute}.
+ * @param category attribute category whose associated attribute value is
+ * to be returned. It must be a {@link Class Class} that implements
+ * interface {@link Attribute Attribute}.
+ * @return the attribute value in the given attribute category contained in
+ * this attribute set, or {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category
+ * @throws NullPointerException if the {@code category} is {@code null}
+ * @throws ClassCastException if the {@code category} is not a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}
*/
public Attribute get(Class<?> category);
/**
- * Adds the specified attribute to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value.
- *
- * @param attribute Attribute value to be added to this attribute set.
+ * Adds the specified attribute to this attribute set if it is not already
+ * present, first removing any existing value in the same attribute category
+ * as the specified attribute value.
*
- * @return {@code true} if this attribute set changed as a result of the
- * call, i.e., the given attribute value was not already a member
- * of this attribute set.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code add()} operation.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws NullPointerException if the {@code attribute} is {@code null}
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
*/
public boolean add(Attribute attribute);
-
/**
* Removes any attribute for this category from this attribute set if
- * present. If {@code category} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param category Attribute category to be removed from this
- * attribute set.
+ * present. If {@code category} is {@code null}, then {@code remove()} does
+ * nothing and returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
+ * @param category attribute category to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
* call, i.e., the given attribute value had been a member of this
- * attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code remove()} operation.
+ * attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Class<?> category);
/**
- * Removes the specified attribute from this attribute set if
- * present. If {@code attribute} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param attribute Attribute value to be removed from this attribute set.
+ * Removes the specified attribute from this attribute set if present. If
+ * {@code attribute} is {@code null}, then {@code remove()} does nothing and
+ * returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
+ * @param attribute attribute value to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
* call, i.e., the given attribute value had been a member of this
- * attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code remove()} operation.
+ * attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Attribute attribute);
/**
- * Returns {@code true} if this attribute set contains an
- * attribute for the specified category.
+ * Returns {@code true} if this attribute set contains an attribute for the
+ * specified category.
*
- * @param category whose presence in this attribute set is
- * to be tested.
- *
- * @return {@code true} if this attribute set contains an attribute
- * value for the specified category.
+ * @param category whose presence in this attribute set is to be tested
+ * @return {@code true} if this attribute set contains an attribute value
+ * for the specified category
*/
public boolean containsKey(Class<?> category);
/**
- * Returns {@code true} if this attribute set contains the given
- * attribute value.
+ * Returns {@code true} if this attribute set contains the given attribute
+ * value.
*
- * @param attribute Attribute value whose presence in this
- * attribute set is to be tested.
- *
- * @return {@code true} if this attribute set contains the given
- * attribute value.
+ * @param attribute attribute value whose presence in this attribute set is
+ * to be tested
+ * @return {@code true} if this attribute set contains the given attribute
+ * value
*/
public boolean containsValue(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the =
- * {@link #add(Attribute) add(Attribute)}
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the = {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with each
- * element from the specified set.
- * The behavior of the {@code addAll(AttributeSet)}
- * operation is unspecified if the specified set is modified while
- * the operation is in progress.
- * <P>
- * If the {@code addAll(AttributeSet)} operation throws an exception,
- * the effect on this attribute set's state is implementation dependent;
- * elements from the specified set before the point of the exception may
- * or may not have been added to this attribute set.
+ * element from the specified set. The behavior of the
+ * {@code addAll(AttributeSet)} operation is unspecified if the specified
+ * set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll(AttributeSet)} operation throws an exception, the
+ * effect on this attribute set's state is implementation dependent;
+ * elements from the specified set before the point of the exception may or
+ * may not have been added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of the
- * call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not support
- * the {@code addAll(AttributeSet)} method.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if some element in the specified
- * set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll(AttributeSet)} method
+ * @throws NullPointerException if some element in the specified set is
+ * {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
/**
- * Returns the number of attributes in this attribute set. If this
- * attribute set contains more than {@code Integer.MAX_VALUE} elements,
- * returns {@code Integer.MAX_VALUE}.
+ * Returns the number of attributes in this attribute set. If this attribute
+ * set contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
- * @return The number of attributes in this attribute set.
+ * @return the number of attributes in this attribute set
*/
public int size();
/**
* Returns an array of the attributes contained in this set.
- * @return the Attributes contained in this set as an array, zero length
- * if the AttributeSet is empty.
+ *
+ * @return the {@code Attributes} contained in this set as an array, zero
+ * length if the {@code AttributeSet} is empty
*/
public Attribute[] toArray();
-
/**
* Removes all attributes from this attribute set.
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code clear()} operation.
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code clear()} operation
*/
public void clear();
/**
- * Returns true if this attribute set contains no attributes.
+ * Returns {@code true} if this attribute set contains no attributes.
*
- * @return true if this attribute set contains no attributes.
+ * @return {@code true} if this attribute set contains no attributes
*/
public boolean isEmpty();
/**
* Compares the specified object with this attribute set for equality.
- * Returns {@code true} if the given object is also an attribute set and
- * the two attribute sets contain the same attribute category-attribute
- * value mappings. This ensures that the
- * {@code equals()} method works properly across different
- * implementations of the AttributeSet interface.
+ * Returns {@code true} if the given object is also an attribute set and the
+ * two attribute sets contain the same attribute category-attribute value
+ * mappings. This ensures that the {@code equals()} method works properly
+ * across different implementations of the {@code AttributeSet} interface.
*
- * @param object to be compared for equality with this attribute set.
- *
- * @return {@code true} if the specified object is equal to this
- * attribute set.
+ * @param object to be compared for equality with this attribute set
+ * @return {@code true} if the specified object is equal to this attribute
+ * set
*/
public boolean equals(Object object);
/**
* Returns the hash code value for this attribute set. The hash code of an
- * attribute set is defined to be the sum of the hash codes of each entry
- * in the AttributeSet.
- * This ensures that {@code t1.equals(t2)} implies that
- * {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
+ * attribute set is defined to be the sum of the hash codes of each entry in
+ * the {@code AttributeSet}. This ensures that {@code t1.equals(t2)} implies
+ * that {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
* {@code t1} and {@code t2}, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link Object#hashCode() Object.hashCode()}.
*
- * @return The hash code value for this attribute set.
+ * @return the hash code value for this attribute set
*/
public int hashCode();
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,65 +23,75 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class AttributeSetUtilities provides static methods for manipulating
- * AttributeSets.
+ * Class {@code AttributeSetUtilities} provides static methods for manipulating
+ * {@code AttributeSets}.
* <ul>
- * <li>Methods for creating unmodifiable and synchronized views of attribute
- * sets.
- * <li>operations useful for building
- * implementations of interface {@link AttributeSet AttributeSet}
+ * <li>Methods for creating unmodifiable and synchronized views of attribute
+ * sets.
+ * <li>operations useful for building implementations of interface
+ * {@link AttributeSet AttributeSet}
* </ul>
- * <P>
- * An <B>unmodifiable view</B> <I>U</I> of an AttributeSet <I>S</I> provides a
- * client with "read-only" access to <I>S</I>. Query operations on <I>U</I>
- * "read through" to <I>S</I>; thus, changes in <I>S</I> are reflected in
- * <I>U</I>. However, any attempt to modify <I>U</I>,
- * results in an UnmodifiableSetException.
- * The unmodifiable view object <I>U</I> will be serializable if the
- * attribute set object <I>S</I> is serializable.
- * <P>
- * A <B>synchronized view</B> <I>V</I> of an attribute set <I>S</I> provides a
- * client with synchronized (multiple thread safe) access to <I>S</I>. Each
- * operation of <I>V</I> is synchronized using <I>V</I> itself as the lock
- * object and then merely invokes the corresponding operation of <I>S</I>. In
- * order to guarantee mutually exclusive access, it is critical that all
- * access to <I>S</I> is accomplished through <I>V</I>. The synchronized view
- * object <I>V</I> will be serializable if the attribute set object <I>S</I>
- * is serializable.
- * <P>
- * As mentioned in the package description of javax.print, a null reference
- * parameter to methods is
- * incorrect unless explicitly documented on the method as having a meaningful
- * interpretation. Usage to the contrary is incorrect coding and may result in
- * a run time exception either immediately
- * or at some later time. IllegalArgumentException and NullPointerException
- * are examples of typical and acceptable run time exceptions for such cases.
+ * An <b>unmodifiable view</b> <i>U</i> of an {@code AttributeSet} <i>S</i>
+ * provides a client with "read-only" access to <i>S</i>. Query operations on
+ * <i>U</i> "read through" to <i>S</i>; thus, changes in <i>S</i> are reflected
+ * in <i>U</i>. However, any attempt to modify <i>U</i>, results in an
+ * {@code UnmodifiableSetException}. The unmodifiable view object <i>U</i> will
+ * be serializable if the attribute set object <i>S</i> is serializable.
+ * <p>
+ * A <b>synchronized view</b> <i>V</i> of an attribute set <i>S</i> provides a
+ * client with synchronized (multiple thread safe) access to <i>S</i>. Each
+ * operation of <i>V</i> is synchronized using <i>V</i> itself as the lock
+ * object and then merely invokes the corresponding operation of <i>S</i>. In
+ * order to guarantee mutually exclusive access, it is critical that all access
+ * to <i>S</i> is accomplished through <i>V</i>. The synchronized view object
+ * <i>V</i> will be serializable if the attribute set object <i>S</i> is
+ * serializable.
+ * <p>
+ * As mentioned in the package description of {@code javax.print}, a
+ * {@code null} reference parameter to methods is incorrect unless explicitly
+ * documented on the method as having a meaningful interpretation. Usage to the
+ * contrary is incorrect coding and may result in a run time exception either
+ * immediately or at some later time. {@code IllegalArgumentException} and
+ * {@code NullPointerException} are examples of typical and acceptable run time
+ * exceptions for such cases.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class AttributeSetUtilities {
- /* Suppress default constructor, ensuring non-instantiability.
+ /**
+ * Suppress default constructor, ensuring non-instantiability.
*/
private AttributeSetUtilities() {
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code AttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiableAttributeSet
implements AttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6131802583863447813L;
+ /**
+ * The attribute set.
+ */
private AttributeSet attrset;
- /* Unmodifiable view of the underlying attribute set.
+ /**
+ * Constructs unmodifiable view of the underlying attribute set.
+ *
+ * @param attributeSet the attribute set
*/
public UnmodifiableAttributeSet(AttributeSet attributeSet) {
@@ -139,17 +149,27 @@
public int hashCode() {
return attrset.hashCode();
}
-
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code DocAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiableDocAttributeSet
extends UnmodifiableAttributeSet
implements DocAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6349408326066898956L;
+ /**
+ * Constructs a new unmodifiable doc attribute set.
+ *
+ * @param attributeSet the doc attribute set
+ */
public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet) {
super (attributeSet);
@@ -157,13 +177,25 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintRequestAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintRequestAttributeSet
extends UnmodifiableAttributeSet
implements PrintRequestAttributeSet, Serializable
{
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7799373532614825073L;
+
+ /**
+ * Constructs a new unmodifiable print request attribute set.
+ *
+ * @param attributeSet the print request attribute set
+ */
public UnmodifiablePrintRequestAttributeSet
(PrintRequestAttributeSet attributeSet) {
@@ -172,13 +204,24 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintJobAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintJobAttributeSet
extends UnmodifiableAttributeSet
implements PrintJobAttributeSet, Serializable
{
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8002245296274522112L;
+
+ /**
+ * Constructs a new unmodifiable print job attribute set.
+ *
+ * @param attributeSet the print job attribute set
+ */
public UnmodifiablePrintJobAttributeSet
(PrintJobAttributeSet attributeSet) {
@@ -187,13 +230,24 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintServiceAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintServiceAttributeSet
extends UnmodifiableAttributeSet
implements PrintServiceAttributeSet, Serializable
{
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7112165137107826819L;
+
+ /**
+ * Constructs a new unmodifiable print service attribute set.
+ *
+ * @param attributeSet the print service attribute set
+ */
public UnmodifiablePrintServiceAttributeSet
(PrintServiceAttributeSet attributeSet) {
@@ -204,12 +258,9 @@
/**
* Creates an unmodifiable view of the given attribute set.
*
- * @param attributeSet Underlying attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null. Null is never a
+ * @param attributeSet underlying attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static AttributeSet unmodifiableView(AttributeSet attributeSet) {
if (attributeSet == null) {
@@ -222,12 +273,9 @@
/**
* Creates an unmodifiable view of the given doc attribute set.
*
- * @param attributeSet Underlying doc attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying doc attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static DocAttributeSet unmodifiableView
(DocAttributeSet attributeSet) {
@@ -240,12 +288,9 @@
/**
* Creates an unmodifiable view of the given print request attribute set.
*
- * @param attributeSet Underlying print request attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print request attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintRequestAttributeSet
unmodifiableView(PrintRequestAttributeSet attributeSet) {
@@ -258,12 +303,9 @@
/**
* Creates an unmodifiable view of the given print job attribute set.
*
- * @param attributeSet Underlying print job attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print job attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintJobAttributeSet
unmodifiableView(PrintJobAttributeSet attributeSet) {
@@ -276,12 +318,9 @@
/**
* Creates an unmodifiable view of the given print service attribute set.
*
- * @param attributeSet Underlying print service attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print service attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintServiceAttributeSet
unmodifiableView(PrintServiceAttributeSet attributeSet) {
@@ -292,14 +331,28 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code AttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedAttributeSet
implements AttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8365731020128564925L;
+ /**
+ * The attribute set.
+ */
private AttributeSet attrset;
+ /**
+ * Constructs a new synchronized attribute set.
+ *
+ * @param attributeSet the attribute set
+ */
public SynchronizedAttributeSet(AttributeSet attributeSet) {
attrset = attributeSet;
}
@@ -358,26 +411,48 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code DocAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedDocAttributeSet
extends SynchronizedAttributeSet
implements DocAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6455869095246629354L;
+ /**
+ * Constructs a new synchronized doc attribute set.
+ *
+ * @param attributeSet the doc attribute set
+ */
public SynchronizedDocAttributeSet(DocAttributeSet attributeSet) {
super(attributeSet);
}
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintRequestAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintRequestAttributeSet
extends SynchronizedAttributeSet
implements PrintRequestAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5671237023971169027L;
+ /**
+ * Constructs a new synchronized print request attribute set.
+ *
+ * @param attributeSet the print request attribute set
+ */
public SynchronizedPrintRequestAttributeSet
(PrintRequestAttributeSet attributeSet) {
super(attributeSet);
@@ -385,13 +460,24 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintJobAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintJobAttributeSet
extends SynchronizedAttributeSet
implements PrintJobAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2117188707856965749L;
+ /**
+ * Constructs a new synchronized print job attribute set.
+ *
+ * @param attributeSet the print job attribute set
+ */
public SynchronizedPrintJobAttributeSet
(PrintJobAttributeSet attributeSet) {
super(attributeSet);
@@ -399,13 +485,24 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintServiceAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintServiceAttributeSet
extends SynchronizedAttributeSet
implements PrintServiceAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2830705374001675073L;
+ /**
+ * Constructs a new synchronized print service attribute set.
+ *
+ * @param attributeSet the print service attribute set
+ */
public SynchronizedPrintServiceAttributeSet
(PrintServiceAttributeSet attributeSet) {
super(attributeSet);
@@ -415,12 +512,9 @@
/**
* Creates a synchronized view of the given attribute set.
*
- * @param attributeSet Underlying attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static AttributeSet synchronizedView
(AttributeSet attributeSet) {
@@ -433,12 +527,9 @@
/**
* Creates a synchronized view of the given doc attribute set.
*
- * @param attributeSet Underlying doc attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying doc attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static DocAttributeSet
synchronizedView(DocAttributeSet attributeSet) {
@@ -451,12 +542,9 @@
/**
* Creates a synchronized view of the given print request attribute set.
*
- * @param attributeSet Underlying print request attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print request attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintRequestAttributeSet
synchronizedView(PrintRequestAttributeSet attributeSet) {
@@ -469,12 +557,9 @@
/**
* Creates a synchronized view of the given print job attribute set.
*
- * @param attributeSet Underlying print job attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print job attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintJobAttributeSet
synchronizedView(PrintJobAttributeSet attributeSet) {
@@ -487,9 +572,9 @@
/**
* Creates a synchronized view of the given print service attribute set.
*
- * @param attributeSet Underlying print service attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
+ * @param attributeSet underlying print service attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintServiceAttributeSet
synchronizedView(PrintServiceAttributeSet attributeSet) {
@@ -499,26 +584,19 @@
return new SynchronizedPrintServiceAttributeSet(attributeSet);
}
-
/**
- * Verify that the given object is a {@link java.lang.Class Class} that
- * implements the given interface, which is assumed to be interface {@link
- * Attribute Attribute} or a subinterface thereof.
- *
- * @param object Object to test.
- * @param interfaceName Interface the object must implement.
+ * Verify that the given object is a {@link Class Class} that implements the
+ * given interface, which is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
*
- * @return If {@code object} is a {@link java.lang.Class Class}
- * that implements {@code interfaceName},
- * {@code object} is returned downcast to type {@link
- * java.lang.Class Class}; otherwise an exception is thrown.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code object} is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if {@code object} is not a
- * {@link java.lang.Class Class} that implements
- * {@code interfaceName}.
+ * @param object {@code Object} to test
+ * @param interfaceName interface the object must implement
+ * @return if {@code object} is a {@link Class Class} that implements
+ * {@code interfaceName}, {@code object} is returned downcast to
+ * type {@link Class Class}; otherwise an exception is thrown
+ * @throws NullPointerException if {@code object} is {@code null}
+ * @throws ClassCastException if {@code object} is not a
+ * {@link Class Class} that implements {@code interfaceName}
*/
public static Class<?>
verifyAttributeCategory(Object object, Class<?> interfaceName) {
@@ -537,19 +615,14 @@
* is assumed to be interface {@link Attribute Attribute} or a subinterface
* thereof.
*
- * @param object Object to test.
- * @param interfaceName Interface of which the object must be an instance.
- *
- * @return If {@code object} is an instance of
- * {@code interfaceName}, {@code object} is returned
- * downcast to type {@link Attribute Attribute}; otherwise an
- * exception is thrown.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code object} is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if {@code object} is not an
- * instance of {@code interfaceName}.
+ * @param object {@code Object} to test
+ * @param interfaceName interface of which the object must be an instance
+ * @return if {@code object} is an instance of {@code interfaceName},
+ * {@code object} is returned downcast to type
+ * {@link Attribute Attribute}; otherwise an exception is thrown
+ * @throws NullPointerException if {@code object} is {@code null}
+ * @throws ClassCastException if {@code object} is not an instance of
+ * {@code interfaceName}
*/
public static Attribute
verifyAttributeValue(Object object, Class<?> interfaceName) {
@@ -565,19 +638,16 @@
}
/**
- * Verify that the given attribute category object is equal to the
- * category of the given attribute value object. If so, this method
- * returns doing nothing. If not, this method throws an exception.
- *
- * @param category Attribute category to test.
- * @param attribute Attribute value to test.
+ * Verify that the given attribute category object is equal to the category
+ * of the given attribute value object. If so, this method returns doing
+ * nothing. If not, this method throws an exception.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if the {@code category} is
- * null or if the {@code attribute} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if the {@code category} is not
- * equal to the category of the {@code attribute}.
+ * @param category attribute category to test
+ * @param attribute attribute value to test
+ * @throws NullPointerException if the {@code category} or {@code attribute}
+ * are {@code null}
+ * @throws IllegalArgumentException if the {@code category} is not equal to
+ * the category of the {@code attribute}
*/
public static void
verifyCategoryForValue(Class<?> category, Attribute attribute) {
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,47 +23,48 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
-
import java.util.Date;
/**
- * Class DateTimeSyntax is an abstract base class providing the common
+ * Class {@code DateTimeSyntax} is an abstract base class providing the common
* implementation of all attributes whose value is a date and time.
- * <P>
+ * <p>
* Under the hood, a date-time attribute is stored as a value of class
- * {@code java.util.Date}. You can get a date-time attribute's Date value by
- * calling {@link #getValue() getValue()}. A date-time attribute's
- * Date value is established when it is constructed (see {@link
- * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
- * constructed, a date-time attribute's value is immutable.
- * <P>
+ * {@code java.util.Date}. You can get a date-time attribute's {@code Date}
+ * value by calling {@link #getValue() getValue()}. A date-time attribute's
+ * {@code Date} value is established when it is constructed (see
+ * {@link #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once constructed, a
+ * date-time attribute's value is immutable.
+ * <p>
* To construct a date-time attribute from separate values of the year, month,
- * day, hour, minute, and so on, use a {@code java.util.Calendar}
- * object to construct a {@code java.util.Date} object, then use the
- * {@code 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 {@code java.util.Calendar} object and
- * set it to the {@code java.util.Date} from the date-time attribute. Class
- * DateTimeSyntax stores its value in the form of a {@code java.util.Date}
- * rather than a {@code java.util.Calendar} because it typically takes
- * less memory to store and less time to compare a {@code java.util.Date}
- * than a {@code java.util.Calendar}.
+ * day, hour, minute, and so on, use a {@code java.util.Calendar} object to
+ * construct a {@code java.util.Date} object, then use the
+ * {@code 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 {@code java.util.Calendar} object and set
+ * it to the {@code java.util.Date} from the date-time attribute. Class
+ * {@code DateTimeSyntax} stores its value in the form of a
+ * {@code java.util.Date} rather than a {@code java.util.Calendar} because it
+ * typically takes less memory to store and less time to compare a
+ * {@code java.util.Date} than a {@code java.util.Calendar}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class DateTimeSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1400819079791208582L;
// Hidden data members.
/**
* This date-time attribute's {@code java.util.Date} value.
+ *
* @serial
*/
private Date value;
@@ -71,13 +72,11 @@
// Hidden constructors.
/**
- * Construct a new date-time attribute with the given
- * {@code java.util.Date} value.
+ * Construct a new date-time attribute with the given {@code java.util.Date}
+ * value.
*
- * @param value {@code java.util.Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code theValue} is null.
+ * @param value {@code java.util.Date} value
+ * @throws NullPointerException if {@code value} is {@code null}
*/
protected DateTimeSyntax(Date value) {
if (value == null) {
@@ -89,9 +88,9 @@
// Exported operations.
/**
- * Returns this date-time attribute's {@code java.util.Date}
- * value.
- * @return the Date.
+ * Returns this date-time attribute's {@code java.util.Date} value.
+ *
+ * @return the {@code Date}
*/
public Date getValue() {
return new Date (value.getTime());
@@ -102,20 +101,16 @@
/**
* Returns whether this date-time attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class DateTimeSyntax.
- * <LI>
- * This date-time attribute's {@code java.util.Date} value and
- * {@code object}'s {@code java.util.Date} value are
- * equal. </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code DateTimeSyntax}.
+ * <li>This date-time attribute's {@code java.util.Date} value and
+ * {@code object}'s {@code java.util.Date} value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this date-time
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this date-time
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (object != null &&
@@ -132,13 +127,11 @@
}
/**
- * Returns a string value corresponding to this date-time attribute.
- * The string value is just this attribute's
- * {@code java.util.Date} value
+ * Returns a string value corresponding to this date-time attribute. The
+ * string value is just this attribute's {@code java.util.Date} value
* converted to a string.
*/
public String toString() {
return "" + value;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,25 +23,22 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface DocAttribute is a tagging interface which a printing attribute
- * class implements to indicate the attribute denotes a setting for a doc.
- * ("Doc" is a short, easy-to-pronounce term that means "a piece of print
- * data.") The client may include a DocAttribute in a {@code Doc}'s
- * attribute set to specify a characteristic of
- * that doc. If an attribute implements {@link PrintRequestAttribute
- * PrintRequestAttribute} as well as DocAttribute, the client may include the
- * attribute in a attribute set which specifies a print job
- * to specify a characteristic for all the docs in that job.
+ * Interface {@code DocAttribute} is a tagging interface which a printing
+ * attribute class implements to indicate the attribute denotes a setting for a
+ * doc. ("Doc" is a short, easy-to-pronounce term that means "a piece of print
+ * data.") The client may include a {@code DocAttribute} in a {@code Doc}'s
+ * attribute set to specify a characteristic of that doc. If an attribute
+ * implements {@link PrintRequestAttribute PrintRequestAttribute} as well as
+ * {@code DocAttribute}, the client may include the attribute in a attribute set
+ * which specifies a print job to specify a characteristic for all the docs in
+ * that job.
*
+ * @author Alan Kaminsky
* @see DocAttributeSet
* @see PrintRequestAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface DocAttribute extends Attribute {
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,88 +23,70 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface DocAttributeSet specifies the interface for a set of doc
- * attributes, i.e. printing attributes that implement interface {@link
- * DocAttribute DocAttribute}. In the Print Service API, the client uses a
- * DocAttributeSet to specify the characteristics of an individual doc and
- * the print job settings to be applied to an individual doc.
- * <P>
- * A DocAttributeSet is just an {@link AttributeSet AttributeSet} whose
+ * Interface {@code DocAttributeSet} specifies the interface for a set of doc
+ * attributes, i.e. printing attributes that implement interface
+ * {@link DocAttribute DocAttribute}. In the Print Service API, the client uses
+ * a {@code DocAttributeSet} to specify the characteristics of an individual doc
+ * and the print job settings to be applied to an individual doc.
+ * <p>
+ * A {@code DocAttributeSet} is just an {@link AttributeSet AttributeSet} whose
* constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the DocAttributeSet must be instances
- * of interface {@link DocAttribute DocAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * namely that all attribute values in the {@code DocAttributeSet} must be
+ * instances of interface {@link DocAttribute DocAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface DocAttributeSet extends AttributeSet {
-
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link DocAttribute DocAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link DocAttribute DocAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the <i>union</i> of the two sets.
- * <P>
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- * <P>
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the <i>union</i> of the two sets.
+ * <p>
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link DocAttribute
- * DocAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface {@link DocAttribute DocAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
- public boolean addAll(AttributeSet attributes);
+ public boolean addAll(AttributeSet attributes);
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.InvalidObjectException;
@@ -31,11 +30,13 @@
import java.io.Serializable;
/**
- * Class EnumSyntax is an abstract base class providing the common
+ * Class {@code EnumSyntax} is an abstract base class providing the common
* implementation of all "type safe enumeration" objects. An enumeration class
- * (which extends class EnumSyntax) provides a group of enumeration values
- * (objects) that are singleton instances of the enumeration class; for example:
- * <PRE>
+ * (which extends class {@code EnumSyntax}) provides a group of enumeration
+ * values (objects) that are singleton instances of the enumeration class; for
+ * example:
+ *
+ * <pre>
* public class Bach extends EnumSyntax {
* public static final Bach JOHANN_SEBASTIAN = new Bach(0);
* public static final Bach WILHELM_FRIEDEMANN = new Bach(1);
@@ -67,51 +68,54 @@
* return enumValueTable;
* }
* }
- * </PRE>
- * You can then write code that uses the {@code ==} and {@code !=}
- * operators to test enumeration values; for example:
- * <PRE>
+ * </pre>
+ * You can then write code that uses the {@code ==} and {@code !=} operators to
+ * test enumeration values; for example:
+ * <pre>
* Bach theComposer;
* . . .
* if (theComposer == Bach.JOHANN_SEBASTIAN) {
* System.out.println ("The greatest composer of all time!");
* }
- * </PRE>
- * The {@code equals()} method for an enumeration class just does a test
- * for identical objects ({@code ==}).
- * <P>
- * You can convert an enumeration value to a string by calling {@link
- * #toString() toString()}. The string is obtained from a table
- * supplied by the enumeration class.
- * <P>
+ * </pre>
+ * The {@code equals()} method for an enumeration class just does a test for
+ * identical objects ({@code ==}).
+ * <p>
+ * You can convert an enumeration value to a string by calling
+ * {@link #toString() toString()}. The string is obtained from a table supplied
+ * by the enumeration class.
+ * <p>
* Under the hood, an enumeration value is just an integer, a different integer
* for each enumeration value within an enumeration class. You can get an
- * enumeration value's integer value by calling {@link #getValue()
- * getValue()}. An enumeration value's integer value is established
- * when it is constructed (see {@link #EnumSyntax(int)
- * EnumSyntax(int)}). Since the constructor is protected, the only
- * possible enumeration values are the singleton objects declared in the
- * enumeration class; additional enumeration values cannot be created at run
- * time.
- * <P>
+ * enumeration value's integer value by calling {@link #getValue() getValue()}.
+ * An enumeration value's integer value is established when it is constructed
+ * (see {@link #EnumSyntax(int) EnumSyntax(int)}). Since the constructor is
+ * protected, the only possible enumeration values are the singleton objects
+ * declared in the enumeration class; additional enumeration values cannot be
+ * created at run time.
+ * <p>
* You can define a subclass of an enumeration class that extends it with
* additional enumeration values. The subclass's enumeration values' integer
* values need not be distinct from the superclass's enumeration values' integer
- * values; the {@code ==}, {@code !=}, {@code equals()}, and
- * {@code toString()} methods will still work properly even if the subclass
- * uses some of the same integer values as the superclass. However, the
- * application in which the enumeration class and subclass are used may need to
- * have distinct integer values in the superclass and subclass.
+ * values; the {@code ==}, {@code !=}, {@code equals()}, and {@code toString()}
+ * methods will still work properly even if the subclass uses some of the same
+ * integer values as the superclass. However, the application in which the
+ * enumeration class and subclass are used may need to have distinct integer
+ * values in the superclass and subclass.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class EnumSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2739521845085831642L;
/**
* This enumeration value's integer value.
+ *
* @serial
*/
private int value;
@@ -119,7 +123,7 @@
/**
* Construct a new enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected EnumSyntax(int value) {
this.value = value;
@@ -127,6 +131,7 @@
/**
* Returns this enumeration value's integer value.
+ *
* @return the value
*/
public int getValue() {
@@ -167,22 +172,20 @@
* During object input, convert this deserialized enumeration instance to
* the proper enumeration value defined in the enumeration attribute class.
*
- * @return The enumeration singleton value stored at index
- * <I>i</I>-<I>L</I> in the enumeration value table returned by
- * {@link #getEnumValueTable() getEnumValueTable()},
- * where <I>i</I> is this enumeration value's integer value and
- * <I>L</I> is the value returned by {@link #getOffset()
- * getOffset()}.
- *
+ * @return The enumeration singleton value stored at index <i>i</i>-<i>L</i>
+ * in the enumeration value table returned by
+ * {@link #getEnumValueTable() getEnumValueTable()}, where <i>i</i>
+ * is this enumeration value's integer value and <i>L</i> is the
+ * value returned by {@link #getOffset() getOffset()}
* @throws ObjectStreamException if the stream can't be deserialised
- * @throws InvalidObjectException
- * Thrown if the enumeration value table is null, this enumeration
- * value's integer value does not correspond to an element in the
- * enumeration value table, or the corresponding element in the
- * enumeration value table is null. (Note: {@link
- * java.io.InvalidObjectException InvalidObjectException} is a subclass
- * of {@link java.io.ObjectStreamException ObjectStreamException}, which
- * {@code readResolve()} is declared to throw.)
+ * @throws InvalidObjectException if the enumeration value table is
+ * {@code null}, this enumeration value's integer value does not
+ * correspond to an element in the enumeration value table, or the
+ * corresponding element in the enumeration value table is
+ * {@code null}. (Note:
+ * {@link InvalidObjectException InvalidObjectException} is a
+ * subclass of {@link ObjectStreamException ObjectStreamException},
+ * which {@code readResolve()} is declared to throw.)
*/
protected Object readResolve() throws ObjectStreamException {
@@ -218,20 +221,21 @@
/**
* Returns the string table for this enumeration value's enumeration class.
* The enumeration class's integer values are assumed to lie in the range
- * <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the value returned by
- * {@link #getOffset() getOffset()} and <I>N</I> is the length
- * of the string table. The element in the string table at index
- * <I>i</I>-<I>L</I> is the value returned by {@link #toString()
- * toString()} for the enumeration value whose integer value
- * is <I>i</I>. If an integer within the above range is not used by any
- * enumeration value, leave the corresponding table element null.
- * <P>
- * The default implementation returns null. If the enumeration class (a
- * subclass of class EnumSyntax) does not override this method to return a
- * non-null string table, and the subclass does not override the {@link
- * #toString() toString()} method, the base class {@link
- * #toString() toString()} method will return just a string
+ * <i>L</i>..<i>L</i>+<i>N</i>-1, where <i>L</i> is the value returned by
+ * {@link #getOffset() getOffset()} and <i>N</i> is the length of the string
+ * table. The element in the string table at index <i>i</i>-<i>L</i> is the
+ * value returned by {@link #toString() toString()} for the enumeration
+ * value whose integer value is <i>i</i>. If an integer within the above
+ * range is not used by any enumeration value, leave the corresponding table
+ * element {@code null}.
+ * <p>
+ * The default implementation returns {@code null}. If the enumeration class
+ * (a subclass of class {@code EnumSyntax}) does not override this method to
+ * return a {@code non-null} string table, and the subclass does not
+ * override the {@link #toString() toString()} method, the base class
+ * {@link #toString() toString()} method will return just a string
* representation of this enumeration value's integer value.
+ *
* @return the string table
*/
protected String[] getStringTable() {
@@ -241,23 +245,24 @@
/**
* Returns the enumeration value table for this enumeration value's
* enumeration class. The enumeration class's integer values are assumed to
- * lie in the range <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the
- * value returned by {@link #getOffset() getOffset()} and
- * <I>N</I> is the length of the enumeration value table. The element in the
- * enumeration value table at index <I>i</I>-<I>L</I> is the enumeration
- * value object whose integer value is <I>i</I>; the {@link #readResolve()
- * readResolve()} method needs this to preserve singleton
- * semantics during deserialization of an enumeration instance. If an
- * integer within the above range is not used by any enumeration value,
- * leave the corresponding table element null.
- * <P>
- * The default implementation returns null. If the enumeration class (a
- * subclass of class EnumSyntax) does not override this method to return
- * a non-null enumeration value table, and the subclass does not override
- * the {@link #readResolve() readResolve()} method, the base
- * class {@link #readResolve() readResolve()} method will throw
- * an exception whenever an enumeration instance is deserialized from an
- * object input stream.
+ * lie in the range <i>L</i>..<i>L</i>+<i>N</i>-1, where <i>L</i> is the
+ * value returned by {@link #getOffset() getOffset()} and <i>N</i> is the
+ * length of the enumeration value table. The element in the enumeration
+ * value table at index <i>i</i>-<i>L</i> is the enumeration value object
+ * whose integer value is <i>i</i>; the {@link #readResolve() readResolve()}
+ * method needs this to preserve singleton semantics during deserialization
+ * of an enumeration instance. If an integer within the above range is not
+ * used by any enumeration value, leave the corresponding table element
+ * {@code null}.
+ * <p>
+ * The default implementation returns {@code null}. If the enumeration class
+ * (a subclass of class EnumSyntax) does not override this method to return
+ * a {@code non-null} enumeration value table, and the subclass does not
+ * override the {@link #readResolve() readResolve()} method, the base class
+ * {@link #readResolve() readResolve()} method will throw an exception
+ * whenever an enumeration instance is deserialized from an object input
+ * stream.
+ *
* @return the value table
*/
protected EnumSyntax[] getEnumValueTable() {
@@ -267,14 +272,14 @@
/**
* Returns the lowest integer value used by this enumeration value's
* enumeration class.
- * <P>
+ * <p>
* The default implementation returns 0. If the enumeration class (a
- * subclass of class EnumSyntax) uses integer values starting at other than
- * 0, override this method in the subclass.
- * @return the offset of the lowest enumeration value.
+ * subclass of class {@code EnumSyntax}) uses integer values starting at
+ * other than 0, override this method in the subclass.
+ *
+ * @return the offset of the lowest enumeration value
*/
protected int getOffset() {
return 0;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,37 +32,42 @@
import java.util.HashMap;
/**
- * Class HashAttributeSet provides an {@code AttributeSet}
+ * Class {@code HashAttributeSet} provides an {@code AttributeSet}
* implementation with characteristics of a hash map.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashAttributeSet implements AttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5311560590283707917L;
/**
* The interface of which all members of this attribute set must be an
- * instance. It is assumed to be interface {@link Attribute Attribute}
- * or a subinterface thereof.
+ * instance. It is assumed to be interface {@link Attribute Attribute} or a
+ * subinterface thereof.
+ *
* @serial
*/
private Class<?> myInterface;
- /*
- * A HashMap used by the implementation.
- * The serialised form doesn't include this instance variable.
+ /**
+ * A {@code HashMap} used by the implementation. The serialised form doesn't
+ * include this instance variable.
*/
private transient HashMap<Class<?>, Attribute> attrMap = new HashMap<>();
/**
- * Write the instance to a stream (ie serialize the object)
+ * Write the instance to a stream (ie serialize the object).
*
- * @serialData
- * The serialized form of an attribute set explicitly writes the
- * number of attributes in the set, and each of the attributes.
- * This does not guarantee equality of serialized forms since
- * the order in which the attributes are written is not defined.
+ * @param s the output stream
+ * @throws IOException if an I/O exception has occurred
+ * @serialData The serialized form of an attribute set explicitly writes the
+ * number of attributes in the set, and each of the attributes.
+ * This does not guarantee equality of serialized forms since
+ * the order in which the attributes are written is not defined.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
@@ -76,6 +81,10 @@
/**
* Reconstitute an instance from a stream that is, deserialize it).
+ *
+ * @param s the input stream
+ * @throws ClassNotFoundException if the class is not found
+ * @throws IOException if an I/O exception has occurred
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException {
@@ -98,59 +107,51 @@
}
/**
- * Construct a new attribute set,
- * initially populated with the given attribute.
+ * Construct a new attribute set, initially populated with the given
+ * attribute.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashAttributeSet(Attribute attribute) {
this (attribute, Attribute.class);
}
/**
- * Construct a new attribute set,
- * initially populated with the values from the
- * given array. The new attribute set is populated by
- * adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new attribute set, initially populated with the values from
+ * the given array. The new attribute set is populated by adding the
+ * elements of {@code attributes} array to the set in sequence, starting at
+ * index 0. Thus, later array elements may replace earlier array elements if
+ * the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashAttributeSet(Attribute[] attributes) {
this (attributes, Attribute.class);
}
/**
- * Construct a new attribute set,
- * initially populated with the values from the given set.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set.
*
- * @param attributes Set of attributes from which to initialise this set.
- * If null, an empty attribute set is constructed.
- *
+ * @param attributes set of attributes from which to initialise this set.
+ * If {@code null}, an empty attribute set is constructed.
*/
public HashAttributeSet(AttributeSet attributes) {
this (attributes, Attribute.class);
}
/**
- * Construct a new, empty attribute set, where the members of
- * the attribute set are restricted to the given interface.
+ * Construct a new, empty attribute set, where the members of the attribute
+ * set are restricted to the given interface.
*
- * @param interfaceName The interface of which all members of this
- * attribute set must be an instance. It is assumed to
- * be interface {@link Attribute Attribute} or a
- * subinterface thereof.
- * @exception NullPointerException if interfaceName is null.
+ * @param interfaceName the interface of which all members of this
+ * attribute set must be an instance. It is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
+ * @throws NullPointerException if {@code interfaceName} is {@code null}
*/
protected HashAttributeSet(Class<?> interfaceName) {
if (interfaceName == null) {
@@ -164,18 +165,14 @@
* attribute, where the members of the attribute set are restricted to the
* given interface.
*
- * @param attribute Attribute value to add to the set.
- * @param interfaceName The interface of which all members of this
- * attribute set must be an instance. It is assumed to
- * be interface {@link Attribute Attribute} or a
- * subinterface thereof.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
- * @exception NullPointerException if interfaceName is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if {@code attribute} is not an
- * instance of {@code interfaceName}.
+ * @param attribute attribute value to add to the set
+ * @param interfaceName the interface of which all members of this
+ * attribute set must be an instance. It is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
+ * @throws NullPointerException if {@code attribute} or
+ * {@code interfaceName} are {@code null}
+ * @throws ClassCastException if {@code attribute} is not an instance of
+ * {@code interfaceName}
*/
protected HashAttributeSet(Attribute attribute, Class<?> interfaceName) {
if (interfaceName == null) {
@@ -186,29 +183,22 @@
}
/**
- * Construct a new attribute set, where the members of the attribute
- * set are restricted to the given interface.
- * The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new attribute set, where the members of the attribute set are
+ * restricted to the given interface. The new attribute set is populated by
+ * adding the elements of {@code attributes} array to the set in sequence,
+ * starting at index 0. Thus, later array elements may replace earlier array
+ * elements if the array contains duplicate attribute values or attribute
+ * categories.
*
- * @param attributes Array of attribute values to add to the set. If
- * null, an empty attribute set is constructed.
- * @param interfaceName The interface of which all members of this
- * attribute set must be an instance. It is assumed to
- * be interface {@link Attribute Attribute} or a
- * subinterface thereof.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is null.
- * @exception NullPointerException if interfaceName is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code interfaceName}.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @param interfaceName the interface of which all members of this
+ * attribute set must be an instance. It is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
+ * @throws NullPointerException if {@code interfaceName} is {@code null}, or
+ * if any element of {@code attributes} is {@code null}
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code interfaceName}
*/
protected HashAttributeSet(Attribute[] attributes, Class<?> interfaceName) {
if (interfaceName == null) {
@@ -222,21 +212,17 @@
}
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute
- * set are restricted to the given interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the given interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- * @param interfaceName The interface of which all members of this
- * attribute set must be an instance. It is assumed to
- * be interface {@link Attribute Attribute} or a
- * subinterface thereof.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code interfaceName}.
+ * {@code null}, an empty attribute set is constructed.
+ * @param interfaceName The interface of which all members of this
+ * attribute set must be an instance. It is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code interfaceName}
*/
protected HashAttributeSet(AttributeSet attributes, Class<?> interfaceName) {
myInterface = interfaceName;
@@ -251,26 +237,19 @@
/**
* Returns the attribute value which this attribute set contains in the
- * given attribute category. Returns {@code null} if this attribute set
- * does not contain any attribute value in the given attribute category.
- *
- * @param category Attribute category whose associated attribute value
- * is to be returned. It must be a
- * {@link java.lang.Class Class}
- * that implements interface {@link Attribute
- * Attribute}.
+ * given attribute category. Returns {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category.
*
- * @return The attribute value in the given attribute category contained
- * in this attribute set, or {@code null} if this attribute set
- * does not contain any attribute value in the given attribute
- * category.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code category} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code category} is not a
- * {@link java.lang.Class Class} that implements interface {@link
- * Attribute Attribute}.
+ * @param category attribute category whose associated attribute value is
+ * to be returned. It must be a {@link Class Class} that implements
+ * interface {@link Attribute Attribute}.
+ * @return the attribute value in the given attribute category contained in
+ * this attribute set, or {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category
+ * @throws NullPointerException if the {@code category} is {@code null}
+ * @throws ClassCastException if the {@code category} is not a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}
*/
public Attribute get(Class<?> category) {
return attrMap.get(AttributeSetUtilities.
@@ -279,21 +258,17 @@
}
/**
- * Adds the specified attribute to this attribute set if it is not
- * already present, first removing any existing in the same
- * attribute category as the specified attribute value.
- *
- * @param attribute Attribute value to be added to this attribute set.
+ * Adds the specified attribute to this attribute set if it is not already
+ * present, first removing any existing in the same attribute category as
+ * the specified attribute value.
*
- * @return {@code true} if this attribute set changed as a result of the
- * call, i.e., the given attribute value was not already a
- * member of this attribute set.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code add()} operation.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws NullPointerException if the {@code attribute} is {@code null}
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
*/
public boolean add(Attribute attribute) {
Object oldAttribute =
@@ -305,19 +280,15 @@
/**
* Removes any attribute for this category from this attribute set if
- * present. If {@code category} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param category Attribute category to be removed from this
- * attribute set.
+ * present. If {@code category} is {@code null}, then {@code remove()} does
+ * nothing and returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
+ * @param category attribute category to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
* call, i.e., the given attribute category had been a member of
- * this attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code remove()} operation.
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Class<?> category) {
return
@@ -328,19 +299,16 @@
}
/**
- * Removes the specified attribute from this attribute set if
- * present. If {@code attribute} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param attribute Attribute value to be removed from this attribute set.
+ * Removes the specified attribute from this attribute set if present. If
+ * {@code attribute} is {@code null}, then {@code remove()} does nothing and
+ * returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
- * call, i.e., the given attribute value had been a member of
- * this attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code remove()} operation.
+ * @param attribute attribute value to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value had been a member of this
+ * attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Attribute attribute) {
return
@@ -349,14 +317,12 @@
}
/**
- * Returns {@code true} if this attribute set contains an
- * attribute for the specified category.
+ * Returns {@code true} if this attribute set contains an attribute for the
+ * specified category.
*
- * @param category whose presence in this attribute set is
- * to be tested.
- *
- * @return {@code true} if this attribute set contains an attribute
- * value for the specified category.
+ * @param category whose presence in this attribute set is to be tested
+ * @return {@code true} if this attribute set contains an attribute value
+ * for the specified category
*/
public boolean containsKey(Class<?> category) {
return
@@ -367,14 +333,12 @@
}
/**
- * Returns {@code true} if this attribute set contains the given
- * attribute.
+ * Returns {@code true} if this attribute set contains the given attribute.
*
- * @param attribute value whose presence in this attribute set is
- * to be tested.
- *
- * @return {@code true} if this attribute set contains the given
- * attribute value.
+ * @param attribute value whose presence in this attribute set is to be
+ * tested
+ * @return {@code true} if this attribute set contains the given attribute
+ * value
*/
public boolean containsValue(Attribute attribute) {
return
@@ -384,33 +348,25 @@
}
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set.
- * The behavior of the {@code addAll(AttributeSet)}
- * operation is unspecified if the specified set is modified while
- * the operation is in progress.
- * <P>
- * If the {@code addAll(AttributeSet)} operation throws an exception,
- * the effect on this attribute set's state is implementation dependent;
- * elements from the specified set before the point of the exception may
- * or may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. The behavior of the
+ * {@code addAll(AttributeSet)} operation is unspecified if the specified
+ * set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll(AttributeSet)} operation throws an exception, the
+ * effect on this attribute set's state is implementation dependent;
+ * elements from the specified set before the point of the exception may or
+ * may not have been added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of the
- * call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll(AttributeSet)} method.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if some element in the specified
- * set is null, or the set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll(AttributeSet)} method
+ * @throws NullPointerException if some element in the specified set is
+ * {@code null}, or the set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes) {
@@ -428,20 +384,21 @@
}
/**
- * Returns the number of attributes in this attribute set. If this
- * attribute set contains more than {@code Integer.MAX_VALUE} elements,
- * returns {@code Integer.MAX_VALUE}.
+ * Returns the number of attributes in this attribute set. If this attribute
+ * set contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
- * @return The number of attributes in this attribute set.
+ * @return the number of attributes in this attribute set
*/
public int size() {
return attrMap.size();
}
/**
+ * Returns an array of the attributes contained in this set.
*
- * @return the Attributes contained in this set as an array, zero length
- * if the AttributeSet is empty.
+ * @return the attributes contained in this set as an array, zero length if
+ * the {@code AttributeSet} is empty
*/
public Attribute[] toArray() {
Attribute []attrs = new Attribute[size()];
@@ -449,22 +406,20 @@
return attrs;
}
-
/**
* Removes all attributes from this attribute set.
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code clear()} operation.
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code clear()} operation
*/
public void clear() {
attrMap.clear();
}
- /**
- * Returns true if this attribute set contains no attributes.
+ /**
+ * Returns {@code true} if this attribute set contains no attributes.
*
- * @return true if this attribute set contains no attributes.
+ * @return {@code true} if this attribute set contains no attributes
*/
public boolean isEmpty() {
return attrMap.isEmpty();
@@ -472,18 +427,15 @@
/**
* Compares the specified object with this attribute set for equality.
- * Returns {@code true} if the given object is also an attribute set and
- * the two attribute sets contain the same attribute category-attribute
- * value mappings. This ensures that the
- * {@code equals()} method works properly across different
- * implementations of the AttributeSet interface.
+ * Returns {@code true} if the given object is also an attribute set and the
+ * two attribute sets contain the same attribute category-attribute value
+ * mappings. This ensures that the {@code equals()} method works properly
+ * across different implementations of the {@code AttributeSet} interface.
*
- * @param object to be compared for equality with this attribute set.
- *
- * @return {@code true} if the specified object is equal to this
- * attribute set.
+ * @param object to be compared for equality with this attribute set
+ * @return {@code true} if the specified object is equal to this attribute
+ * set
*/
-
public boolean equals(Object object) {
if (object == null || !(object instanceof AttributeSet)) {
return false;
@@ -504,15 +456,14 @@
}
/**
- * Returns the hash code value for this attribute set.
- * The hash code of an attribute set is defined to be the sum
- * of the hash codes of each entry in the AttributeSet.
- * This ensures that {@code t1.equals(t2)} implies that
- * {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
+ * Returns the hash code value for this attribute set. The hash code of an
+ * attribute set is defined to be the sum of the hash codes of each entry in
+ * the {@code AttributeSet}. This ensures that {@code t1.equals(t2)} implies
+ * that {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
* {@code t1} and {@code t2}, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link Object#hashCode() Object.hashCode()}.
*
- * @return The hash code value for this attribute set.
+ * @return the hash code value for this attribute set
*/
public int hashCode() {
int hcode = 0;
@@ -522,5 +473,4 @@
}
return hcode;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashDocAttributeSet provides an attribute set which
- * inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface {@link
- * DocAttributeSet DocAttributeSet}.
+ * Class {@code HashDocAttributeSet} provides an attribute set which inherits
+ * its implementation from class {@link HashAttributeSet HashAttributeSet} and
+ * enforces the semantic restrictions of interface
+ * {@link DocAttributeSet DocAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashDocAttributeSet extends HashAttributeSet
implements DocAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1128534486061432528L;
/**
@@ -49,53 +51,43 @@
}
/**
- * Construct a new hash doc attribute set,
- * initially populated with the given value.
+ * Construct a new hash doc attribute set, initially populated with the
+ * given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashDocAttributeSet(DocAttribute attribute) {
super (attribute, DocAttribute.class);
}
/**
- * Construct a new hash doc attribute set,
- * initially populated with the values from the given array.
- * The new attribute set is populated by
- * adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new hash doc attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashDocAttributeSet(DocAttribute[] attributes) {
super (attributes, DocAttribute.class);
}
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code DocAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code DocAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code DocAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code DocAttribute}
*/
public HashDocAttributeSet(DocAttributeSet attributes) {
super(attributes, DocAttribute.class);
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashPrintJobAttributeSet provides an attribute set
- * which inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface
- * {@link PrintJobAttributeSet PrintJobAttributeSet}.
+ * Class {@code HashPrintJobAttributeSet} provides an attribute set which
+ * inherits its implementation from class
+ * {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface {@link PrintJobAttributeSet PrintJobAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintJobAttributeSet extends HashAttributeSet
implements PrintJobAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4204473656070350348L;
/**
@@ -49,49 +51,42 @@
}
/**
- * Construct a new hash print job attribute set,
- * initially populated with the given value.
+ * Construct a new hash print job attribute set, initially populated with
+ * the given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintJobAttributeSet(PrintJobAttribute attribute) {
super(attribute, PrintJobAttribute.class);
}
/**
- * Construct a new hash print job attribute set,
- * initially populated with the values from the given array.
- * The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new hash print job attribute set, initially populated with
+ * the values from the given array. The new attribute set is populated by
+ * adding the elements of {@code attributes} array to the set in sequence,
+ * starting at index 0. Thus, later array elements may replace earlier array
+ * elements if the array contains duplicate attribute values or attribute
+ * categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {
super (attributes, PrintJobAttribute.class);
}
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code PrintJobAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code PrintJobAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code PrintJobAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintJobAttribute}
*/
public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {
super(attributes, PrintJobAttribute.class);
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashPrintRequestAttributeSet inherits its implementation from
- * class {@link HashAttributeSet HashAttributeSet} and enforces the
- * semantic restrictions of interface
+ * Class {@code HashPrintRequestAttributeSet} inherits its implementation from
+ * class {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface
* {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintRequestAttributeSet extends HashAttributeSet
implements PrintRequestAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2364756266107751933L;
/**
@@ -49,55 +51,44 @@
}
/**
- * Construct a new print request attribute set,
- * initially populated with the given value.
+ * Construct a new print request attribute set, initially populated with the
+ * given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) {
super (attribute, PrintRequestAttribute.class);
}
/**
- * Construct a new print request attribute set, initially populated with
- * the values from the given array. The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new print request attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) {
super (attributes, PrintRequestAttribute.class);
}
-
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code (PrintRequestAttributeSe} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code (PrintRequestAttributeSe} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code (PrintRequestAttributeSe}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintRequestAttributeSe}
*/
public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
{
super(attributes, PrintRequestAttribute.class);
}
-
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,16 +28,20 @@
import java.io.Serializable;
/**
- * Class HashPrintServiceAttributeSet provides an attribute set
- * which inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface
+ * Class {@code HashPrintServiceAttributeSet} provides an attribute set which
+ * inherits its implementation from class
+ * {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface
* {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintServiceAttributeSet extends HashAttributeSet
implements PrintServiceAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6642904616179203070L;
/**
@@ -47,52 +51,42 @@
super (PrintServiceAttribute.class);
}
-
/**
- * Construct a new hash print service attribute set,
- * initially populated with the given value.
+ * Construct a new hash print service attribute set, initially populated
+ * with the given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {
super (attribute, PrintServiceAttribute.class);
}
/**
- * Construct a new print service attribute set, initially populated with
- * the values from the given array. The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new print service attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {
super (attributes, PrintServiceAttribute.class);
}
-
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code PrintServiceAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code PrintServiceAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code PrintServiceAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintServiceAttribute}
*/
public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)
{
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,25 +28,28 @@
import java.io.Serializable;
/**
- * Class IntegerSyntax is an abstract base class providing the common
+ * Class {@code IntegerSyntax} is an abstract base class providing the common
* implementation of all attributes with integer values.
- * <P>
+ * <p>
* Under the hood, an integer attribute is just an integer. You can get an
- * integer attribute's integer value by calling {@link #getValue()
- * getValue()}. An integer attribute's integer value is
- * established when it is constructed (see {@link #IntegerSyntax(int)
- * IntegerSyntax(int)}). Once constructed, an integer attribute's
- * value is immutable.
+ * integer attribute's integer value by calling {@link #getValue() getValue()}.
+ * An integer attribute's integer value is established when it is constructed
+ * (see {@link #IntegerSyntax(int) IntegerSyntax(int)}). Once constructed, an
+ * integer attribute's value is immutable.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class IntegerSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3644574816328081943L;
/**
* This integer attribute's integer value.
+ *
* @serial
*/
private int value;
@@ -54,7 +57,7 @@
/**
* Construct a new integer attribute with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected IntegerSyntax(int value) {
this.value = value;
@@ -64,14 +67,11 @@
* Construct a new integer attribute with the given integer value, which
* must lie within the given range.
*
- * @param value Integer value.
- * @param lowerBound Lower bound.
- * @param upperBound Upper bound.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than
- * {@code lowerBound} or greater than
- * {@code upperBound}.
+ * @param value Integer value
+ * @param lowerBound Lower bound
+ * @param upperBound Upper bound
+ * @throws IllegalArgumentException if {@code value} is less than
+ * {@code lowerBound} or greater than {@code upperBound}
*/
protected IntegerSyntax(int value, int lowerBound, int upperBound) {
if (lowerBound > value || value > upperBound) {
@@ -84,6 +84,7 @@
/**
* Returns this integer attribute's integer value.
+ *
* @return the integer value
*/
public int getValue() {
@@ -93,20 +94,16 @@
/**
* Returns whether this integer attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class IntegerSyntax.
- * <LI>
- * This integer attribute's value and {@code object}'s value are
- * equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code IntegerSyntax}.
+ * <li>This integer attribute's value and {@code object}'s value are
+ * equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this integer
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this integer
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,19 +26,18 @@
package javax.print.attribute;
/**
- * PrintJobAttribute is a tagging interface which a printing attribute
+ * {@code PrintJobAttribute} is a tagging interface which a printing attribute
* class implements to indicate the attribute describes the status of a Print
- * Job or some other characteristic of a Print Job. A Print Service
- * instance adds a number of PrintJobAttributes to a Print Job's attribute set
- * to report the Print Job's status. If an attribute implements {@link
- * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute,
- * the client may include the attribute in a attribute set to
- * specify the attribute's value for the Print Job.
+ * Job or some other characteristic of a Print Job. A Print Service instance
+ * adds a number of {@code PrintJobAttributes} to a Print Job's attribute set to
+ * report the Print Job's status. If an attribute implements
+ * {@link PrintRequestAttribute PrintRequestAttribute} as well as
+ * {@code PrintJobAttribute}, the client may include the attribute in a
+ * attribute set to specify the attribute's value for the Print Job.
*
+ * @author Alan Kaminsky
* @see PrintRequestAttributeSet
* @see PrintJobAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface PrintJobAttribute extends Attribute {
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,85 +23,69 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintJobAttributeSet specifies the interface for a set of print
- * job attributes, i.e. printing attributes that implement interface {@link
- * PrintJobAttribute PrintJobAttribute}. In the Print Service API, a
- * service uses a PrintJobAttributeSet to report the status of a print job.
- * <P>
- * A PrintJobAttributeSet is just an {@link AttributeSet AttributeSet} whose
- * constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the PrintJobAttributeSet must be
- * instances of interface {@link PrintJobAttribute PrintJobAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintJobAttributeSet} specifies the interface for a set of
+ * print job attributes, i.e. printing attributes that implement interface
+ * {@link PrintJobAttribute PrintJobAttribute}. In the Print Service API, a
+ * service uses a {@code PrintJobAttributeSet} to report the status of a print
+ * job.
+ * <p>
+ * A {@code PrintJobAttributeSet} is just an {@link AttributeSet AttributeSet}
+ * whose constructors and mutating operations guarantee an additional invariant,
+ * namely that all attribute values in the {@code PrintJobAttributeSet} must be
+ * instances of interface {@link PrintJobAttribute PrintJobAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintJobAttributeSet extends AttributeSet {
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintJobAttribute PrintJobAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintJobAttribute PrintJobAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the <i>union</i> of the two sets.
- * <P>
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- * <P>
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the <i>union</i> of the two sets.
+ * <p>
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintJobAttribute
- * PrintJobAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface {@link PrintJobAttribute PrintJobAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,28 +23,25 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintRequestAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute denotes a
+ * Interface {@code PrintRequestAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute denotes a
* requested setting for a print job.
* <p>
- * Attributes which are tagged with PrintRequestAttribute and are also tagged
- * as PrintJobAttribute, represent the subset of job attributes which
- * can be part of the specification of a job request.
+ * Attributes which are tagged with {@code PrintRequestAttribute} and are also
+ * tagged as {@code PrintJobAttribute}, represent the subset of job attributes
+ * which can be part of the specification of a job request.
* <p>
- * If an attribute implements {@link DocAttribute DocAttribute}
- * as well as PrintRequestAttribute, the client may include the
- * attribute in a {@code Doc}'s attribute set to specify
- * a job setting which pertains just to that doc.
+ * If an attribute implements {@link DocAttribute DocAttribute} as well as
+ * {@code PrintRequestAttribute}, the client may include the attribute in a
+ * {@code Doc}'s attribute set to specify a job setting which pertains just to
+ * that doc.
*
+ * @author Alan Kaminsky
* @see DocAttributeSet
* @see PrintRequestAttributeSet
- *
- * @author Alan Kaminsky
*/
-
public interface PrintRequestAttribute extends Attribute {
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,88 +23,72 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintRequestAttributeSet specifies the interface for a set of
- * print request attributes, i.e. printing attributes that implement interface
- * {@link PrintRequestAttribute PrintRequestAttribute}.
- * The client uses a PrintRequestAttributeSet to specify the settings to be
- * applied to a whole print job and to all the docs in the print job.
- * <P>
- * PrintRequestAttributeSet is just an {@link AttributeSet AttributeSet} whose
- * constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the PrintRequestAttributeSet must be
- * instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintRequestAttributeSet} specifies the interface for a set
+ * of print request attributes, i.e. printing attributes that implement
+ * interface {@link PrintRequestAttribute PrintRequestAttribute}. The client
+ * uses a {@code PrintRequestAttributeSet} to specify the settings to be applied
+ * to a whole print job and to all the docs in the print job.
+ * <p>
+ * {@code PrintRequestAttributeSet} is just an {@link AttributeSet AttributeSet}
+ * whose constructors and mutating operations guarantee an additional invariant,
+ * namely that all attribute values in the {@code PrintRequestAttributeSet} must
+ * be instances of interface
+ * {@link PrintRequestAttribute PrintRequestAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintRequestAttributeSet extends AttributeSet {
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintRequestAttribute PrintRequestAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintRequestAttribute PrintRequestAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the <i>union</i> of the two sets.
- * <P>
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- * <P>
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the <i>union</i> of the two sets.
+ * <p>
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintRequestAttribute
- * PrintRequestAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface
+ * {@link PrintRequestAttribute PrintRequestAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,15 +26,14 @@
package javax.print.attribute;
/**
- * Interface PrintServiceAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute describes the status
- * of a Print Service or some other characteristic of a Print Service. A Print
- * Service instance adds a number of PrintServiceAttributes to a Print
- * service's attribute set to report the Print Service's status.
+ * Interface {@code PrintServiceAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute describes the
+ * status of a Print Service or some other characteristic of a Print Service. A
+ * Print Service instance adds a number of {@code PrintServiceAttributes} to a
+ * Print service's attribute set to report the Print Service's status.
*
+ * @author Alan Kaminsky
* @see PrintServiceAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface PrintServiceAttribute extends Attribute {
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttributeSet.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttributeSet.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,90 +23,71 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintServiceAttributeSet specifies the interface for a set of
- * print job attributes, i.e. printing attributes that implement interface
- * {@link
- * PrintServiceAttribute PrintServiceAttribute}. In the Print Service API,
- * the Print Service instance uses a PrintServiceAttributeSet to report the
- * status of the print service.
- * <P>
- * A PrintServiceAttributeSet is just an {@link AttributeSet AttributeSet}
- * whose constructors and mutating operations guarantee an additional
- * invariant,
- * namely that all attribute values in the PrintServiceAttributeSet must be
- * instances of interface {@link PrintServiceAttribute PrintServiceAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintServiceAttributeSet} specifies the interface for a set
+ * of print job attributes, i.e. printing attributes that implement interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}. In the Print Service
+ * API, the Print Service instance uses a {@code PrintServiceAttributeSet} to
+ * report the status of the print service.
+ * <p>
+ * A {@code PrintServiceAttributeSet} is just an
+ * {@link AttributeSet AttributeSet} whose constructors and mutating operations
+ * guarantee an additional invariant, namely that all attribute values in the
+ * {@code PrintServiceAttributeSet} must be instances of interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintServiceAttributeSet extends AttributeSet {
-
-
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintServiceAttribute PrintServiceAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintServiceAttribute PrintServiceAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the <i>union</i> of the two sets.
- * <P>
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- * <P>
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the <i>union</i> of the two sets.
+ * <p>
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ * <p>
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintServiceAttribute
- * PrintServiceAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,29 +23,27 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class ResolutionSyntax is an abstract base class providing the common
+ * Class {@code ResolutionSyntax} is an abstract base class providing the common
* implementation of all attributes denoting a printer resolution.
- * <P>
+ * <p>
* A resolution attribute's value consists of two items, the cross feed
* direction resolution and the feed direction resolution. A resolution
* attribute may be constructed by supplying the two values and indicating the
* units in which the values are measured. Methods are provided to return a
* resolution attribute's values, indicating the units in which the values are
* to be returned. The two most common resolution units are dots per inch (dpi)
- * and dots per centimeter (dpcm), and exported constants {@link #DPI
- * DPI} and {@link #DPCM DPCM} are provided for
- * indicating those units.
- * <P>
+ * and dots per centimeter (dpcm), and exported constants {@link #DPI DPI} and
+ * {@link #DPCM DPCM} are provided for indicating those units.
+ * <p>
* Once constructed, a resolution attribute's value is immutable.
- * <P>
- * <B>Design</B>
- * <P>
+ * <p>
+ * <b>Design</b>
+ * <p>
* A resolution attribute's cross feed direction resolution and feed direction
* resolution values are stored internally using units of dots per 100 inches
* (dphi). Storing the values in dphi rather than, say, metric units allows
@@ -57,43 +55,47 @@
* resolution attribute's values are created in one units and retrieved in
* different units; for example, 600 dpi will be rounded to 236 dpcm, whereas
* the true value (to five figures) is 236.22 dpcm.
- * <P>
+ * <p>
* Storing the values internally in common units of dphi lets two resolution
* attributes be compared without regard to the units in which they were
* created; for example, 300 dpcm will compare equal to 762 dpi, as they both
- * are stored as 76200 dphi. In particular, a lookup service can
- * match resolution attributes based on equality of their serialized
- * representations regardless of the units in which they were created. Again,
- * using integers for internal storage allows precise equality comparisons to be
- * done, which would not be guaranteed if a floating point representation were
- * used.
- * <P>
- * The exported constant {@link #DPI DPI} is actually the
- * conversion factor by which to multiply a value in dpi to get the value in
- * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
- * conversion factor by which to multiply a value in dpcm to get the value in
- * dphi. A client can specify a resolution value in units other than dpi or dpcm
- * by supplying its own conversion factor. However, since the internal units of
- * dphi was chosen with supporting only the external units of dpi and dpcm in
- * mind, there is no guarantee that the conversion factor for the client's units
- * will be an exact integer. If the conversion factor isn't an exact integer,
- * resolution values in the client's units won't be stored precisely.
+ * are stored as 76200 dphi. In particular, a lookup service can match
+ * resolution attributes based on equality of their serialized representations
+ * regardless of the units in which they were created. Again, using integers for
+ * internal storage allows precise equality comparisons to be done, which would
+ * not be guaranteed if a floating point representation were used.
+ * <p>
+ * The exported constant {@link #DPI DPI} is actually the conversion factor by
+ * which to multiply a value in dpi to get the value in dphi. Likewise, the
+ * exported constant {@link #DPCM DPCM} is the conversion factor by which to
+ * multiply a value in dpcm to get the value in dphi. A client can specify a
+ * resolution value in units other than dpi or dpcm by supplying its own
+ * conversion factor. However, since the internal units of dphi was chosen with
+ * supporting only the external units of dpi and dpcm in mind, there is no
+ * guarantee that the conversion factor for the client's units will be an exact
+ * integer. If the conversion factor isn't an exact integer, resolution values
+ * in the client's units won't be stored precisely.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class ResolutionSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2706743076526672017L;
/**
* Cross feed direction resolution in units of dots per 100 inches (dphi).
+ *
* @serial
*/
private int crossFeedResolution;
/**
* Feed direction resolution in units of dots per 100 inches (dphi).
+ *
* @serial
*/
private int feedResolution;
@@ -105,26 +107,20 @@
public static final int DPI = 100;
/**
- * Value to indicate units of dots per centimeter (dpcm). It is actually
- * the conversion factor by which to multiply dpcm to yield dphi (254).
+ * Value to indicate units of dots per centimeter (dpcm). It is actually the
+ * conversion factor by which to multiply dpcm to yield dphi (254).
*/
public static final int DPCM = 254;
-
/**
* Construct a new resolution attribute from the given items.
*
- * @param crossFeedResolution
- * Cross feed direction resolution.
- * @param feedResolution
- * Feed direction resolution.
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code crossFeedResolution < 1}
- * or {@code feedResolution < 1} or {@code units < 1}.
+ * @param crossFeedResolution cross feed direction resolution
+ * @param feedResolution feed direction resolution
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @throws IllegalArgumentException if {@code crossFeedResolution < 1} or
+ * {@code feedResolution < 1} or {@code units < 1}
*/
public ResolutionSyntax(int crossFeedResolution, int feedResolution,
int units) {
@@ -147,16 +143,11 @@
* Convert a value from dphi to some other units. The result is rounded to
* the nearest integer.
*
- * @param dphi
- * Value (dphi) to convert.
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return The value of {@code dphi} converted to the desired units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units} < 1.
+ * @param dphi value (dphi) to convert
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return the value of {@code dphi} converted to the desired units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
private static int convertFromDphi(int dphi, int units) {
if (units < 1) {
@@ -167,18 +158,14 @@
}
/**
- * Get this resolution attribute's resolution values in the given units.
- * The values are rounded to the nearest integer.
+ * Get this resolution attribute's resolution values in the given units. The
+ * values are rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return A two-element array with the cross feed direction resolution
- * at index 0 and the feed direction resolution at index 1.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return a two-element array with the cross feed direction resolution at
+ * index 0 and the feed direction resolution at index 1
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int[] getResolution(int units) {
return new int[] { getCrossFeedResolution(units),
@@ -190,14 +177,10 @@
* Returns this resolution attribute's cross feed direction resolution in
* the given units. The value is rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return Cross feed direction resolution.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return cross feed direction resolution
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int getCrossFeedResolution(int units) {
return convertFromDphi (crossFeedResolution, units);
@@ -207,14 +190,10 @@
* Returns this resolution attribute's feed direction resolution in the
* given units. The value is rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
- * #DPCM DPCM}.
- *
- * @return Feed direction resolution.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return feed direction resolution
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int getFeedResolution(int units) {
return convertFromDphi (feedResolution, units);
@@ -222,22 +201,18 @@
/**
* Returns a string version of this resolution attribute in the given units.
- * The string takes the form <code>"<I>C</I>x<I>F</I> <I>U</I>"</code>,
- * where <I>C</I> is the cross feed direction resolution, <I>F</I> is the
- * feed direction resolution, and <I>U</I> is the units name. The values are
+ * The string takes the form <code>"<i>C</i>x<i>F</i> <i>U</i>"</code>,
+ * where <i>C</i> is the cross feed direction resolution, <i>F</i> is the
+ * feed direction resolution, and <i>U</i> is the units name. The values are
* rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
- * #DPCM DPCM}.
- * @param unitsName
- * Units name string, e.g. {@code "dpi"} or {@code "dpcm"}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this resolution attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI CODE>DPI} or
+ * {@link #DPCM DPCM}
+ * @param unitsName units name string, e.g. {@code "dpi"} or
+ * {@code "dpcm"}. If {@code null}, no units name is appended to the
+ * result.
+ * @return string version of this resolution attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
StringBuilder result = new StringBuilder();
@@ -251,54 +226,43 @@
return result.toString();
}
-
/**
- * Determine whether this resolution attribute's value is less than or
- * equal to the given resolution attribute's value. This is true if all
- * of the following conditions are true:
- * <UL>
- * <LI>
- * This attribute's cross feed direction resolution is less than or equal to
- * the {@code other} attribute's cross feed direction resolution.
- * <LI>
- * This attribute's feed direction resolution is less than or equal to the
- * {@code other} attribute's feed direction resolution.
- * </UL>
+ * Determine whether this resolution attribute's value is less than or equal
+ * to the given resolution attribute's value. This is true if all of the
+ * following conditions are true:
+ * <ul>
+ * <li>This attribute's cross feed direction resolution is less than or
+ * equal to the {@code other} attribute's cross feed direction resolution.
+ * <li>This attribute's feed direction resolution is less than or equal to
+ * the {@code other} attribute's feed direction resolution.
+ * </ul>
*
- * @param other Resolution attribute to compare with.
- *
- * @return True if this resolution attribute is less than or equal to the
- * {@code other} resolution attribute, false otherwise.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code other} is null.
+ * @param other resolution attribute to compare with
+ * @return {@code true} if this resolution attribute is less than or equal
+ * to the {@code other} resolution attribute, {@code false}
+ * otherwise
+ * @throws NullPointerException if {@code other} is {@code null}
*/
public boolean lessThanOrEquals(ResolutionSyntax other) {
return (this.crossFeedResolution <= other.crossFeedResolution &&
this.feedResolution <= other.feedResolution);
}
-
/**
* Returns whether this resolution attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class ResolutionSyntax.
- * <LI>
- * This attribute's cross feed direction resolution is equal to
- * {@code object}'s cross feed direction resolution.
- * <LI>
- * This attribute's feed direction resolution is equal to
- * {@code object}'s feed direction resolution.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code ResolutionSyntax}.
+ * <li>This attribute's cross feed direction resolution is equal to
+ * {@code object}'s cross feed direction resolution.
+ * <li>This attribute's feed direction resolution is equal to
+ * {@code object}'s feed direction resolution.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this resolution
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this resolution
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
@@ -320,8 +284,8 @@
/**
* Returns a string version of this resolution attribute. The string takes
- * the form <code>"<I>C</I>x<I>F</I> dphi"</code>, where <I>C</I> is the
- * cross feed direction resolution and <I>F</I> is the feed direction
+ * the form <code>"<i>C</i>x<i>F</i> dphi"</code>, where <i>C</i> is the
+ * cross feed direction resolution and <i>F</i> is the feed direction
* resolution. The values are reported in the internal units of dphi.
*/
public String toString() {
@@ -333,25 +297,23 @@
return result.toString();
}
-
/**
* Returns this resolution attribute's cross feed direction resolution in
* units of dphi. (For use in a subclass.)
*
- * @return Cross feed direction resolution.
+ * @return cross feed direction resolution
*/
protected int getCrossFeedResolutionDphi() {
return crossFeedResolution;
}
/**
- * Returns this resolution attribute's feed direction resolution in units
- * of dphi. (For use in a subclass.)
+ * Returns this resolution attribute's feed direction resolution in units of
+ * dphi. (For use in a subclass.)
*
- * @return Feed direction resolution.
+ * @return feed direction resolution
*/
protected int getFeedResolutionDphi() {
return feedResolution;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,82 +23,82 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.util.Vector;
/**
- * Class SetOfIntegerSyntax is an abstract base class providing the common
- * implementation of all attributes whose value is a set of nonnegative
+ * Class {@code SetOfIntegerSyntax} is an abstract base class providing the
+ * common implementation of all attributes whose value is a set of nonnegative
* integers. This includes attributes whose value is a single range of integers
* and attributes whose value is a set of ranges of integers.
- * <P>
- * You can construct an instance of SetOfIntegerSyntax by giving it in "string
- * form." The string consists of zero or more comma-separated integer groups.
- * Each integer group consists of either one integer, two integers separated by
- * a hyphen ({@code -}), or two integers separated by a colon
- * ({@code :}). Each integer consists of one or more decimal digits
- * ({@code 0} through {@code 9}). Whitespace characters cannot
- * appear within an integer but are otherwise ignored. For example:
- * {@code ""}, {@code "1"}, {@code "5-10"}, {@code "1:2, 4"}.
- * <P>
- * You can also construct an instance of SetOfIntegerSyntax by giving it in
- * "array form." Array form consists of an array of zero or more integer groups
- * where each integer group is a length-1 or length-2 array of
- * {@code int}s; for example, {@code int[0][]},
- * {@code int[][]{{1}}}, {@code int[][]{{5,10}}},
- * {@code int[][]{{1,2},{4}}}.
- * <P>
+ * <p>
+ * You can construct an instance of {@code SetOfIntegerSyntax} by giving it in
+ * "string form." The string consists of zero or more comma-separated integer
+ * groups. Each integer group consists of either one integer, two integers
+ * separated by a hyphen ({@code -}), or two integers separated by a colon
+ * ({@code :}). Each integer consists of one or more decimal digits ({@code 0}
+ * through {@code 9}). Whitespace characters cannot appear within an integer but
+ * are otherwise ignored. For example: {@code ""}, {@code "1"}, {@code "5-10"},
+ * {@code "1:2, 4"}.
+ * <p>
+ * You can also construct an instance of {@code SetOfIntegerSyntax} by giving it
+ * in "array form." Array form consists of an array of zero or more integer
+ * groups where each integer group is a length-1 or length-2 array of
+ * {@code int}s; for example, {@code int[0][]}, {@code int[][]{{1}}},
+ * {@code int[][]{{5,10}}}, {@code int[][]{{1,2},{4}}}.
+ * <p>
* In both string form and array form, each successive integer group gives a
* range of integers to be included in the set. The first integer in each group
* gives the lower bound of the range; the second integer in each group gives
* the upper bound of the range; if there is only one integer in the group, the
* upper bound is the same as the lower bound. If the upper bound is less than
- * the lower bound, it denotes a null range (no values). If the upper bound is
- * equal to the lower bound, it denotes a range consisting of a single value. If
- * the upper bound is greater than the lower bound, it denotes a range
+ * the lower bound, it denotes a {@code null} range (no values). If the upper
+ * bound is equal to the lower bound, it denotes a range consisting of a single
+ * value. If the upper bound is greater than the lower bound, it denotes a range
* consisting of more than one value. The ranges may appear in any order and are
* allowed to overlap. The union of all the ranges gives the set's contents.
- * Once a SetOfIntegerSyntax instance is constructed, its value is immutable.
- * <P>
- * The SetOfIntegerSyntax object's value is actually stored in "<I>canonical</I>
- * array form." This is the same as array form, except there are no null ranges;
- * the members of the set are represented in as few ranges as possible (i.e.,
- * overlapping ranges are coalesced); the ranges appear in ascending order; and
- * each range is always represented as a length-two array of {@code int}s
- * in the form {lower bound, upper bound}. An empty set is represented as a
- * zero-length array.
- * <P>
- * Class SetOfIntegerSyntax has operations to return the set's members in
- * canonical array form, to test whether a given integer is a member of the
+ * Once a {@code SetOfIntegerSyntax} instance is constructed, its value is
+ * immutable.
+ * <p>
+ * The {@code SetOfIntegerSyntax} object's value is actually stored in
+ * "<i>canonical</i> array form." This is the same as array form, except there
+ * are no {@code null} ranges; the members of the set are represented in as few
+ * ranges as possible (i.e., overlapping ranges are coalesced); the ranges
+ * appear in ascending order; and each range is always represented as a
+ * length-two array of {@code int}s in the form {lower bound, upper bound}. An
+ * empty set is represented as a zero-length array.
+ * <p>
+ * Class {@code SetOfIntegerSyntax} has operations to return the set's members
+ * in canonical array form, to test whether a given integer is a member of the
* set, and to iterate through the members of the set.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3666874174847632203L;
/**
* This set's members in canonical array form.
+ *
* @serial
*/
private int[][] members;
-
/**
- * Construct a new set-of-integer attribute with the given members in
- * string form.
+ * Construct a new set-of-integer attribute with the given members in string
+ * form.
*
- * @param members Set members in string form. If null, an empty set is
- * constructed.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code members} does not
- * obey the proper syntax.
+ * @param members set members in string form. If {@code null}, an empty set
+ * is constructed.
+ * @throws IllegalArgumentException if {@code members} does not obey the
+ * proper syntax
*/
protected SetOfIntegerSyntax(String members) {
this.members = parse (members);
@@ -106,6 +106,9 @@
/**
* Parse the given string, returning canonical array form.
+ *
+ * @param members the string
+ * @return the canonical array form
*/
private static int[][] parse(String members) {
// Create vector to hold int[] elements, each element being one range
@@ -238,8 +241,8 @@
}
/**
- * Accumulate the given range (lb .. ub) into the canonical array form
- * into the given vector of int[] objects.
+ * Accumulate the given range (lb .. ub) into the canonical array form into
+ * the given vector of int[] objects.
*/
private static void accumulate(Vector<int[]> ranges, int lb,int ub) {
// Make sure range is non-null.
@@ -257,12 +260,12 @@
int[] rangeb = ranges.elementAt (j+1);
int lbb = rangeb[0];
int ubb = rangeb[1];
-
- /* If the two ranges overlap or are adjacent, coalesce them.
- * The two ranges overlap if the larger lower bound is less
- * than or equal to the smaller upper bound. The two ranges
- * are adjacent if the larger lower bound is one greater
- * than the smaller upper bound.
+ /*
+ * If the two ranges overlap or are adjacent, coalesce them. The
+ * two ranges overlap if the larger lower bound is less than or
+ * equal to the smaller upper bound. The two ranges are adjacent
+ * if the larger lower bound is one greater than the smaller
+ * upper bound.
*/
if (Math.max(lba, lbb) - Math.min(uba, ubb) <= 1) {
// The coalesced range is from the smaller lower bound to
@@ -279,9 +282,10 @@
ranges.setElementAt (rangeb, j);
ranges.setElementAt (rangea, j+1);
} else {
- /* If the two ranges don't overlap and aren't adjacent and
- * aren't out of order, we're done early.
- */
+ /*
+ * If the two ranges don't overlap and aren't adjacent and
+ * aren't out of order, we're done early.
+ */
break;
}
}
@@ -296,20 +300,16 @@
}
/**
- * Construct a new set-of-integer attribute with the given members in
- * array form.
- *
- * @param members Set members in array form. If null, an empty set is
- * constructed.
+ * Construct a new set-of-integer attribute with the given members in array
+ * form.
*
- * @exception NullPointerException
- * (Unchecked exception) Thrown if any element of
- * {@code members} is null.
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if any element of
- * {@code members} is not a length-one or length-two array or if
- * any non-null range in {@code members} has a lower bound less
- * than zero.
+ * @param members set members in array form. If {@code null}, an empty set
+ * is constructed.
+ * @throws NullPointerException if any element of {@code members} is
+ * {@code null}
+ * @throws IllegalArgumentException if any element of {@code members} is not
+ * a length-one or length-two array or if any {@code non-null} range
+ * in {@code members} has a lower bound less than zero
*/
protected SetOfIntegerSyntax(int[][] members) {
this.members = parse (members);
@@ -353,11 +353,8 @@
/**
* Construct a new set-of-integer attribute containing a single integer.
*
- * @param member Set member.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than
- * zero.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member} is negative
*/
protected SetOfIntegerSyntax(int member) {
if (member < 0) {
@@ -371,12 +368,10 @@
* integers. If the lower bound is greater than the upper bound (a null
* range), an empty set is constructed.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if the range is non-null and
- * {@code lowerBound} is less than zero.
+ * @param lowerBound Lower bound of the range
+ * @param upperBound Upper bound of the range
+ * @throws IllegalArgumentException if the range is {@code non-null} and
+ * {@code lowerBound} is less than zero
*/
protected SetOfIntegerSyntax(int lowerBound, int upperBound) {
if (lowerBound <= upperBound && lowerBound < 0) {
@@ -387,13 +382,12 @@
new int[0][];
}
-
/**
* Obtain this set-of-integer attribute's members in canonical array form.
* The returned array is "safe;" the client may alter it without affecting
* this set-of-integer attribute.
*
- * @return This set-of-integer attribute's members in canonical array form.
+ * @return this set-of-integer attribute's members in canonical array form
*/
public int[][] getMembers() {
int n = members.length;
@@ -407,10 +401,9 @@
/**
* Determine if this set-of-integer attribute contains the given value.
*
- * @param x Integer value.
- *
- * @return True if this set-of-integer attribute contains the value
- * {@code x}, false otherwise.
+ * @param x the Integer value
+ * @return {@code true} if this set-of-integer attribute contains the value
+ * {@code x}, {@code false} otherwise
*/
public boolean contains(int x) {
// Do a linear search to find the range that contains x, if any.
@@ -429,10 +422,9 @@
* Determine if this set-of-integer attribute contains the given integer
* attribute's value.
*
- * @param attribute Integer attribute.
- *
- * @return True if this set-of-integer attribute contains
- * {@code theAttribute}'s value, false otherwise.
+ * @param attribute the Integer attribute
+ * @return {@code true} if this set-of-integer attribute contains
+ * {@code attribute}'s value, {@code false} otherwise
*/
public boolean contains(IntegerSyntax attribute) {
return contains (attribute.getValue());
@@ -446,20 +438,19 @@
* values, {@code -1} will never appear in the set.) You can use the
* {@code next()} method to iterate through the integer values in a
* set-of-integer attribute in ascending order, like this:
- * <PRE>
+ * <pre>
* SetOfIntegerSyntax attribute = . . .;
* int i = -1;
* while ((i = attribute.next (i)) != -1)
* {
* foo (i);
* }
- * </PRE>
- *
- * @param x Integer value.
+ * </pre>
*
- * @return The smallest integer in this set-of-integer attribute that is
- * greater than {@code x}, or {@code -1} if no integer in
- * this set-of-integer attribute is greater than {@code x}.
+ * @param x the Integer value
+ * @return the smallest integer in this set-of-integer attribute that is
+ * greater than {@code x}, or {@code -1} if no integer in this
+ * set-of-integer attribute is greater than {@code x}.
*/
public int next(int x) {
// Do a linear search to find the range that contains x, if any.
@@ -478,20 +469,16 @@
* Returns whether this set-of-integer attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class SetOfIntegerSyntax.
- * <LI>
- * This set-of-integer attribute's members and {@code object}'s
- * members are the same.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code SetOfIntegerSyntax}.
+ * <li>This set-of-integer attribute's members and {@code object}'s
+ * members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this
- * set-of-integer attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * set-of-integer attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
if (object != null && object instanceof SetOfIntegerSyntax) {
@@ -533,9 +520,9 @@
* Returns a string value corresponding to this set-of-integer attribute.
* The string value is a zero-length string if this set is empty. Otherwise,
* the string value is a comma-separated list of the ranges in the canonical
- * array form, where each range is represented as <code>"<I>i</I>"</code> if
+ * array form, where each range is represented as <code>"<i>i</i>"</code> if
* the lower bound equals the upper bound or
- * <code>"<I>i</I>-<I>j</I>"</code> otherwise.
+ * <code>"<i>i</i>-<i>j</i>"</code> otherwise.
*/
public String toString() {
StringBuilder result = new StringBuilder();
@@ -552,5 +539,4 @@
}
return result.toString();
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,75 +23,78 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class Size2DSyntax is an abstract base class providing the common
+ * Class {@code Size2DSyntax} is an abstract base class providing the common
* implementation of all attributes denoting a size in two dimensions.
- * <P>
- * A two-dimensional size attribute's value consists of two items, the X
- * dimension and the Y dimension. A two-dimensional size attribute may be
- * constructed by supplying the two values and indicating the units in which the
- * values are measured. Methods are provided to return a two-dimensional size
- * attribute's values, indicating the units in which the values are to be
+ * <p>
+ * A two-dimensional size attribute's value consists of two items, the {@code X}
+ * dimension and the {@code Y} dimension. A two-dimensional size attribute may
+ * be constructed by supplying the two values and indicating the units in which
+ * the values are measured. Methods are provided to return a two-dimensional
+ * size attribute's values, indicating the units in which the values are to be
* returned. The two most common size units are inches (in) and millimeters
- * (mm), and exported constants {@link #INCH INCH} and {@link #MM
- * MM} are provided for indicating those units.
- * <P>
+ * (mm), and exported constants {@link #INCH INCH} and {@link #MM MM} are
+ * provided for indicating those units.
+ * <p>
* Once constructed, a two-dimensional size attribute's value is immutable.
- * <P>
- * <B>Design</B>
- * <P>
- * A two-dimensional size attribute's X and Y dimension values are stored
- * internally as integers in units of micrometers (µm), where 1 micrometer
- * = 10<SUP>-6</SUP> meter = 1/1000 millimeter = 1/25400 inch. This permits
- * dimensions to be represented exactly to a precision of 1/1000 mm (= 1
+ * <p>
+ * <b>Design</b>
+ * <p>
+ * A two-dimensional size attribute's {@code X} and {@code Y} dimension values
+ * are stored internally as integers in units of micrometers (µm), where 1
+ * micrometer = 10<SUP>-6</SUP> meter = 1/1000 millimeter = 1/25400 inch. This
+ * permits dimensions to be represented exactly to a precision of 1/1000 mm (= 1
* µm) or 1/100 inch (= 254 µm). If fractional inches are expressed in
* negative powers of two, this permits dimensions to be represented exactly to
* a precision of 1/8 inch (= 3175 µm) but not 1/16 inch (because 1/16 inch
* does not equal an integral number of µm).
- * <P>
+ * <p>
* Storing the dimensions internally in common units of µm lets two size
* attributes be compared without regard to the units in which they were
* created; for example, 8.5 in will compare equal to 215.9 mm, as they both are
- * stored as 215900 µm. For example, a lookup service can
- * match resolution attributes based on equality of their serialized
- * representations regardless of the units in which they were created. Using
- * integers for internal storage allows precise equality comparisons to be done,
- * which would not be guaranteed if an internal floating point representation
- * were used. Note that if you're looking for U.S. letter sized media in metric
- * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
- * to an integral 216 x 279 mm will not match.
- * <P>
- * The exported constant {@link #INCH INCH} is actually the
- * conversion factor by which to multiply a value in inches to get the value in
- * µm. Likewise, the exported constant {@link #MM MM} is the
- * conversion factor by which to multiply a value in mm to get the value in
- * µm. A client can specify a resolution value in units other than inches
- * or mm by supplying its own conversion factor. However, since the internal
- * units of µm was chosen with supporting only the external units of inch
- * and mm in mind, there is no guarantee that the conversion factor for the
- * client's units will be an exact integer. If the conversion factor isn't an
- * exact integer, resolution values in the client's units won't be stored
- * precisely.
+ * stored as 215900 µm. For example, a lookup service can match resolution
+ * attributes based on equality of their serialized representations regardless
+ * of the units in which they were created. Using integers for internal storage
+ * allows precise equality comparisons to be done, which would not be guaranteed
+ * if an internal floating point representation were used. Note that if you're
+ * looking for {@code U.S. letter} sized media in metric units, you have to
+ * search for a media size of 215.9 x 279.4 mm; rounding off to an integral
+ * 216 x 279 mm will not match.
+ * <p>
+ * The exported constant {@link #INCH INCH} is actually the conversion factor by
+ * which to multiply a value in inches to get the value in µm. Likewise,
+ * the exported constant {@link #MM MM} is the conversion factor by which to
+ * multiply a value in mm to get the value in µm. A client can specify a
+ * resolution value in units other than inches or mm by supplying its own
+ * conversion factor. However, since the internal units of µm was chosen
+ * with supporting only the external units of inch and mm in mind, there is no
+ * guarantee that the conversion factor for the client's units will be an exact
+ * integer. If the conversion factor isn't an exact integer, resolution values
+ * in the client's units won't be stored precisely.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class Size2DSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5584439964938660530L;
/**
- * X dimension in units of micrometers (µm).
+ * {@code X} dimension in units of micrometers (µm).
+ *
* @serial
*/
private int x;
/**
- * Y dimension in units of micrometers (µm).
+ * {@code Y} dimension in units of micrometers (µm).
+ *
* @serial
*/
private int y;
@@ -108,20 +111,16 @@
*/
public static final int MM = 1000;
-
/**
* Construct a new two-dimensional size attribute from the given
* floating-point values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1}
*/
protected Size2DSyntax(float x, float y, int units) {
if (x < 0.0f) {
@@ -141,15 +140,12 @@
* Construct a new two-dimensional size attribute from the given integer
* values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0}
- * or {@code units < 1}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1}
*/
protected Size2DSyntax(int x, int y, int units) {
if (x < 0) {
@@ -169,16 +165,11 @@
* Convert a value from micrometers to some other units. The result is
* returned as a floating-point number.
*
- * @param x
- * Value (micrometers) to convert.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return The value of {@code x} converted to the desired units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units} < 1.
+ * @param x value (micrometers) to convert
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return the value of {@code x} converted to the desired units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
private static float convertFromMicrometers(int x, int units) {
if (units < 1) {
@@ -191,46 +182,37 @@
* Get this two-dimensional size attribute's dimensions in the given units
* as floating-point values.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return A two-element array with the X dimension at index 0 and the Y
- * dimension at index 1.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return a two-element array with the {@code X} dimension at index 0 and
+ * the {@code Y} dimension at index 1
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float[] getSize(int units) {
return new float[] {getX(units), getY(units)};
}
/**
- * Returns this two-dimensional size attribute's X dimension in the given
- * units as a floating-point value.
+ * Returns this two-dimensional size attribute's {@code X} dimension in the
+ * given units as a floating-point value.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return X dimension.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code X} dimension
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float getX(int units) {
return convertFromMicrometers(x, units);
}
/**
- * Returns this two-dimensional size attribute's Y dimension in the given
- * units as a floating-point value.
+ * Returns this two-dimensional size attribute's {@code Y} dimension in the
+ * given units as a floating-point value.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return Y dimension.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code Y} dimension
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float getY(int units) {
return convertFromMicrometers(y, units);
@@ -238,22 +220,17 @@
/**
* Returns a string version of this two-dimensional size attribute in the
- * given units. The string takes the form <code>"<I>X</I>x<I>Y</I>
- * <I>U</I>"</code>, where <I>X</I> is the X dimension, <I>Y</I> is the Y
- * dimension, and <I>U</I> is the units name. The values are displayed in
- * floating point.
- *
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
+ * given units. The string takes the form <code>"<i>X</i>x<i>Y</i>
+ * <i>U</i>"</code>, where <i>X</i> is the {@code X} dimension, <i>Y</i> is
+ * the {@code Y} dimension, and <i>U</i> is the units name. The values are
+ * displayed in floating point.
*
- * @param unitsName
- * Units name string, e.g. {@code in} or {@code mm}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this two-dimensional size attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @param unitsName units name string, e.g. {@code in} or {@code mm}. If
+ * {@code null}, no units name is appended to the result
+ * @return {@code String} version of this two-dimensional size attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
StringBuilder result = new StringBuilder();
@@ -271,23 +248,18 @@
* Returns whether this two-dimensional size attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class Size2DSyntax.
- * <LI>
- * This attribute's X dimension is equal to {@code object}'s X
- * dimension.
- * <LI>
- * This attribute's Y dimension is equal to {@code object}'s Y
- * dimension.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code Size2DSyntax}
+ * <li>This attribute's {@code X} dimension is equal to {@code object}'s
+ * {@code X} dimension.
+ * <li>This attribute's {@code Y} dimension is equal to {@code object}'s
+ * {@code Y} dimension.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this
- * two-dimensional size attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * two-dimensional size attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -306,9 +278,9 @@
/**
* Returns a string version of this two-dimensional size attribute. The
- * string takes the form <code>"<I>X</I>x<I>Y</I> um"</code>, where
- * <I>X</I> is the X dimension and <I>Y</I> is the Y dimension.
- * The values are reported in the internal units of micrometers.
+ * string takes the form <code>"<i>X</i>x<i>Y</i> um"</code>, where <i>X</i>
+ * is the {@code X} dimension and <i>Y</i> is the {@code Y} dimension. The
+ * values are reported in the internal units of micrometers.
*/
public String toString() {
StringBuilder result = new StringBuilder();
@@ -320,23 +292,22 @@
}
/**
- * Returns this two-dimensional size attribute's X dimension in units of
- * micrometers (µm). (For use in a subclass.)
+ * Returns this two-dimensional size attribute's {@code X} dimension in
+ * units of micrometers (µm). (For use in a subclass.)
*
- * @return X dimension (µm).
+ * @return {@code X} dimension (µm)
*/
protected int getXMicrometers(){
return x;
}
/**
- * Returns this two-dimensional size attribute's Y dimension in units of
- * micrometers (µm). (For use in a subclass.)
+ * Returns this two-dimensional size attribute's {@code Y} dimension in
+ * units of micrometers (µm). (For use in a subclass.)
*
- * @return Y dimension (µm).
+ * @return {@code Y} dimension (µm)
*/
protected int getYMicrometers() {
return y;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SupportedValuesAttribute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SupportedValuesAttribute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,21 +23,20 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface SupportedValuesAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute describes the supported
- * values for another attribute. For example, if a Print Service instance
- * supports the {@link javax.print.attribute.standard.Copies Copies}
- * attribute, the Print Service instance will have a {@link
- * javax.print.attribute.standard.CopiesSupported CopiesSupported} attribute,
- * which is a SupportedValuesAttribute giving the legal values a client may
- * specify for the {@link javax.print.attribute.standard.Copies Copies}
- * attribute.
+ * Interface {@code SupportedValuesAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute describes the
+ * supported values for another attribute. For example, if a Print Service
+ * instance supports the {@link javax.print.attribute.standard.Copies Copies}
+ * attribute, the Print Service instance will have a
+ * {@link javax.print.attribute.standard.CopiesSupported CopiesSupported}
+ * attribute, which is a {@code SupportedValuesAttribute} giving the legal
+ * values a client may specify for the
+ * {@link javax.print.attribute.standard.Copies Copies} attribute.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface SupportedValuesAttribute extends Attribute {
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,48 +23,50 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.util.Locale;
/**
- * Class TextSyntax is an abstract base class providing the common
+ * Class {@code TextSyntax} is an abstract base class providing the common
* implementation of all attributes whose value is a string. The text attribute
* includes a locale to indicate the natural language. Thus, a text attribute
* always represents a localized string. Once constructed, a text attribute's
* value is immutable.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class TextSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8130648736378144102L;
/**
* String value of this text attribute.
+ *
* @serial
*/
private String value;
/**
* Locale of this text attribute.
+ *
* @serial
*/
private Locale locale;
/**
- * Constructs a TextAttribute with the specified string and locale.
+ * Constructs a {@code TextAttribute} with the specified string and locale.
*
- * @param value Text string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale for as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code value} is null.
+ * @param value text string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale for as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code value} is {@code null}
*/
protected TextSyntax(String value, Locale locale) {
this.value = verify (value);
@@ -87,7 +89,8 @@
/**
* Returns this text attribute's text string.
- * @return the text string.
+ *
+ * @return the text string
*/
public String getValue() {
return value;
@@ -95,6 +98,7 @@
/**
* Returns this text attribute's text string's natural language (locale).
+ *
* @return the locale
*/
public Locale getLocale() {
@@ -104,7 +108,7 @@
/**
* Returns a hashcode for this text attribute.
*
- * @return A hashcode value for this object.
+ * @return a hashcode value for this object
*/
public int hashCode() {
return value.hashCode() ^ locale.hashCode();
@@ -113,23 +117,17 @@
/**
* Returns whether this text attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class TextSyntax.
- * <LI>
- * This text attribute's underlying string and {@code object}'s
- * underlying string are equal.
- * <LI>
- * This text attribute's locale and {@code object}'s locale are
- * equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code TextSyntax}.
+ * <li>This text attribute's underlying string and {@code object}'s
+ * underlying string are equal.
+ * <li>This text attribute's locale and {@code object}'s locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this text
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this text
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -139,13 +137,12 @@
}
/**
- * Returns a String identifying this text attribute. The String is
- * the attribute's underlying text string.
+ * Returns a {@code String} identifying this text attribute. The
+ * {@code String} is the attribute's underlying text string.
*
- * @return A String identifying this object.
+ * @return a {@code String} identifying this object
*/
public String toString(){
return value;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,36 +23,37 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.net.URI;
/**
- * Class URISyntax is an abstract base class providing the common
- * implementation of all attributes whose value is a Uniform Resource
- * Identifier (URI). Once constructed, a URI attribute's value is immutable.
+ * Class {@code URISyntax} is an abstract base class providing the common
+ * implementation of all attributes whose value is a Uniform Resource Identifier
+ * (URI). Once constructed, a {@code URI} attribute's value is immutable.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class URISyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7842661210486401678L;
/**
- * URI value of this URI attribute.
+ * {@code URI} value of this {@code URI} attribute.
+ *
* @serial
*/
private URI uri;
/**
- * Constructs a URI attribute with the specified URI.
+ * Constructs a {@code URI} attribute with the specified {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri the {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
protected URISyntax(URI uri) {
this.uri = verify (uri);
@@ -66,40 +67,36 @@
}
/**
- * Returns this URI attribute's URI value.
- * @return the URI.
+ * Returns this {@code URI} attribute's {@code URI} value.
+ *
+ * @return the {@code URI}
*/
public URI getURI() {
return uri;
}
/**
- * Returns a hashcode for this URI attribute.
+ * Returns a hashcode for this {@code URI} attribute.
*
- * @return A hashcode value for this object.
+ * @return a hashcode value for this object
*/
public int hashCode() {
return uri.hashCode();
}
/**
- * Returns whether this URI attribute is equivalent to the passed in
- * object.
- * To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class URISyntax.
- * <LI>
- * This URI attribute's underlying URI and {@code object}'s
- * underlying URI are equal.
- * </OL>
+ * Returns whether this {@code URI} attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code URISyntax}.
+ * <li>This {@code URI} attribute's underlying {@code URI} and
+ * {@code object}'s underlying {@code URI} are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this URI
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this {@code URI}
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -108,13 +105,13 @@
}
/**
- * Returns a String identifying this URI attribute. The String is the
- * string representation of the attribute's underlying URI.
+ * Returns a {@code String} identifying this {@code URI} attribute. The
+ * {@code String} is the string representation of the attribute's underlying
+ * {@code URI}.
*
- * @return A String identifying this object.
+ * @return a {@code String} identifying this object
*/
public String toString() {
return uri.toString();
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/UnmodifiableSetException.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/UnmodifiableSetException.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,26 +26,31 @@
package javax.print.attribute;
/**
- * Thrown to indicate that the requested operation cannot be performed
- * because the set is unmodifiable.
+ * Thrown to indicate that the requested operation cannot be performed because
+ * the set is unmodifiable.
*
- * @author Phil Race
- * @since 1.4
+ * @author Phil Race
+ * @since 1.4
*/
public class UnmodifiableSetException extends RuntimeException {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2255250308571511731L;
/**
- * Constructs an UnsupportedOperationException with no detail message.
+ * Constructs an {@code UnsupportedOperationException} with no detail
+ * message.
*/
public UnmodifiableSetException() {
}
/**
- * Constructs an UnmodifiableSetException with the specified
- * detail message.
+ * Constructs an {@code UnmodifiableSetException} with the specified detail
+ * message.
*
- * @param message the detail message
+ * @param message the detail message
*/
public UnmodifiableSetException(String message) {
super(message);
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java Thu Aug 31 15:47:34 2017 -0700
@@ -39,19 +39,20 @@
* The print data and the processing instructions are separate entities. This
* means that:
* <ul>
- * <li>You can print the same print data at different times using different
- * processing instructions.<br>For example, you can print a slide
- * presentation on US letter-sized white paper, double-sided, stapled, 20
- * copies to make handouts for a talk; and you could print the same slide
- * presentation on US letter-sized transparencies, single-sided, one copy to
- * make the actual slides for the talk.</li>
- * <li>You can use the same processing instructions at different times to
- * print different data. For example, you could set your default processing
- * instructions to: US letter-sized paper, double sided, stapled. Whenever
- * you print a job, it prints with these settings, unless you explicitly
- * override them.</li>
+ * <li>You can print the same print data at different times using different
+ * processing instructions.
+ * <br>
+ * For example, you can print a slide presentation on US letter-sized white
+ * paper, double-sided, stapled, 20 copies to make handouts for a talk; and
+ * you could print the same slide presentation on US letter-sized
+ * transparencies, single-sided, one copy to make the actual slides for the
+ * talk.
+ * <li>You can use the same processing instructions at different times to
+ * print different data. For example, you could set your default processing
+ * instructions to: US letter-sized paper, double sided, stapled. Whenever you
+ * print a job, it prints with these settings, unless you explicitly override
+ * them.
* </ul>
- * <p>
* The processing instruction does not specify how the print job processes the
* request; each processing instruction is only a description of the results of
* a print job. The print job determines the manner in which it achieves the
@@ -97,18 +98,18 @@
* The Java Print Service API defines these different kinds of attributes with
* five subinterfaces of {@code Attribute}:
* <ul>
- * <li><a href="DocAttribute.html">DocAttribute</a> specifies a
- * characteristic of an individual document and the print job settings to be
- * applied to an individual document.</li>
- * <li><a href="PrintRequestAttribute.html">PrintRequestAttribute</a>
- * specifies a setting applied to a whole print job and to all the documents
- * in the print job.</li>
- * <li><a href="PrintJobAttribute.html">PrintJobAttribute</a> reports the
- * status of a print job.</li>
- * <li><a href="PrintServiceAttribute.html">PrintServiceAttribute</a>
- * reports the status of a print service.</li>
- * <li><a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a>
- * gives the supported values for another attribute.</li>
+ * <li><a href="DocAttribute.html">DocAttribute</a> specifies a characteristic
+ * of an individual document and the print job settings to be applied to an
+ * individual document.
+ * <li><a href="PrintRequestAttribute.html">PrintRequestAttribute</a>
+ * specifies a setting applied to a whole print job and to all the documents
+ * in the print job.
+ * <li><a href="PrintJobAttribute.html">PrintJobAttribute</a> reports the
+ * status of a print job.
+ * <li><a href="PrintServiceAttribute.html">PrintServiceAttribute</a> reports
+ * the status of a print service.
+ * <li><a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a>
+ * gives the supported values for another attribute.
* </ul>
* Each attribute class implements one or more of these tagging subinterfaces to
* indicate where the attribute can be used in the API. If an attribute class
@@ -123,40 +124,39 @@
* The Java Print Service API defines a group of standard attribute classes
* modeled upon the attributes in the Internet Printing Protocol (IPP) version
* 1.1. The standard attribute classes are in the subpackage
- * javax.print.attribute.standard to keep the actual attribute classes
+ * {@code javax.print.attribute.standard} to keep the actual attribute classes
* conceptually separate from the generic apparatus defined in package
- * javax.print.attribute.
+ * {@code javax.print.attribute}.
*
* <h3>Attribute Sets</h3>
* A client usually needs to provide more than one processing instruction when
- * submitting a print job. For example, the client might need to specify a
- * media size of A4 and a landscape orientation. To send more than one
- * processing instruction, the client collects the attributes into an attribute
- * set, which the Java Print Service API represents with the
+ * submitting a print job. For example, the client might need to specify a media
+ * size of A4 and a landscape orientation. To send more than one processing
+ * instruction, the client collects the attributes into an attribute set, which
+ * the Java Print Service API represents with the
* <a href="AttributeSet.html">AttributeSet</a> interface.
* <p>
* The {@code AttributeSet} interface is similar to the
* <a href="../../../java/util/Map.html">Map</a> interface: it provides a map of
* key to values, in which each key is unique and can contain no more than one
* value. However, the {@code AttributeSet} interface is designed to
- * specifically support the needs of the Java Print Service API. An {@code
- * AttributeSet} requires that:
+ * specifically support the needs of the Java Print Service API. An
+ * {@code AttributeSet} requires that:
* <ol type=1>
- * <li>Each key in an {@code AttributeSet} corresponds to a category, and
- * the value of the key can only be one of the attribute values that belong
- * to the category represented by the key. Thus, unlike a {@code Map}, an
- * {@code AttributeSet} restricts the possible values of a key: an attribute
- * category cannot be set to an attribute value that does not belong to that
- * category.</li>
- * <li>No two attributes from the same category can exist in the same set.
- * For example, an attribute collection must not contain both a "one-sided"
- * attribute and a "two-sided" attribute because these two attributes give
- * the printer conflicting instructions.</li>
- * <li>Only attributes implementing the {@code Attribute} interface can be
- * added to the set.</li>
+ * <li>Each key in an {@code AttributeSet} corresponds to a category, and the
+ * value of the key can only be one of the attribute values that belong to the
+ * category represented by the key. Thus, unlike a {@code Map}, an
+ * {@code AttributeSet} restricts the possible values of a key: an attribute
+ * category cannot be set to an attribute value that does not belong to that
+ * category.
+ * <li>No two attributes from the same category can exist in the same set. For
+ * example, an attribute collection must not contain both a "one-sided"
+ * attribute and a "two-sided" attribute because these two attributes give the
+ * printer conflicting instructions.
+ * <li>Only attributes implementing the {@code Attribute} interface can be
+ * added to the set.
* </ol>
- * <p>
- * The javax.print.attribute package includes
+ * The {@code javax.print.attribute} package includes
* <a href="HashAttributeSet.html">HashAttributeSet</a> as a concrete
* implementation of the attribute set interface. {@code HashAttributeSet}
* provides an attribute set based on a hash map. You can use this
@@ -167,18 +167,15 @@
* that are restricted to contain just one of the four kinds of attributes, as
* discussed in the <a href="#role">Attribute Roles</a> section:
* <ul>
- * <li><a href="DocAttributeSet.html">DocAttributeSet</a></li>
- * <li><a href="PrintRequestAttributeSet.html">
- * PrintRequestAttributeSet</a></li>
- * <li><a href="PrintJobAttributeSet.html">
- * PrintJobAttributeSet</a></li>
- * <li><a href="PrintServiceAttributeSet.html">
- * PrintServiceAttributeSet</a></li>
+ * <li><a href="DocAttributeSet.html">DocAttributeSet</a>
+ * <li><a href="PrintRequestAttributeSet.html">PrintRequestAttributeSet</a>
+ * <li><a href="PrintJobAttributeSet.html"> PrintJobAttributeSet</a>
+ * <li><a href="PrintServiceAttributeSet.html">PrintServiceAttributeSet</a>
* </ul>
* Notice that only four kinds of attribute sets are listed here, but there are
* five kinds of attributes. Interface
- * <a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a>
- * denotes an attribute that gives the supported values for another attribute.
+ * <a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a> denotes
+ * an attribute that gives the supported values for another attribute.
* Supported-values attributes are never aggregated into attribute sets, so
* there is no attribute set subinterface defined for them.
* <p>
@@ -189,17 +186,15 @@
* For a read-only attribute set, calling a mutating operation throws an
* {@code UnmodifiableSetException}.
* <p>
- * Package javax.print.attribute includes one concrete implementation of each of
- * the attribute set subinterfaces:
+ * Package {@code javax.print.attribute} includes one concrete implementation of
+ * each of the attribute set subinterfaces:
* <ul>
- * <li><a href="HashDocAttributeSet.html">
- * HashDocAttributeSet</a></li>
- * <li><a href="HashPrintRequestAttributeSet.html">
- * HashPrintRequestAttributeSet</a>,</li>
- * <li><a href="HashPrintJobAttributeSet.html">
- * HashPrintJobAttributeSet</a>,</li>
- * <li><a href="HashPrintServiceAttributeSet.html">
- * HashPrintServiceAttributeSet</a>.</li>
+ * <li><a href="HashDocAttributeSet.html"> HashDocAttributeSet</a>
+ * <li><a href="HashPrintRequestAttributeSet.html">
+ * HashPrintRequestAttributeSet</a>,
+ * <li><a href="HashPrintJobAttributeSet.html">HashPrintJobAttributeSet</a>,
+ * <li><a href="HashPrintServiceAttributeSet.html">
+ * HashPrintServiceAttributeSet</a>.
* </ul>
* All of these classes extend
* <a href="HashAttributeSet.html">HashAttributeSet</a> and enforce the
@@ -211,12 +206,11 @@
* enumerated value. The Java Print Service API does not use primitive data
* types, such as int, to represent attribute values for these reasons:
* <ul>
- * <li>Primitive data types are not type-safe. For example, a compiler
- * should not allow a "copies" attribute value to be used for a "sides"
- * attribute.</li>
- * <li>Some attributes must be represented as a record of several values.
- * One example is printer resolution, which requires two numbers, such as
- * 600 and 300 representing 600 x 300 dpi.</li>
+ * <li>Primitive data types are not type-safe. For example, a compiler should
+ * not allow a "copies" attribute value to be used for a "sides" attribute.
+ * <li>Some attributes must be represented as a record of several values. One
+ * example is printer resolution, which requires two numbers, such as 600 and
+ * 300 representing 600 x 300 dpi.
* </ul>
* For type-safety and to represent all attributes uniformly, the Java Print
* Service API defines each attribute category as a class, such as class
@@ -240,27 +234,27 @@
* represent each abstract syntax, and these classes are used as the parent of
* standard attributes whenever possible. The abstract syntax classes are:
* <ul>
- * <li><a href="EnumSyntax.html">EnumSyntax</a> provides a type-safe
- * enumeration in which enumerated values are represented as singleton
- * objects. Each enumeration singleton is an instance of the enumeration
- * class that wraps a hidden int value.</li>
- * <li><a href="IntegerSyntax.html">IntegerSyntax</a> is the abstract syntax
- * for integer-valued attributes.</li>
- * <li><a href="TextSyntax.html">TextSyntax</a> is the abstract syntax for
- * text-valued attributes, and includes a locale giving the text string's
- * natural language.</li>
- * <li><a href="SetOfIntegerSyntax.html">SetOfIntegerSyntax</a> is the
- * abstract syntax for attributes representing a range or set of integers
- * <li><a href="ResolutionSyntax.html">ResolutionSyntax</a> is the abstract
- * syntax for attributes representing resolution values, such as 600x300
- * dpi.</li>
- * <li><a href="Size2DSyntax.html">Size2DSyntax</a> is the abstract syntax
- * for attributes representing a two-dimensional size, such as a paper size
- * of 8.5 x 11 inches.</li>
- * <li><a href="DateTimeSyntax.html">DateTimeSyntax</a> is the abstract
- * syntax for attributes whose value is a date and time.</li>
- * <li><a href="URISyntax.html">URISyntax</a> is the abstract syntax for
- * attributes whose value is a Uniform Resource Indicator.</li>
+ * <li><a href="EnumSyntax.html">EnumSyntax</a> provides a type-safe
+ * enumeration in which enumerated values are represented as singleton
+ * objects. Each enumeration singleton is an instance of the enumeration class
+ * that wraps a hidden int value.
+ * <li><a href="IntegerSyntax.html">IntegerSyntax</a> is the abstract syntax
+ * for integer-valued attributes.
+ * <li><a href="TextSyntax.html">TextSyntax</a> is the abstract syntax for
+ * text-valued attributes, and includes a locale giving the text string's
+ * natural language.
+ * <li><a href="SetOfIntegerSyntax.html">SetOfIntegerSyntax</a> is the
+ * abstract syntax for attributes representing a range or set of integers
+ * <li><a href="ResolutionSyntax.html">ResolutionSyntax</a> is the abstract
+ * syntax for attributes representing resolution values, such as 600x300
+ * dpi.
+ * <li><a href="Size2DSyntax.html">Size2DSyntax</a> is the abstract syntax for
+ * attributes representing a two-dimensional size, such as a paper size of
+ * 8.5 x 11 inches.
+ * <li><a href="DateTimeSyntax.html">DateTimeSyntax</a> is the abstract syntax
+ * for attributes whose value is a date and time.
+ * <li><a href="URISyntax.html">URISyntax</a> is the abstract syntax for
+ * attributes whose value is a Uniform Resource Indicator.
* </ul>
* The abstract syntax classes are independent of the attributes that use them.
* In fact, applications that have nothing to do with printing can use the
@@ -304,12 +298,10 @@
* <h3>Attribute Vendors</h3>
* The Java Print Service API is designed so that vendors can:
* <ul>
- * <li>define new vendor-specific values for any standard attribute defined
- * in <a href="standard/package-summary.html">javax.print.attribute.standard
- * </a>.</li>
- * <li>define new attribute categories representing the vendor printer's
- * proprietary capabilities not already supported by the standard
- * attributes.</li>
+ * <li>define new vendor-specific values for any standard attribute defined in
+ * <a href="standard/package-summary.html">javax.print.attribute.standard</a>.
+ * <li>define new attribute categories representing the vendor printer's
+ * proprietary capabilities not already supported by the standard attributes.
* </ul>
* To define a new value for an attribute, a client can construct instances of
* such attributes with arbitrary values at runtime. However, an enumerated
@@ -364,12 +356,12 @@
* }</pre>
* </blockquote>
* <p>
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Thu Aug 31 15:47:34 2017 -0700
@@ -22,75 +22,57 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Chromaticity is a printing attribute class, an enumeration, that
- * specifies monochrome or color printing. This is used by a print client
+ * Class {@code Chromaticity} is a printing attribute class, an enumeration,
+ * that specifies monochrome or color printing. This is used by a print client
* to specify how the print data should be generated or processed. It is not
* descriptive of the color capabilities of the device. Query the service's
* {@link ColorSupported ColorSupported} attribute to determine if the device
* can be verified to support color printing.
- * <P>
+ * <p>
* The table below shows the effects of specifying a Chromaticity attribute of
- * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
- * for a monochrome or color document.
- *
+ * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR} for a monochrome or
+ * color document.
* <table class="striped">
- * <caption>Shows effects of specifying MONOCHROME or COLOR Chromaticity
- * attributes</caption>
+ * <caption>Shows effects of specifying {@code MONOCHROME} or {@code COLOR}
+ * Chromaticity attributes</caption>
* <thead>
- * <TR>
- * <TH>
- * Chromaticity<BR>Attribute
- * </TH>
- * <TH>
- * Effect on<BR>Monochrome Document
- * </TH>
- * <TH>
- * Effect on<BR>Color Document
- * </TH>
- * </TR>
+ * <tr>
+ * <th>Chromaticity<br>Attribute
+ * <th>Effect on<br>Monochrome Document
+ * <th>Effect on<br>Color Document
* </thead>
* <tbody>
- * <TR>
- * <TD>
- * {@link #MONOCHROME MONOCHROME}
- * </TD>
- * <TD>
- * Printed as is, in monochrome
- * </TD>
- * <TD>
- * Printed in monochrome, with colors converted to shades of gray
- * </TD>
- * </TR>
- * <TR>
- * <TD>
- * {@link #COLOR COLOR}
- * </TD>
- * <TD>
- * Printed as is, in monochrome
- * </TD>
- * <TD>
- * Printed as is, in color
- * </TD>
- * </TR>
+ * <tr>
+ * <td>{@link #MONOCHROME MONOCHROME}
+ * <td>Printed as is, in monochrome
+ * <td>Printed in monochrome, with colors converted to shades of gray
+ * <tr>
+ * <td>{@link #COLOR COLOR}
+ * <td>Printed as is, in monochrome
+ * <td>Printed as is, in color
* </tbody>
- * </TABLE>
- * <P>
- * <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
+ * </table>
+ * <p>
+ * <b>IPP Compatibility:</b> Chromaticity is not an IPP attribute at present.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class Chromaticity extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4660543931355214012L;
/**
@@ -103,32 +85,37 @@
*/
public static final Chromaticity COLOR = new Chromaticity(1);
-
/**
* Construct a new chromaticity enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Chromaticity(int value) {
super(value);
}
+ /**
+ * The string table for class {@code Chromaticity}.
+ */
private static final String[] myStringTable = {"monochrome",
"color"};
+ /**
+ * The enumeration value table for class {@code Chromaticity}.
+ */
private static final Chromaticity[] myEnumValueTable = {MONOCHROME,
COLOR};
/**
- * Returns the string table for class Chromaticity.
+ * Returns the string table for class {@code Chromaticity}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Chromaticity.
+ * Returns the enumeration value table for class {@code Chromaticity}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -137,11 +124,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Chromaticity, the category is the class Chromaticity itself.
+ * <p>
+ * For class {@code Chromaticity}, the category is the class
+ * {@code Chromaticity} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Chromaticity.class;
@@ -150,13 +138,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Chromaticity, the category name is {@code "chromaticity"}.
+ * <p>
+ * For class {@code Chromaticity}, the category name is
+ * {@code "chromaticity"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
- public final String getName() {
- return "chromaticity";
- }
-
- }
+ public final String getName() {
+ return "chromaticity";
+ }
+}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,35 +30,39 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class ColorSupported is a printing attribute class, an enumeration, that
- * identifies whether the device is capable of any type of color printing at
- * all, including highlight color as well as full process color. All document
+ * Class {@code ColorSupported} is a printing attribute class, an enumeration,
+ * that identifies whether the device is capable of any type of color printing
+ * at all, including highlight color as well as full process color. All document
* instructions having to do with color are embedded within the print data (none
* are attributes attached to the job outside the print data).
- * <P>
+ * <p>
* Note: End users are able to determine the nature and details of the color
- * support by querying the {@link PrinterMoreInfoManufacturer
- * PrinterMoreInfoManufacturer} attribute.
- * <P>
- * Don't confuse the ColorSupported attribute with the {@link Chromaticity
- * Chromaticity} attribute. {@link Chromaticity Chromaticity} is an attribute
- * the client can specify for a job to tell the printer whether to print a
- * document in monochrome or color, possibly causing the printer to print a
- * color document in monochrome. ColorSupported is a printer description
- * attribute that tells whether the printer can print in color regardless of how
- * the client specifies to print any particular document.
- * <P>
- * <B>IPP Compatibility:</B> The IPP boolean value is "true" for SUPPORTED and
- * "false" for NOT_SUPPORTED. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * support by querying the
+ * {@link PrinterMoreInfoManufacturer PrinterMoreInfoManufacturer} attribute.
+ * <p>
+ * Don't confuse the {@code ColorSupported} attribute with the
+ * {@link Chromaticity Chromaticity} attribute.
+ * {@link Chromaticity Chromaticity} is an attribute the client can specify for
+ * a job to tell the printer whether to print a document in monochrome or color,
+ * possibly causing the printer to print a color document in monochrome.
+ * {@code ColorSupported} is a printer description attribute that tells whether
+ * the printer can print in color regardless of how the client specifies to
+ * print any particular document.
+ * <p>
+ * <b>IPP Compatibility:</b> The IPP boolean value is "true" for SUPPORTED and
+ * "false" for NOT_SUPPORTED. The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class ColorSupported extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2700555589688535545L;
/**
@@ -66,36 +71,42 @@
public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0);
/**
- * The printer is capable of some type of color printing, such as
- * highlight color or full process color.
+ * The printer is capable of some type of color printing, such as highlight
+ * color or full process color.
*/
public static final ColorSupported SUPPORTED = new ColorSupported(1);
/**
- * Construct a new color supported enumeration value with the given
- * integer value.
+ * Construct a new color supported enumeration value with the given integer
+ * value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected ColorSupported(int value) {
super (value);
}
+ /**
+ * The string table for class {@code ColorSupported}.
+ */
private static final String[] myStringTable = {"not-supported",
"supported"};
+ /**
+ * The enumeration value table for class {@code ColorSupported}.
+ */
private static final ColorSupported[] myEnumValueTable = {NOT_SUPPORTED,
SUPPORTED};
/**
- * Returns the string table for class ColorSupported.
+ * Returns the string table for class {@code ColorSupported}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class ColorSupported.
+ * Returns the enumeration value table for class {@code ColorSupported}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -104,11 +115,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class ColorSupported, the category is class ColorSupported itself.
+ * <p>
+ * For class {@code ColorSupported}, the category is class
+ * {@code ColorSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return ColorSupported.class;
@@ -117,13 +129,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class ColorSupported, the category name is {@code "color-supported"}.
+ * <p>
+ * For class {@code ColorSupported}, the category name is
+ * {@code "color-supported"}
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "color-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,29 +22,33 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
/**
- * Class Compression is a printing attribute class, an enumeration, that
- * specifies how print data is compressed. Compression is an attribute of the
- * print data (the doc), not of the Print Job. If a Compression attribute is not
- * specified for a doc, the printer assumes the doc's print data is uncompressed
- * (i.e., the default Compression value is always {@link #NONE
- * NONE}).
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code Compression} is a printing attribute class, an enumeration, that
+ * specifies how print data is compressed. {@code Compression} is an attribute
+ * of the print data (the doc), not of the Print Job. If a {@code Compression}
+ * attribute is not specified for a doc, the printer assumes the doc's print
+ * data is uncompressed (i.e., the default Compression value is always
+ * {@link #NONE NONE}).
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class Compression extends EnumSyntax implements DocAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -5716748913324997674L;
/**
@@ -59,7 +63,7 @@
/**
* GNU zip compression technology described in
- * <A HREF="http://www.ietf.org/rfc/rfc1952.txt">RFC 1952</A>.
+ * <a href="http://www.ietf.org/rfc/rfc1952.txt">RFC 1952</a>.
*/
public static final Compression GZIP = new Compression(2);
@@ -72,32 +76,37 @@
* Construct a new compression enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Compression(int value) {
super(value);
}
-
+ /**
+ * The string table for class {@code Compression}.
+ */
private static final String[] myStringTable = {"none",
"deflate",
"gzip",
"compress"};
+ /**
+ * The enumeration value table for class {@code Compression}.
+ */
private static final Compression[] myEnumValueTable = {NONE,
DEFLATE,
GZIP,
COMPRESS};
/**
- * Returns the string table for class Compression.
+ * Returns the string table for class {@code Compression}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class Compression.
+ * Returns the enumeration value table for class {@code Compression}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -106,12 +115,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Compression and any vendor-defined subclasses, the category is
- * class Compression itself.
+ * <p>
+ * For class {@code Compression} and any vendor-defined subclasses, the
+ * category is class {@code Compression} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Compression.class;
@@ -120,14 +129,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Compression and any vendor-defined subclasses, the category
- * name is {@code "compression"}.
+ * <p>
+ * For class {@code Compression} and any vendor-defined subclasses, the
+ * category name is {@code "compression"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "compression";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,64 +22,60 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Copies is an integer valued printing attribute class that specifies the
- * number of copies to be printed.
- * <P>
+ * Class {@code Copies} is an integer valued printing attribute class that
+ * specifies the number of copies to be printed.
+ * <p>
* On many devices the supported number of collated copies will be limited by
* the number of physical output bins on the device, and may be different from
* the number of uncollated copies which can be supported.
- * <P>
- * The effect of a Copies attribute with a value of <I>n</I> on a multidoc print
- * job (a job with multiple documents) depends on the (perhaps defaulted) value
- * of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output
- * document comprising all the input docs.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single
- * output document comprising all the input docs, and the first impression of
- * each input doc will always start on a new media sheet.
+ * <p>
+ * The effect of a {@code Copies} attribute with a value of <i>n</i> on a
+ * multidoc print job (a job with multiple documents) depends on the (perhaps
+ * defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- The result will be <i>n</i> copies of a
+ * single output document comprising all the input docs.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- The result will be <i>n</i> copies
+ * of a single output document comprising all the input docs, and the first
+ * impression of each input doc will always start on a new media sheet.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- The result will be
+ * <i>n</i> copies of the first input document, followed by <i>n</i> copies of
+ * the second input document, . . . followed by <i>n</i> copies of the last
+ * input document.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- The result will be the
+ * first input document, the second input document, . . . the last input
+ * document, the group of documents being repeated <i>n</i> times.
+ * </ul>
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of
- * the first input document, followed by <I>n</I> copies of the second input
- * document, . . . followed by <I>n</I> copies of the last input document.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input
- * document, the second input document, . . . the last input document, the group
- * of documents being repeated <I>n</I> times.
- * </UL>
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
- *
- * @author David Mendenhall
- * @author Alan Kamihensky
+ * @author David Mendenhall
+ * @author Alan Kamihensky
*/
public final class Copies extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6426631521680023833L;
/**
* Construct a new copies attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 1.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value < 1}
*/
public Copies(int value) {
super (value, 1, Integer.MAX_VALUE);
@@ -88,20 +84,15 @@
/**
* Returns whether this copies attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class Copies.
- * <LI>
- * This copies attribute's value and {@code object}'s value are
- * equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code Copies}.
+ * <li>This copies attribute's value and {@code object}'s value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this copies
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this copies
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof Copies;
@@ -110,11 +101,11 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Copies, the category is class Copies itself.
+ * <p>
+ * For class {@code Copies}, the category is class {@code Copies} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Copies.class;
@@ -123,13 +114,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Copies, the category name is {@code "copies"}.
+ * <p>
+ * For class {@code Copies}, the category name is {@code "copies"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "copies";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,33 +30,34 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class CopiesSupported is a printing attribute class, a set of integers, that
- * gives the supported values for a {@link Copies Copies} attribute. It is
- * restricted to a single contiguous range of integers; multiple non-overlapping
- * ranges are not allowed.
- * <P>
- * <B>IPP Compatibility:</B> The CopiesSupported attribute's canonical array
+ * Class {@code CopiesSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a {@link Copies Copies}
+ * attribute. It is restricted to a single contiguous range of integers;
+ * multiple non-overlapping ranges are not allowed.
+ * <p>
+ * <b>IPP Compatibility:</b> The CopiesSupported attribute's canonical array
* form gives the lower and upper bound for the range of copies to be included
- * in an IPP "copies-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * in an IPP "copies-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class CopiesSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6927711687034846001L;
/**
* Construct a new copies supported attribute containing a single integer.
- * That is, only the one value of Copies is supported.
+ * That is, only the one value of {@code Copies} is supported.
*
- * @param member Set member.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than 1.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member < 1}
*/
public CopiesSupported(int member) {
super (member);
@@ -66,16 +68,14 @@
/**
* Construct a new copies supported attribute containing a single range of
- * integers. That is, only those values of Copies in the one range are
- * supported.
+ * integers. That is, only those values of {@code Copies} in the one range
+ * are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 1.
+ * @param lowerBound Lower bound of the range
+ * @param upperBound Upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than 1
*/
public CopiesSupported(int lowerBound, int upperBound) {
super(lowerBound, upperBound);
@@ -91,20 +91,16 @@
* Returns whether this copies supported attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class CopiesSupported.
- * <LI>
- * This copies supported attribute's members and {@code object}'s
- * members are the same.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code CopiesSupported}.
+ * <li>This copies supported attribute's members and {@code object}'s
+ * members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this copies
- * supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this copies
+ * supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof CopiesSupported;
@@ -113,12 +109,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class CopiesSupported, the category
- * is class CopiesSupported itself.
+ * <p>
+ * For class {@code CopiesSupported}, the category is class
+ * {@code CopiesSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return CopiesSupported.class;
@@ -127,14 +123,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class CopiesSupported, the category
- * name is {@code "copies-supported"}.
+ * <p>
+ * For class {@code CopiesSupported}, the category name is
+ * {@code "copies-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "copies-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,47 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import java.util.Calendar;
import java.util.Date;
+
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
- * Class DateTimeAtCompleted is a printing attribute class, a date-time
+ * Class {@code DateTimeAtCompleted} is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job completed
* (or was canceled or aborted).
- * <P>
- * To construct a DateTimeAtCompleted attribute from separate values of the
- * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
- * Calendar} object to construct a {@link java.util.Date Date} object, then use
- * the {@link java.util.Date Date} object to construct the DateTimeAtCompleted
- * attribute. To convert a DateTimeAtCompleted attribute to separate values of
- * the year, month, day, hour, minute, and so on, create a {@link
- * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
- * Date} from the DateTimeAtCompleted attribute.
- * <P>
- * <B>IPP Compatibility:</B> The information needed to construct an IPP
+ * <p>
+ * To construct a {@code DateTimeAtCompleted} attribute from separate values of
+ * the year, month, day, hour, minute, and so on, use a
+ * {@link Calendar Calendar} object to construct a {@link Date Date} object,
+ * then use the {@link Date Date} object to construct the DateTimeAtCompleted
+ * attribute. To convert a {@code DateTimeAtCompleted} attribute to separate
+ * values of the year, month, day, hour, minute, and so on, create a
+ * {@link Calendar Calendar} object and set it to the {@link Date Date} from the
+ * {@code DateTimeAtCompleted} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The information needed to construct an IPP
* "date-time-at-completed" attribute can be obtained as described above. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class DateTimeAtCompleted extends DateTimeSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6497399708058490000L;
/**
- * Construct a new date-time at completed attribute with the given {@link
- * java.util.Date Date} value.
+ * Construct a new date-time at completed attribute with the given
+ * {@link Date Date} value.
*
- * @param dateTime {@link java.util.Date Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code dateTime} is null.
+ * @param dateTime {@link Date Date} value
+ * @throws NullPointerException if {@code dateTime} is {@code null}
*/
public DateTimeAtCompleted(Date dateTime) {
super (dateTime);
@@ -72,38 +75,34 @@
* Returns whether this date-time at completed attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class DateTimeAtCompleted.
- * <LI>
- * This date-time at completed attribute's {@link java.util.Date Date} value
- * and {@code object}'s {@link java.util.Date Date} value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code DateTimeAtCompleted}.
+ * <li>This date-time at completed attribute's {@link Date Date}
+ * value and {@code object}'s {@link Date Date} value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this date-time
- * at completed attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this date-time at
+ * completed attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof DateTimeAtCompleted);
}
-// Exported operations inherited and implemented from interface Attribute.
+ // Exported operations inherited and implemented from interface Attribute.
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class DateTimeAtCompleted, the category is class
- * DateTimeAtCompleted itself.
- *
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
- */
+ * <p>
+ * For class {@code DateTimeAtCompleted}, the category is class
+ * {@code DateTimeAtCompleted} itself.
+ *
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
+ */
public final Class<? extends Attribute> getCategory() {
return DateTimeAtCompleted.class;
}
@@ -111,14 +110,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class DateTimeAtCompleted, the category name is
+ * <p>
+ * For class {@code DateTimeAtCompleted}, the category name is
* {@code "date-time-at-completed"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "date-time-at-completed";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,70 +22,69 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import java.util.Calendar;
import java.util.Date;
+
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
- * Class DateTimeAtCreation is a printing attribute class, a date-time
+ * Class {@code DateTimeAtCreation} is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job was
* created.
- * <P>
- * To construct a DateTimeAtCreation attribute from separate values of the year,
- * month, day, hour, minute, and so on, use a {@link java.util.Calendar
- * Calendar} object to construct a {@link java.util.Date Date} object, then use
- * the {@link java.util.Date Date} object to construct the DateTimeAtCreation
- * attribute. To convert a DateTimeAtCreation attribute to separate values of
- * the year, month, day, hour, minute, and so on, create a {@link
- * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
- * Date} from the DateTimeAtCreation attribute.
- * <P>
- * <B>IPP Compatibility:</B> The information needed to construct an IPP
+ * <p>
+ * To construct a {@code DateTimeAtCreation} attribute from separate values of
+ * the year, month, day, hour, minute, and so on, use a
+ * {@link Calendar Calendar} object to construct a {@link Date Date} object,
+ * then use the {@link Date Date} object to construct the DateTimeAtCreation
+ * attribute. To convert a {@code DateTimeAtCreation} attribute to separate
+ * values of the year, month, day, hour, minute, and so on, create a
+ * {@link Calendar Calendar} object and set it to the {@link Date Date} from the
+ * {@code DateTimeAtCreation} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The information needed to construct an IPP
* "date-time-at-creation" attribute can be obtained as described above. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class DateTimeAtCreation extends DateTimeSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2923732231056647903L;
/**
- * Construct a new date-time at creation attribute with the given {@link
- * java.util.Date Date} value.
+ * Construct a new date-time at creation attribute with the given
+ * {@link Date Date} value.
*
- * @param dateTime {@link java.util.Date Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code dateTime} is null.
+ * @param dateTime {@link Date Date} value
+ * @throws NullPointerException if {@code dateTime} is {@code null}
*/
public DateTimeAtCreation(Date dateTime) {
super (dateTime);
}
/**
- * Returns whether this date-time at creation attribute is equivalent to
- * the passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class DateTimeAtCreation.
- * <LI>
- * This date-time at creation attribute's {@link java.util.Date Date} value
- * and {@code object}'s {@link java.util.Date Date} value are equal.
- * </OL>
+ * Returns whether this date-time at creation attribute is equivalent to the
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code DateTimeAtCreation}.
+ * <li>This date-time at creation attribute's {@link Date Date}
+ * value and {@code object}'s {@link Date Date} value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this date-time
- * at creation attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this date-time at
+ * creation attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(super.equals (object) &&
@@ -95,12 +94,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class DateTimeAtCreation, the category is class
- * DateTimeAtCreation itself.
+ * <p>
+ * For class {@code DateTimeAtCreation}, the category is class
+ * {@code DateTimeAtCreation} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return DateTimeAtCreation.class;
@@ -109,14 +108,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class DateTimeAtCreation, the category name is
+ * <p>
+ * For class {@code DateTimeAtCreation}, the category name is
* {@code "date-time-at-creation"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "date-time-at-creation";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,47 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import java.util.Calendar;
import java.util.Date;
+
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
- * Class DateTimeAtProcessing is a printing attribute class, a date-time
+ * Class {@code DateTimeAtProcessing} is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job first
* began processing.
- * <P>
- * To construct a DateTimeAtProcessing attribute from separate values of the
- * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
- * Calendar} object to construct a {@link java.util.Date Date} object, then use
- * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
- * attribute. To convert a DateTimeAtProcessing attribute to separate values of
- * the year, month, day, hour, minute, and so on, create a {@link
- * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
- * Date} from the DateTimeAtProcessing attribute.
- * <P>
- * <B>IPP Compatibility:</B> The information needed to construct an IPP
+ * <p>
+ * To construct a {@code DateTimeAtProcessing} attribute from separate values of
+ * the year, month, day, hour, minute, and so on, use a
+ * {@link Calendar Calendar} object to construct a {@link Date Date} object,
+ * then use the {@link Date Date} object to construct the DateTimeAtProcessing
+ * attribute. To convert a {@code DateTimeAtProcessing} attribute to separate
+ * values of the year, month, day, hour, minute, and so on, create a
+ * {@link Calendar Calendar} object and set it to the {@link Date Date} from the
+ * {@code DateTimeAtProcessing} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The information needed to construct an IPP
* "date-time-at-processing" attribute can be obtained as described above. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class DateTimeAtProcessing extends DateTimeSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3710068197278263244L;
/**
- * Construct a new date-time at processing attribute with the given {@link
- * java.util.Date Date} value.
+ * Construct a new date-time at processing attribute with the given
+ * {@link Date Date} value.
*
- * @param dateTime {@link java.util.Date Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code dateTime} is null.
+ * @param dateTime {@link Date Date} value
+ * @throws NullPointerException if {@code dateTime} is {@code null}
*/
public DateTimeAtProcessing(Date dateTime) {
super (dateTime);
@@ -72,21 +75,17 @@
* Returns whether this date-time at processing attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class DateTimeAtProcessing.
- * <LI>
- * This date-time at processing attribute's {@link java.util.Date Date}
- * value and {@code object}'s {@link java.util.Date Date} value
- * are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code DateTimeAtProcessing}.
+ * <li>This date-time at processing attribute's {@link Date Date}
+ * value and {@code object}'s {@link Date Date} value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this date-time
- * at processing attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this date-time at
+ * processing attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(super.equals (object) &&
@@ -96,12 +95,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class DateTimeAtProcessing, the category is class
- * DateTimeAtProcessing itself.
+ * <p>
+ * For class {@code DateTimeAtProcessing}, the category is class
+ * {@code DateTimeAtProcessing} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return DateTimeAtProcessing.class;
@@ -110,14 +109,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class DateTimeAtProcessing, the category name is
+ * <p>
+ * For class {@code DateTimeAtProcessing}, the category name is
* {@code "date-time-at-processing"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "date-time-at-processing";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,72 +22,70 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import java.io.File;
import java.net.URI;
import javax.print.attribute.Attribute;
-import javax.print.attribute.URISyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.URISyntax;
/**
- * Class Destination is a printing attribute class, a URI, that is used to
- * indicate an alternate destination for the spooled printer formatted
- * data. Many PrintServices will not support the notion of a destination
- * other than the printer device, and so will not support this attribute.
+ * Class {@code Destination} is a printing attribute class, a {@code URI}, that
+ * is used to indicate an alternate destination for the spooled printer
+ * formatted data. Many {@code PrintServices} will not support the notion of a
+ * destination other than the printer device, and so will not support this
+ * attribute.
* <p>
- * A common use for this attribute will be applications which want
- * to redirect output to a local disk file : eg."file:out.prn".
- * Note that proper construction of "file:" scheme URI instances should
- * be performed using the {@code toURI()} method of class
- * {@link java.io.File File}.
- * See the documentation on that class for more information.
+ * A common use for this attribute will be applications which want to redirect
+ * output to a local disk file : eg."file:out.prn". Note that proper
+ * construction of "file:" scheme {@code URI} instances should be performed
+ * using the {@code toURI()} method of class {@link File File}. See the
+ * documentation on that class for more information.
* <p>
- * If a destination URI is specified in a PrintRequest and it is not
- * accessible for output by the PrintService, a PrintException will be thrown.
- * The PrintException may implement URIException to provide a more specific
- * cause.
- * <P>
- * <B>IPP Compatibility:</B> Destination is not an IPP attribute.
+ * If a destination {@code URI} is specified in a PrintRequest and it is not
+ * accessible for output by the {@code PrintService}, a {@code PrintException}
+ * will be thrown. The {@code PrintException} may implement {@code URIException}
+ * to provide a more specific cause.
+ * <p>
+ * <b>IPP Compatibility:</b> Destination is not an IPP attribute.
*
- * @author Phil Race.
+ * @author Phil Race
*/
public final class Destination extends URISyntax
implements PrintJobAttribute, PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6776739171700415321L;
/**
- * Constructs a new destination attribute with the specified URI.
+ * Constructs a new destination attribute with the specified {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public Destination(URI uri) {
super (uri);
}
/**
- * Returns whether this destination attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class Destination.
- * <LI>
- * This destination attribute's URI and {@code object}'s URI
- * are equal.
- * </OL>
+ * Returns whether this destination attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code Destination}.
+ * <li>This destination attribute's {@code URI} and {@code object}'s
+ * {@code URI} are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this destination
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this destination
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -97,11 +95,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Destination, the category is class Destination itself.
+ * <p>
+ * For class {@code Destination}, the category is class {@code Destination}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Destination.class;
@@ -110,13 +109,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Destination, the category name is {@code "spool-data-destination"}.
+ * <p>
+ * For class {@code Destination}, the category name is
+ * {@code "spool-data-destination"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "spool-data-destination";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,107 +25,112 @@
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class DialogTypeSelection is a printing attribute class, an enumeration,
- * that indicates the user dialog type to be used for specifying
- * printing options.
- * If {@code NATIVE} is specified, then where available, a native
- * platform dialog is displayed.
- * If {@code COMMON} is specified, a cross-platform print dialog is displayed.
- *
- * This option to specify a native dialog for use with an IPP attribute
- * set provides a standard way to reflect back of the setting and option
- * changes made by a user to the calling application, and integrates
- * the native dialog into the Java printing APIs.
- * But note that some options and settings in a native dialog may not
- * necessarily map to IPP attributes as they may be non-standard platform,
- * or even printer specific options.
- * <P>
- * <B>IPP Compatibility:</B> This is not an IPP attribute.
+ * Class {@code DialogTypeSelection} is a printing attribute class, an
+ * enumeration, that indicates the user dialog type to be used for specifying
+ * printing options. If {@code NATIVE} is specified, then where available, a
+ * native platform dialog is displayed. If {@code COMMON} is specified, a
+ * cross-platform print dialog is displayed.
+ * <p>
+ * This option to specify a native dialog for use with an IPP attribute set
+ * provides a standard way to reflect back of the setting and option changes
+ * made by a user to the calling application, and integrates the native dialog
+ * into the Java printing APIs. But note that some options and settings in a
+ * native dialog may not necessarily map to IPP attributes as they may be
+ * non-standard platform, or even printer specific options.
+ * <p>
+ * <b>IPP Compatibility:</b> This is not an IPP attribute.
*
* @since 1.7
*/
public final class DialogTypeSelection extends EnumSyntax
implements PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.7 for interoperability.
+ */
private static final long serialVersionUID = 7518682952133256029L;
/**
- *
+ * The native platform print dialog should be used.
*/
public static final DialogTypeSelection
NATIVE = new DialogTypeSelection(0);
/**
- *
+ * The cross-platform print dialog should be used.
*/
public static final DialogTypeSelection
COMMON = new DialogTypeSelection(1);
/**
- * Constructs a new dialog type selection enumeration value with the
- * given integer value.
+ * Constructs a new dialog type selection enumeration value with the given
+ * integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected DialogTypeSelection(int value) {
super(value);
}
+ /**
+ * The string table for class {@code DialogTypeSelection}.
+ */
private static final String[] myStringTable = {
"native", "common"};
-
+ /**
+ * The enumeration value table for class
+ * {@code DialogTypeSelection}.
+ */
private static final DialogTypeSelection[] myEnumValueTable = {
NATIVE,
COMMON
};
/**
- * Returns the string table for class DialogTypeSelection.
+ * Returns the string table for class {@code DialogTypeSelection}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class DialogTypeSelection.
+ * Returns the enumeration value table for class
+ * {@code DialogTypeSelection}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
-
- /**
+ /**
* Gets the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class DialogTypeSelection the category is class
- * DialogTypeSelection itself.
+ * <p>
+ * For class {@code DialogTypeSelection} the category is class
+ * {@code DialogTypeSelection} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return DialogTypeSelection.class;
}
-
/**
* Gets the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class DialogTypeSelection the category name is
+ * <p>
+ * For class {@code DialogTypeSelection} the category name is
* {@code "dialog-type-selection"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "dialog-type-selection";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,71 +22,67 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.DocAttribute;
/**
- * Class DocumentName is a printing attribute class, a text attribute, that
- * specifies the name of a document. DocumentName is an attribute of the print
- * data (the doc), not of the Print Job. A document's name is an arbitrary
- * string defined by the client.
- * However if a JobName is not specified, the DocumentName should be used
- * instead, which implies that supporting specification of DocumentName
- * requires reporting of JobName and vice versa.
- * See {@link JobName JobName} for more information.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code DocumentName} is a printing attribute class, a text attribute,
+ * that specifies the name of a document. {@code DocumentName} is an attribute
+ * of the print data (the doc), not of the Print Job. A document's name is an
+ * arbitrary string defined by the client. However if a JobName is not
+ * specified, the {@code DocumentName} should be used instead, which implies
+ * that supporting specification of {@code DocumentName} requires reporting of
+ * JobName and vice versa. See {@link JobName JobName} for more information.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class DocumentName extends TextSyntax implements DocAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7883105848533280430L;
/**
- * Constructs a new document name attribute with the given document name
- * and locale.
+ * Constructs a new document name attribute with the given document name and
+ * locale.
*
- * @param documentName Document name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code documentName} is null.
+ * @param documentName document name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code documentName} is {@code null}
*/
public DocumentName(String documentName, Locale locale) {
super (documentName, locale);
}
/**
- * Returns whether this document name attribute is equivalent to the
- * passed in object.
- * To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class DocumentName.
- * <LI>
- * This document name attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This document name attribute's locale and {@code object}'s locale
- * are equal.
- * </OL>
+ * Returns whether this document name attribute is equivalent to the passed
+ * in object. To be equivalent, all of the following conditions must be
+ * true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code DocumentName}.
+ * <li>This document name attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This document name attribute's locale and {@code object}'s locale
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this document
- * name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this document
+ * name attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) && object instanceof DocumentName);
@@ -95,11 +91,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class DocumentName, the category is class DocumentName itself.
+ * <p>
+ * For class {@code DocumentName}, the category is class
+ * {@code DocumentName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return DocumentName.class;
@@ -108,13 +105,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class DocumentName, the category name is {@code "document-name"}.
+ * <p>
+ * For class {@code DocumentName}, the category name is
+ * {@code "document-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "document-name";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -30,27 +31,27 @@
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class Fidelity is a printing attribute class, an enumeration,
- * that indicates whether total fidelity to client supplied print request
- * attributes is required.
- * If FIDELITY_TRUE is specified and a service cannot print the job exactly
- * as specified it must reject the job.
- * If FIDELITY_FALSE is specified a reasonable attempt to print the job is
- * acceptable. If not supplied the default is FIDELITY_FALSE.
- *
- * <P>
- * <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE
- * and "false" for FIDELITY_FALSE. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- * See <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for
- * a fuller description of the IPP fidelity attribute.
- *
+ * Class {@code Fidelity} is a printing attribute class, an enumeration, that
+ * indicates whether total fidelity to client supplied print request attributes
+ * is required. If {@code FIDELITY_TRUE} is specified and a service cannot print
+ * the job exactly as specified it must reject the job. If
+ * {@code FIDELITY_FALSE} is specified a reasonable attempt to print the job is
+ * acceptable. If not supplied the default is {@code FIDELITY_FALSE}.
+ * <p>
+ * <b>IPP Compatibility:</b> The IPP boolean value is "true" for
+ * {@code FIDELITY_TRUE} and "false" for {@code FIDELITY_FALSE}. The category
+ * name returned by {@code getName()} is the IPP attribute name. The
+ * enumeration's integer value is the IPP enum value. The {@code toString()}
+ * method returns the IPP string representation of the attribute value. See
+ * <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for a
+ * fuller description of the IPP fidelity attribute.
*/
public final class Fidelity extends EnumSyntax
implements PrintJobAttribute, PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6320827847329172308L;
/**
@@ -60,53 +61,60 @@
FIDELITY_TRUE = new Fidelity(0);
/**
- * The printer should make reasonable attempts to print the job,
- * even if it cannot print it exactly as specified.
+ * The printer should make reasonable attempts to print the job, even if it
+ * cannot print it exactly as specified.
*/
public static final Fidelity
FIDELITY_FALSE = new Fidelity(1);
/**
- * Construct a new fidelity enumeration value with the
- * given integer value.
+ * Construct a new fidelity enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Fidelity(int value) {
super (value);
}
+ /**
+ * The string table for class {@code Fidelity}.
+ */
private static final String[] myStringTable = {
"true",
"false"
};
-
+ /**
+ * The enumeration value table for class {@code Fidelity}.
+ */
private static final Fidelity[] myEnumValueTable = {
FIDELITY_TRUE,
FIDELITY_FALSE
};
/**
- * Returns the string table for class Fidelity.
+ * Returns the string table for class {@code Fidelity}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Fidelity.
+ * Returns the enumeration value table for class {@code Fidelity}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
- } /**
+ }
+
+ /**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Fidelity the category is class Fidelity itself.
+ * <p>
+ * For class {@code Fidelity} the category is class
+ * {@code Fidelity} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Fidelity.class;
@@ -115,14 +123,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Fidelity the category name is
+ * <p>
+ * For class {@code Fidelity} the category name is
* {@code "ipp-attribute-fidelity"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "ipp-attribute-fidelity";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Thu Aug 31 15:47:34 2017 -0700
@@ -22,209 +22,134 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Finishings is a printing attribute class, an enumeration, that
- * identifies whether the printer applies a finishing operation of some kind
- * of binding to each copy of each printed document in the job. For multidoc
- * print jobs (jobs with multiple documents), the
- * {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute determines what constitutes a "copy"
- * for purposes of finishing.
- * <P>
+ * Class {@code Finishings} is a printing attribute class, an enumeration, that
+ * identifies whether the printer applies a finishing operation of some kind of
+ * binding to each copy of each printed document in the job. For multidoc print
+ * jobs (jobs with multiple documents), the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute
+ * determines what constitutes a "copy" for purposes of finishing.
+ * <p>
* Standard Finishings values are:
* <table class="borderless" style="width:100%;margin: 0px auto">
* <caption>Standard Finishings values</caption>
- * <TR>
- * <TD STYLE="WIDTH:10%">
- *
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #NONE NONE}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE STAPLE}
- * </TD>
- * <TD STYLE="WIDTH:36%">
- * {@link #EDGE_STITCH EDGE_STITCH}
- * </TD>
- * </TR>
- * <TR>
- * <TD>
- *
- * </TD>
- * <TD>
- * {@link #BIND BIND}
- * </TD>
- * <TD>
- * {@link #SADDLE_STITCH SADDLE_STITCH}
- * </TD>
- * <TD>
- * {@link #COVER COVER}
- * </TD>
- * <TD>
- *
- * </TD>
- * </TR>
- * </TABLE>
- * <P>
- * The following Finishings values are more specific; they indicate a
+ * <tr>
+ * <td style="width:10%">
+ * <td style="width:27%">{@link #NONE NONE}
+ * <td style="width:27%">{@link #STAPLE STAPLE}
+ * <td style="width:36%">{@link #EDGE_STITCH EDGE_STITCH}
+ * <tr>
+ * <td>
+ * <td>{@link #BIND BIND}
+ * <td>{@link #SADDLE_STITCH SADDLE_STITCH}
+ * <td>{@link #COVER COVER}
+ * <td>
+ * </table>
+ * <p>
+ * The following {@code Finishings} values are more specific; they indicate a
* corner or an edge as if the document were a portrait document:
* <table class="borderless" style="width:100%;margin: 0px auto">
* <caption>Specific Finishings values</caption>
- * <TR>
- * <TD STYLE="WIDTH:10%">
- *
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
- * </TD>
- * <TD STYLE="WIDTH:9%">
- *
- * </TD>
- * </TR>
- * <TR>
- * <TD STYLE="WIDTH:10%">
- *
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
- * </TD>
- * <TD STYLE="WIDTH:9%">
- *
- * </TD>
- * </TR>
- * <TR>
- * <TD STYLE="WIDTH:10%">
- *
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
- * </TD>
- * <TD STYLE="WIDTH:9%">
- *
- * </TD>
- * </TR>
- * <TR>
- * <TD STYLE="WIDTH:10%">
- *
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
- * </TD>
- * <TD STYLE="WIDTH:27%">
- * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
- * </TD>
- * <TD STYLE="WIDTH:9%">
- *
- * </TD>
- * </TR>
- * </TABLE>
- * <P>
- * The STAPLE_<I>XXX</I> values are specified with respect to the
- * document as if the document were a portrait document. If the document is
- * actually a landscape or a reverse-landscape document, the client supplies the
+ * <tr>
+ * <td style="width:10%">
+ * <td style="width:27%">{@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
+ * <td style="width:27%">{@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
+ * <td style="width:27%">{@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
+ * <td style="width:9%">
+ * <tr>
+ * <td style="width:10%">
+ * <td style="width:27%">{@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
+ * <td style="width:27%">{@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
+ * <td style="width:27%">{@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
+ * <td style="width:9%">
+ * <tr>
+ * <td style="width:10%">
+ * <td style="width:27%">{@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
+ * <td style="width:27%">{@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
+ * <td style="width:27%">{@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
+ * <td style="width:9%">
+ * <tr>
+ * <td style="width:10%">
+ * <td style="width:27%">{@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
+ * <td style="width:27%">{@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
+ * <td style="width:27%">{@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
+ * <td style="width:9%">
+ * </table>
+ * <p>
+ * The STAPLE_<i>XXX</i> values are specified with respect to the document as if
+ * the document were a portrait document. If the document is actually a
+ * landscape or a reverse-landscape document, the client supplies the
* appropriate transformed value. For example, to position a staple in the upper
* left hand corner of a landscape document when held for reading, the client
- * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
- * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
- * other hand, to position a staple in the upper left hand corner of a
+ * supplies the {@code STAPLE_BOTTOM_LEFT} value (since landscape is defined as
+ * a +90 degree rotation from portrait, i.e., anti-clockwise). On the other
+ * hand, to position a staple in the upper left hand corner of a
* reverse-landscape document when held for reading, the client supplies the
- * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
- * -90 degree rotation from portrait, i.e., clockwise).
- * <P>
+ * {@code STAPLE_TOP_RIGHT} value (since reverse-landscape is defined as a -90
+ * degree rotation from portrait, i.e., clockwise).
+ * <p>
* The angle (vertical, horizontal, angled) of each staple with respect to the
* document depends on the implementation which may in turn depend on the value
* of the attribute.
- * <P>
- * The effect of a Finishings attribute on a multidoc print job (a job
+ * <p>
+ * The effect of a {@code Finishings} attribute on a multidoc print job (a job
* with multiple documents) depends on whether all the docs have the same
* binding specified or whether different docs have different bindings
- * specified, and on the (perhaps defaulted) value of the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} attribute.
- * <UL>
- * <LI>
- * If all the docs have the same binding specified, then any value of {@link
- * MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
- * printer's processing depends on the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} value:
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be bound together as one output
- * document with the specified binding.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be bound together as one
- * output document with the specified binding, and the first impression of each
- * input doc will always start on a new media sheet.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
- * separately with the specified binding.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
- * with the specified binding.
- * </UL>
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ * <ul>
+ * <li>If all the docs have the same binding specified, then any value of
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} makes sense, and
+ * the printer's processing depends on the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} value:
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be bound together
+ * as one output document with the specified binding.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be bound
+ * together as one output document with the specified binding, and the first
+ * impression of each input doc will always start on a new media sheet.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- Each input doc will
+ * be bound separately with the specified binding.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- Each input doc will be
+ * bound separately with the specified binding.
+ * </ul>
+ * <li>If different docs have different bindings specified, then only two
+ * values of {@link MultipleDocumentHandling MultipleDocumentHandling} make
+ * sense, and the printer reports an error when the job is submitted if any
+ * other value is specified:
+ * <ul>
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- Each input doc will
+ * be bound separately with its own specified binding.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- Each input doc will be
+ * bound separately with its own specified binding.
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>IPP Compatibility:</b> Class Finishings encapsulates some of the IPP enum
+ * values that can be included in an IPP "finishings" attribute, which is a set
+ * of enums. The category name returned by {@code getName()} is the IPP
+ * attribute name. The enumeration's integer value is the IPP enum value. The
+ * {@code toString()} method returns the IPP string representation of the
+ * attribute value. In IPP Finishings is a multi-value attribute, this API
+ * currently allows only one binding to be specified.
*
- * <LI>
- * If different docs have different bindings specified, then only two values of
- * {@link MultipleDocumentHandling MultipleDocumentHandling} make sense, and the
- * printer reports an error when the job is submitted if any other value is
- * specified:
- * <UL>
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
- * separately with its own specified binding.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
- * with its own specified binding.
- * </UL>
- * </UL>
- * <P>
- * <B>IPP Compatibility:</B> Class Finishings encapsulates some of the
- * IPP enum values that can be included in an IPP "finishings" attribute, which
- * is a set of enums. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- * In IPP Finishings is a multi-value attribute, this API currently allows
- * only one binding to be specified.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class Finishings extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -627840419548391754L;
/**
@@ -241,21 +166,21 @@
/**
* This value is specified when it is desired to select a non-printed (or
* pre-printed) cover for the document. This does not supplant the
- * specification of a printed cover (on cover stock medium) by the
- * document itself.
+ * specification of a printed cover (on cover stock medium) by the document
+ * itself.
*/
public static final Finishings COVER = new Finishings(6);
/**
- * This value indicates that a binding is to be applied to the document;
- * the type and placement of the binding is site-defined.
+ * This value indicates that a binding is to be applied to the document; the
+ * type and placement of the binding is site-defined.
*/
public static final Finishings BIND = new Finishings(7);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
- * middle fold. The exact number and placement of the staples and the
- * middle fold is implementation- and/or site-defined.
+ * middle fold. The exact number and placement of the staples and the middle
+ * fold is implementation- and/or site-defined.
*/
public static final Finishings SADDLE_STITCH =
new Finishings(8);
@@ -275,8 +200,7 @@
new Finishings(20);
/**
- * Bind the document(s) with one or more staples in the bottom left
- * corner.
+ * Bind the document(s) with one or more staples in the bottom left corner.
*/
public static final Finishings STAPLE_BOTTOM_LEFT =
new Finishings(21);
@@ -288,8 +212,7 @@
new Finishings(22);
/**
- * Bind the document(s) with one or more staples in the bottom right
- * corner.
+ * Bind the document(s) with one or more staples in the bottom right corner.
*/
public static final Finishings STAPLE_BOTTOM_RIGHT =
new Finishings(23);
@@ -327,15 +250,15 @@
new Finishings(27);
/**
- * Bind the document(s) with two staples (wire stitches) along the left
- * edge assuming a portrait document (see above).
+ * Bind the document(s) with two staples (wire stitches) along the left edge
+ * assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_LEFT =
new Finishings(28);
/**
- * Bind the document(s) with two staples (wire stitches) along the top
- * edge assuming a portrait document (see above).
+ * Bind the document(s) with two staples (wire stitches) along the top edge
+ * assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_TOP =
new Finishings(29);
@@ -358,12 +281,15 @@
* Construct a new finishings binding enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Finishings(int value) {
super(value);
}
+ /**
+ * The string table for class {@code Finishings}.
+ */
private static final String[] myStringTable =
{"none",
"staple",
@@ -396,6 +322,9 @@
"staple-dual-bottom"
};
+ /**
+ * The enumeration value table for class {@code Finishings}.
+ */
private static final Finishings[] myEnumValueTable =
{NONE,
STAPLE,
@@ -429,21 +358,21 @@
};
/**
- * Returns the string table for class Finishings.
+ * Returns the string table for class {@code Finishings}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class Finishings.
+ * Returns the enumeration value table for class {@code Finishings}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
- * Returns the lowest integer value used by class Finishings.
+ * Returns the lowest integer value used by class {@code Finishings}.
*/
protected int getOffset() {
return 3;
@@ -452,12 +381,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Finishings and any vendor-defined subclasses, the
- * category is class Finishings itself.
+ * <p>
+ * For class {@code Finishings} and any vendor-defined subclasses, the
+ * category is class {@code Finishings} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Finishings.class;
@@ -466,14 +395,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Finishings and any vendor-defined subclasses, the
+ * <p>
+ * For class {@code Finishings} and any vendor-defined subclasses, the
* category name is {@code "finishings"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "finishings";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,116 +22,118 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import java.util.Calendar;
import java.util.Date;
+
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobHoldUntil is a printing attribute class, a date-time attribute, that
- * specifies the exact date and time at which the job must become a candidate
- * for printing.
- * <P>
+ * Class {@code JobHoldUntil} is a printing attribute class, a date-time
+ * attribute, that specifies the exact date and time at which the job must
+ * become a candidate for printing.
+ * <p>
* If the value of this attribute specifies a date-time that is in the future,
* the printer should add the {@link JobStateReason JobStateReason} value of
- * JOB_HOLD_UNTIL_SPECIFIED to the job's {@link JobStateReasons JobStateReasons}
- * attribute, must move the job to the PENDING_HELD state, and must not schedule
- * the job for printing until the specified date-time arrives.
- * <P>
- * When the specified date-time arrives, the printer must remove the {@link
- * JobStateReason JobStateReason} value of JOB_HOLD_UNTIL_SPECIFIED from the
- * job's {@link JobStateReasons JobStateReasons} attribute, if present. If there
- * are no other job state reasons that keep the job in the PENDING_HELD state,
- * the printer must consider the job as a candidate for processing by moving the
- * job to the PENDING state.
- * <P>
+ * {@code JOB_HOLD_UNTIL_SPECIFIED} to the job's
+ * {@link JobStateReasons JobStateReasons} attribute, must move the job to the
+ * {@code PENDING_HELD} state, and must not schedule the job for printing until
+ * the specified date-time arrives.
+ * <p>
+ * When the specified date-time arrives, the printer must remove the
+ * {@link JobStateReason JobStateReason} value of
+ * {@code JOB_HOLD_UNTIL_SPECIFIED} from the job's
+ * {@link JobStateReasons JobStateReasons} attribute, if present. If there are
+ * no other job state reasons that keep the job in the {@code PENDING_HELD}
+ * state, the printer must consider the job as a candidate for processing by
+ * moving the job to the PENDING state.
+ * <p>
* If the specified date-time has already passed, the job must be a candidate
* for processing immediately. Thus, one way to make the job immediately become
- * a candidate for processing is to specify a JobHoldUntil attribute constructed
- * like this (denoting a date-time of January 1, 1970, 00:00:00 GMT):
- * <PRE>
+ * a candidate for processing is to specify a {@code JobHoldUntil} attribute
+ * constructed like this
+ * (denoting a date-time of January 1, 1970, 00:00:00 GMT):
+ * <pre>
* JobHoldUntil immediately = new JobHoldUntil (new Date (0L));
- * </PRE>
- * <P>
+ * </pre>
+ * <p>
* If the client does not supply this attribute in a Print Request and the
* printer supports this attribute, the printer must use its
- * (implementation-dependent) default JobHoldUntil value at job submission time
- * (unlike most job template attributes that are used if necessary at job
- * processing time).
- * <P>
- * To construct a JobHoldUntil attribute from separate values of the year,
- * month, day, hour, minute, and so on, use a {@link java.util.Calendar
- * Calendar} object to construct a {@link java.util.Date Date} object, then use
- * the {@link java.util.Date Date} object to construct the JobHoldUntil
- * attribute. To convert a JobHoldUntil attribute to separate values of the
- * year, month, day, hour, minute, and so on, create a {@link java.util.Calendar
- * Calendar} object and set it to the {@link java.util.Date Date} from the
- * JobHoldUntil attribute.
- * <P>
- * <B>IPP Compatibility:</B> Although IPP supports a "job-hold-until" attribute
+ * (implementation-dependent) default {@code JobHoldUntil} value at job
+ * submission time (unlike most job template attributes that are used if
+ * necessary at job processing time).
+ * <p>
+ * To construct a {@code JobHoldUntil} attribute from separate values of the
+ * year, month, day, hour, minute, and so on, use a {@link Calendar Calendar}
+ * object to construct a {@link Date Date} object, then use the
+ * {@link Date Date} object to construct the {@code JobHoldUntil} attribute. To
+ * convert a {@code JobHoldUntil} attribute to separate values of the year,
+ * month, day, hour, minute, and so on, create a {@link Calendar Calendar}
+ * object and set it to the {@link Date Date} from the {@code JobHoldUntil}
+ * attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> Although IPP supports a "job-hold-until" attribute
* specified as a keyword, IPP does not at this time support a "job-hold-until"
* attribute specified as a date and time. However, the date and time can be
* converted to one of the standard IPP keywords with some loss of precision;
- * for example, a JobHoldUntil value with today's date and 9:00pm local time
- * might be converted to the standard IPP keyword "night". The category name
- * returned by {@code getName()} gives the IPP attribute name.
+ * for example, a {@code JobHoldUntil} value with today's date and 9:00pm local
+ * time might be converted to the standard IPP keyword "night". The category
+ * name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobHoldUntil extends DateTimeSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1664471048860415024L;
-
/**
* Construct a new job hold until date-time attribute with the given
- * {@link java.util.Date Date} value.
+ * {@link Date Date} value.
*
- * @param dateTime {@link java.util.Date Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code dateTime} is null.
+ * @param dateTime {@link Date Date} value
+ * @throws NullPointerException if {@code dateTime} is {@code null}
*/
public JobHoldUntil(Date dateTime) {
super (dateTime);
}
/**
- * Returns whether this job hold until attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobHoldUntil.
- * <LI>
- * This job hold until attribute's {@link java.util.Date Date} value and
- * {@code object}'s {@link java.util.Date Date} value are equal.
- * </OL>
+ * Returns whether this job hold until attribute is equivalent to the passed
+ * in object. To be equivalent, all of the following conditions must be
+ * true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobHoldUntil}.
+ * <li>This job hold until attribute's {@link Date Date} value and
+ * {@code object}'s {@link Date Date} value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job hold
- * until attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job hold
+ * until attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof JobHoldUntil);
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobHoldUntil, the category is class JobHoldUntil itself.
+ * <p>
+ * For class {@code JobHoldUntil}, the category is class
+ * {@code JobHoldUntil} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobHoldUntil.class;
@@ -140,13 +142,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobHoldUntil, the category name is {@code "job-hold-until"}.
+ * <p>
+ * For class {@code JobHoldUntil}, the category name is
+ * {@code "job-hold-until"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-hold-until";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,70 +22,71 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobImpressions is an integer valued printing attribute class that
- * specifies the total size in number of impressions of the document(s) being
- * submitted. An "impression" is the image (possibly many print-stream pages in
- * different configurations) imposed onto a single media page.
- * <P>
- * The JobImpressions attribute describes the size of the job. This attribute is
- * not intended to be a counter; it is intended to be useful routing and
- * scheduling information if known. The printer may try to compute the
- * JobImpressions attribute's value if it is not supplied in the Print Request.
- * Even if the client does supply a value for the JobImpressions attribute in
- * the Print Request, the printer may choose to change the value if the printer
- * is able to compute a value which is more accurate than the client supplied
- * value. The printer may be able to determine the correct value for the
- * JobImpressions attribute either right at job submission time or at any later
- * point in time.
- * <P>
- * As with {@link JobKOctets JobKOctets}, the JobImpressions value must not
- * include the multiplicative factors contributed by the number of copies
+ * Class {@code JobImpressions} is an integer valued printing attribute class
+ * that specifies the total size in number of impressions of the document(s)
+ * being submitted. An "impression" is the image (possibly many print-stream
+ * pages in different configurations) imposed onto a single media page.
+ * <p>
+ * The {@code JobImpressions} attribute describes the size of the job. This
+ * attribute is not intended to be a counter; it is intended to be useful
+ * routing and scheduling information if known. The printer may try to compute
+ * the {@code JobImpressions} attribute's value if it is not supplied in the
+ * Print Request. Even if the client does supply a value for the
+ * {@code JobImpressions} attribute in the Print Request, the printer may choose
+ * to change the value if the printer is able to compute a value which is more
+ * accurate than the client supplied value. The printer may be able to determine
+ * the correct value for the {@code JobImpressions} attribute either right at
+ * job submission time or at any later point in time.
+ * <p>
+ * As with {@link JobKOctets JobKOctets}, the {@code JobImpressions} value must
+ * not include the multiplicative factors contributed by the number of copies
* specified by the {@link Copies Copies} attribute, independent of whether the
* device can process multiple copies without making multiple passes over the
* job or document data and independent of whether the output is collated or
* not. Thus the value is independent of the implementation and reflects the
* size of the document(s) measured in impressions independent of the number of
* copies.
- * <P>
- * As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not
- * include the multiplicative factor due to a copies instruction embedded in the
- * document data. If the document data actually includes replications of the
- * document data, this value will include such replication. In other words, this
- * value is always the number of impressions in the source document data, rather
- * than a measure of the number of impressions to be produced by the job.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * <p>
+ * As with {@link JobKOctets JobKOctets}, the {@code JobImpressions} value must
+ * also not include the multiplicative factor due to a copies instruction
+ * embedded in the document data. If the document data actually includes
+ * replications of the document data, this value will include such replication.
+ * In other words, this value is always the number of impressions in the source
+ * document data, rather than a measure of the number of impressions to be
+ * produced by the job.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobImpressionsSupported
* @see JobImpressionsCompleted
* @see JobKOctets
* @see JobMediaSheets
- *
- * @author Alan Kaminsky
*/
public final class JobImpressions extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8225537206784322464L;
-
/**
* Construct a new job impressions attribute with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
*/
public JobImpressions(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -95,20 +96,16 @@
* Returns whether this job impressions attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobImpressions.
- * <LI>
- * This job impressions attribute's value and {@code object}'s value
- * are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobImpressions}.
+ * <li>This job impressions attribute's value and {@code object}'s value
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * impressions attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job
+ * impressions attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof JobImpressions;
@@ -117,11 +114,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobImpressions, the category is class JobImpressions itself.
+ * <p>
+ * For class {@code JobImpressions}, the category is class
+ * {@code JobImpressions} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressions.class;
@@ -130,14 +128,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobImpressions, the category name is
+ * <p>
+ * For class {@code JobImpressions}, the category name is
* {@code "job-impressions"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-impressions";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,68 +30,66 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobImpressionsCompleted is an integer valued printing attribute class
- * that specifies the number of impressions completed for the job so far. For
- * printing devices, the impressions completed includes interpreting, marking,
- * and stacking the output.
- * <P>
- * The JobImpressionsCompleted attribute describes the progress of the job. This
- * attribute is intended to be a counter. That is, the JobImpressionsCompleted
- * value for a job that has not started processing must be 0. When the job's
- * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
- * JobImpressionsCompleted value is intended to increase as the job is
+ * Class {@code JobImpressionsCompleted} is an integer valued printing attribute
+ * class that specifies the number of impressions completed for the job so far.
+ * For printing devices, the impressions completed includes interpreting,
+ * marking, and stacking the output.
+ * <p>
+ * The {@code JobImpressionsCompleted} attribute describes the progress of the
+ * job. This attribute is intended to be a counter. That is, the
+ * {@code JobImpressionsCompleted} value for a job that has not started
+ * processing must be 0. When the job's {@link JobState JobState} is
+ * {@code PROCESSING} or {@code PROCESSING_STOPPED}, the
+ * {@code JobImpressionsCompleted} value is intended to increase as the job is
* processed; it indicates the amount of the job that has been processed at the
* time the Print Job's attribute set is queried or at the time a print job
- * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
- * states, the JobImpressionsCompleted value is the final value for the job.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * event is reported. When the job enters the {@code COMPLETED},
+ * {@code CANCELED}, or {@code ABORTED} states, the
+ * {@code JobImpressionsCompleted} value is the final value for the job.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobImpressions
* @see JobImpressionsSupported
* @see JobKOctetsProcessed
* @see JobMediaSheetsCompleted
- *
- * @author Alan Kaminsky
*/
public final class JobImpressionsCompleted extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6722648442432393294L;
/**
* Construct a new job impressions completed attribute with the given
* integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public JobImpressionsCompleted(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
- * Returns whether this job impressions completed attribute is equivalent
- * tp the passed in object. To be equivalent, all of the following
- * conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobImpressionsCompleted.
- * <LI>
- * This job impressions completed attribute's value and
- * {@code object}'s value are equal.
- * </OL>
+ * Returns whether this job impressions completed attribute is equivalent tp
+ * the passed in object. To be equivalent, all of the following conditions
+ * must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobImpressionsCompleted}.
+ * <li>This job impressions completed attribute's value and
+ * {@code object}'s value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * impressions completed attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job
+ * impressions completed attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(super.equals (object) &&
@@ -100,12 +99,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobImpressionsCompleted, the category is class
- * JobImpressionsCompleted itself.
+ * <p>
+ * For class {@code JobImpressionsCompleted}, the category is class
+ * {@code JobImpressionsCompleted} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressionsCompleted.class;
@@ -114,14 +113,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobImpressionsCompleted, the category name is
+ * <p>
+ * For class {@code JobImpressionsCompleted}, the category name is
* {@code "job-impressions-completed"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-impressions-completed";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,40 +30,40 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class JobImpressionsSupported is a printing attribute class, a set of
- * integers, that gives the supported values for a {@link JobImpressions
- * JobImpressions} attribute. It is restricted to a single contiguous range of
- * integers; multiple non-overlapping ranges are not allowed. This gives the
- * lower and upper bounds of the total sizes of print jobs in number of
- * impressions that the printer will accept.
- * <P>
- * <B>IPP Compatibility:</B> The JobImpressionsSupported attribute's canonical
- * array form gives the lower and upper bound for the range of values to be
- * included in an IPP "job-impressions-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * Class {@code JobImpressionsSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a
+ * {@link JobImpressions JobImpressions} attribute. It is restricted to a single
+ * contiguous range of integers; multiple non-overlapping ranges are not
+ * allowed. This gives the lower and upper bounds of the total sizes of print
+ * jobs in number of impressions that the printer will accept.
+ * <p>
+ * <b>IPP Compatibility:</b> The {@code JobImpressionsSupported} attribute's
+ * canonical array form gives the lower and upper bound for the range of values
+ * to be included in an IPP "job-impressions-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobImpressionsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4887354803843173692L;
-
/**
* Construct a new job impressions supported attribute containing a single
- * range of integers. That is, only those values of JobImpressions in the
- * one range are supported.
+ * range of integers. That is, only those values of {@code JobImpressions}
+ * in the one range are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 0.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than zero
*/
public JobImpressionsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -74,25 +75,21 @@
}
}
-
/**
- * Returns whether this job impressions supported attribute is equivalent
- * to the passed in object. To be equivalent, all of the following
- * conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobImpressionsSupported.
- * <LI>
- * This job impressions supported attribute's members and
- * {@code object}'s members are the same.
- * </OL>
+ * Returns whether this job impressions supported attribute is equivalent to
+ * the passed in object. To be equivalent, all of the following conditions
+ * must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobImpressionsSupported}.
+ * <li>This job impressions supported attribute's members and
+ * {@code object}'s members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * impressions supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job
+ * impressions supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -102,12 +99,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobImpressionsSupported, the category is class
- * JobImpressionsSupported itself.
+ * <p>
+ * For class {@code JobImpressionsSupported}, the category is class
+ * {@code JobImpressionsSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressionsSupported.class;
@@ -116,14 +113,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobImpressionsSupported, the category name is
+ * <p>
+ * For class {@code JobImpressionsSupported}, the category name is
* {@code "job-impressions-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-impressions-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Thu Aug 31 15:47:34 2017 -0700
@@ -22,126 +22,119 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobKOctets is an integer valued printing attribute class that specifies
- * the total size of the document(s) in K octets, i.e., in units of 1024 octets
- * requested to be processed in the job. The value must be rounded up, so that a
- * job between 1 and 1024 octets must be indicated as being 1K octets, 1025 to
- * 2048 must be 2K octets, etc. For a multidoc print job (a job with multiple
- * documents), the JobKOctets value is computed by adding up the individual
- * documents' sizes in octets, then rounding up to the next K octets value.
- * <P>
- * The JobKOctets attribute describes the size of the job. This attribute is not
- * intended to be a counter; it is intended to be useful routing and scheduling
- * information if known. The printer may try to compute the JobKOctets
- * attribute's value if it is not supplied in the Print Request. Even if the
- * client does supply a value for the JobKOctets attribute in the Print Request,
- * the printer may choose to change the value if the printer is able to compute
- * a value which is more accurate than the client supplied value. The printer
- * may be able to determine the correct value for the JobKOctets attribute
- * either right at job submission time or at any later point in time.
- * <P>
- * The JobKOctets value must not include the multiplicative factors contributed
- * by the number of copies specified by the {@link Copies Copies} attribute,
- * independent of whether the device can process multiple copies without making
- * multiple passes over the job or document data and independent of whether the
- * output is collated or not. Thus the value is independent of the
- * implementation and indicates the size of the document(s) measured in K octets
- * independent of the number of copies.
- * <P>
- * The JobKOctets value must also not include the multiplicative factor due to a
- * copies instruction embedded in the document data. If the document data
- * actually includes replications of the document data, this value will include
- * such replication. In other words, this value is always the size of the source
- * document data, rather than a measure of the hardcopy output to be produced.
- * <P>
+ * Class {@code JobKOctets} is an integer valued printing attribute class that
+ * specifies the total size of the document(s) in K octets, i.e., in units of
+ * 1024 octets requested to be processed in the job. The value must be rounded
+ * up, so that a job between 1 and 1024 octets must be indicated as being 1K
+ * octets, 1025 to 2048 must be 2K octets, etc. For a multidoc print job (a job
+ * with multiple documents), the {@code JobKOctets} value is computed by adding
+ * up the individual documents' sizes in octets, then rounding up to the next K
+ * octets value.
+ * <p>
+ * The {@code JobKOctets} attribute describes the size of the job. This
+ * attribute is not intended to be a counter; it is intended to be useful
+ * routing and scheduling information if known. The printer may try to compute
+ * the {@code JobKOctets} attribute's value if it is not supplied in the Print
+ * Request. Even if the client does supply a value for the {@code JobKOctets}
+ * attribute in the Print Request, the printer may choose to change the value if
+ * the printer is able to compute a value which is more accurate than the client
+ * supplied value. The printer may be able to determine the correct value for
+ * the {@code JobKOctets} attribute either right at job submission time or at
+ * any later point in time.
+ * <p>
+ * The {@code JobKOctets} value must not include the multiplicative factors
+ * contributed by the number of copies specified by the {@link Copies Copies}
+ * attribute, independent of whether the device can process multiple copies
+ * without making multiple passes over the job or document data and independent
+ * of whether the output is collated or not. Thus the value is independent of
+ * the implementation and indicates the size of the document(s) measured in K
+ * octets independent of the number of copies.
+ * <p>
+ * The {@code JobKOctets} value must also not include the multiplicative factor
+ * due to a copies instruction embedded in the document data. If the document
+ * data actually includes replications of the document data, this value will
+ * include such replication. In other words, this value is always the size of
+ * the source document data, rather than a measure of the hardcopy output to be
+ * produced.
+ * <p>
* The size of a doc is computed based on the print data representation class as
- * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as
- * shown in the table below.
- *
+ * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as shown in
+ * the table below.
* <table class="striped">
* <caption>Table showing computation of doc sizes</caption>
* <thead>
- * <TR>
- * <TH>Representation Class</TH>
- * <TH>Document Size</TH>
- * </TR>
+ * <tr>
+ * <th>Representation Class
+ * <th>Document Size
* </thead>
* <tbody>
- * <TR>
- * <TD>byte[]</TD>
- * <TD>Length of the byte array</TD>
- * </TR>
- * <TR>
- * <TD>java.io.InputStream</TD>
- * <TD>Number of bytes read from the stream</TD>
- * </TR>
- * <TR>
- * <TD>char[]</TD>
- * <TD>Length of the character array x 2</TD>
- * </TR>
- * <TR>
- * <TD>java.lang.String</TD>
- * <TD>Length of the string x 2</TD>
- * </TR>
- * <TR>
- * <TD>java.io.Reader</TD>
- * <TD>Number of characters read from the stream x 2</TD>
- * </TR>
- * <TR>
- * <TD>java.net.URL</TD>
- * <TD>Number of bytes read from the file at the given URL address</TD>
- * </TR>
- * <TR>
- * <TD>java.awt.image.renderable.RenderableImage</TD>
- * <TD>Implementation dependent*</TD>
- * </TR>
- * <TR>
- * <TD>java.awt.print.Printable</TD>
- * <TD>Implementation dependent*</TD>
- * </TR>
- * <TR>
- * <TD>java.awt.print.Pageable</TD>
- * <TD>Implementation dependent*</TD>
- * </TR>
+ * <tr>
+ * <td>{@code byte[]}
+ * <td>Length of the byte array
+ * <tr>
+ * <td>{@code java.io.InputStream}
+ * <td>Number of bytes read from the stream
+ * <tr>
+ * <td>{@code char[]}
+ * <td>Length of the character array x 2
+ * <tr>
+ * <td>{@code java.lang.String}
+ * <td>Length of the string x 2
+ * <tr>
+ * <td>{@code java.io.Reader}
+ * <td>Number of characters read from the stream x 2
+ * <tr>
+ * <td>{@code java.net.URL}
+ * <td>Number of bytes read from the file at the given {@code URL} address
+ * <tr>
+ * <td>{@code java.awt.image.renderable.RenderableImage}
+ * <td>Implementation dependent*
+ * <tr>
+ * <td>{@code java.awt.print.Printable}
+ * <td>Implementation dependent*
+ * <tr>
+ * <td>{@code java.awt.print.Pageable}
+ * <td>Implementation dependent*
* </tbody>
- * </TABLE>
- * <P>
+ * </table>
+ * <p>
* * In these cases the Print Service itself generates the print data sent
- * to the printer. If the Print Service supports the JobKOctets attribute, for
- * these cases the Print Service itself must calculate the size of the print
- * data, replacing any JobKOctets value the client specified.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * to the printer. If the Print Service supports the {@code JobKOctets}
+ * attribute, for these cases the Print Service itself must calculate the size
+ * of the print data, replacing any {@code JobKOctets} value the client
+ * specified.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobKOctetsSupported
* @see JobKOctetsProcessed
* @see JobImpressions
* @see JobMediaSheets
- *
- * @author Alan Kaminsky
*/
public final class JobKOctets extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8959710146498202869L;
/**
* Construct a new job K octets attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public JobKOctets(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -151,20 +144,16 @@
* Returns whether this job K octets attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobKOctets.
- * <LI>
- * This job K octets attribute's value and {@code object}'s value
- * are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobKOctets}.
+ * <li>This job K octets attribute's value and {@code object}'s value are
+ * equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job K
- * octets attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job K octets
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return super.equals(object) && object instanceof JobKOctets;
@@ -173,11 +162,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobKOctets, the category is class JobKOctets itself.
+ * <p>
+ * For class {@code JobKOctets}, the category is class
+ * {@code JobKOctets} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctets.class;
@@ -186,13 +176,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobKOctets, the category name is {@code "job-k-octets"}.
+ * <p>
+ * For class {@code JobKOctets}, the category name is
+ * {@code "job-k-octets"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-k-octets";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,57 +30,57 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobKOctetsProcessed is an integer valued printing attribute class that
- * specifies the total number of print data octets processed so far in K octets,
- * i.e., in units of 1024 octets. The value must be rounded up, so that a job
- * between 1 and 1024 octets inclusive must be indicated as being 1K octets,
- * 1025 to 2048 inclusive must be 2K, etc. For a multidoc print job (a job with
- * multiple documents), the JobKOctetsProcessed value is computed by adding up
- * the individual documents' number of octets processed so far, then rounding up
- * to the next K octets value.
- * <P>
- * The JobKOctetsProcessed attribute describes the progress of the job. This
- * attribute is intended to be a counter. That is, the JobKOctetsProcessed value
- * for a job that has not started processing must be 0. When the job's {@link
- * JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
- * JobKOctetsProcessed value is intended to increase as the job is processed; it
- * indicates the amount of the job that has been processed at the time the Print
- * Job's attribute set is queried or at the time a print job event is reported.
- * When the job enters the COMPLETED, CANCELED, or ABORTED states, the
- * JobKOctetsProcessed value is the final value for the job.
- * <P>
+ * Class {@code JobKOctetsProcessed} is an integer valued printing attribute
+ * class that specifies the total number of print data octets processed so far
+ * in K octets, i.e., in units of 1024 octets. The value must be rounded up, so
+ * that a job between 1 and 1024 octets inclusive must be indicated as being 1K
+ * octets, 1025 to 2048 inclusive must be 2K, etc. For a multidoc print job (a
+ * job with multiple documents), the JobKOctetsProcessed value is computed by
+ * adding up the individual documents' number of octets processed so far, then
+ * rounding up to the next K octets value.
+ * <p>
+ * The {@code JobKOctetsProcessed} attribute describes the progress of the job.
+ * This attribute is intended to be a counter. That is, the JobKOctetsProcessed
+ * value for a job that has not started processing must be 0. When the job's
+ * {@link JobState JobState} is {@code PROCESSING} or
+ * {@code PROCESSING_STOPPED}, the {@code JobKOctetsProcessed} value is intended
+ * to increase as the job is processed; it indicates the amount of the job that
+ * has been processed at the time the Print Job's attribute set is queried or at
+ * the time a print job event is reported. When the job enters the
+ * {@code COMPLETED}, {@code CANCELED}, or {@code ABORTED} states, the
+ * {@code JobKOctetsProcessed} value is the final value for the job.
+ * <p>
* For implementations where multiple copies are produced by the interpreter
* with only a single pass over the data, the final value of the
- * JobKOctetsProcessed attribute must be equal to the value of the {@link
- * JobKOctets JobKOctets} attribute. For implementations where multiple copies
- * are produced by the interpreter by processing the data for each copy, the
- * final value must be a multiple of the value of the {@link JobKOctets
- * JobKOctets} attribute.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * JobKOctetsProcessed attribute must be equal to the value of the
+ * {@link JobKOctets JobKOctets} attribute. For implementations where multiple
+ * copies are produced by the interpreter by processing the data for each copy,
+ * the final value must be a multiple of the value of the
+ * {@link JobKOctets JobKOctets} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobKOctets
* @see JobKOctetsSupported
* @see JobImpressionsCompleted
* @see JobMediaSheetsCompleted
- *
- * @author Alan Kaminsky
*/
public final class JobKOctetsProcessed extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6265238509657881806L;
/**
* Construct a new job K octets processed attribute with the given integer
* value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public JobKOctetsProcessed(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -89,20 +90,16 @@
* Returns whether this job K octets processed attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobKOctetsProcessed.
- * <LI>
- * This job K octets processed attribute's value and
- * {@code object}'s value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobKOctetsProcessed}.
+ * <li>This job K octets processed attribute's value and {@code object}'s
+ * value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job K
- * octets processed attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job K octets
+ * processed attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(super.equals (object) &&
@@ -112,12 +109,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobKOctetsProcessed, the category is class
- * JobKOctetsProcessed itself.
+ * <p>
+ * For class {@code JobKOctetsProcessed}, the category is class
+ * {@code JobKOctetsProcessed} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctetsProcessed.class;
@@ -126,14 +123,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobKOctetsProcessed, the category name is
+ * <p>
+ * For class {@code JobKOctetsProcessed}, the category name is
* {@code "job-k-octets-processed"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-k-octets-processed";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,25 +30,28 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class JobKOctetsSupported is a printing attribute class, a set of integers,
- * that gives the supported values for a {@link JobKOctets JobKOctets}
+ * Class {@code JobKOctetsSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a {@link JobKOctets JobKOctets}
* attribute. It is restricted to a single contiguous range of integers;
* multiple non-overlapping ranges are not allowed. This gives the lower and
* upper bounds of the total sizes of print jobs in units of K octets (1024
* octets) that the printer will accept.
- * <P>
- * <B>IPP Compatibility:</B> The JobKOctetsSupported attribute's canonical array
- * form gives the lower and upper bound for the range of values to be included
- * in an IPP "job-k-octets-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * <p>
+ * <b>IPP Compatibility:</b> The {@code JobKOctetsSupported} attribute's
+ * canonical array form gives the lower and upper bound for the range of values
+ * to be included in an IPP "job-k-octets-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobKOctetsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2867871140549897443L;
/**
@@ -55,13 +59,11 @@
* range of integers. That is, only those values of JobKOctets in the one
* range are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 0.
+ * @param lowerBound Lower bound of the range
+ * @param upperBound Upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than zero
*/
public JobKOctetsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -77,20 +79,16 @@
* Returns whether this job K octets supported attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobKOctetsSupported.
- * <LI>
- * This job K octets supported attribute's members and
- * {@code object}'s members are the same.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobKOctetsSupported}.
+ * <li>This job K octets supported attribute's members and
+ * {@code object}'s members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job K
- * octets supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job K octets
+ * supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -100,12 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobKOctetsSupported, the category is class
- * JobKOctetsSupported itself.
+ * <p>
+ * For class {@code JobKOctetsSupported}, the category is class
+ * {@code JobKOctetsSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctetsSupported.class;
@@ -114,14 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobKOctetsSupported, the category name is
+ * <p>
+ * For class {@code JobKOctetsSupported}, the category name is
* {@code "job-k-octets-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-k-octets-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,63 +22,62 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobMediaSheets is an integer valued printing attribute class that
- * specifies the total number of media sheets to be produced for this job.
- * <P>
- * The JobMediaSheets attribute describes the size of the job. This attribute is
- * not intended to be a counter; it is intended to be useful routing and
- * scheduling information if known. The printer may try to compute the
- * JobMediaSheets attribute's value if it is not supplied in the Print Request.
- * Even if the client does supply a value for the JobMediaSheets attribute in
- * the Print Request, the printer may choose to change the value if the printer
- * is able to compute a value which is more accurate than the client supplied
- * value. The printer may be able to determine the correct value for the
- * JobMediaSheets attribute either right at job submission time or at any later
- * point in time.
- * <P>
- * Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions
- * JobImpressions} attributes, the JobMediaSheets value must include the
- * multiplicative factors contributed by the number of copies specified by the
- * {@link Copies Copies} attribute and a "number of copies" instruction embedded
- * in the document data, if any. This difference allows the system administrator
- * to control the lower and upper bounds of both (1) the size of the document(s)
- * with {@link JobKOctetsSupported JobKOctetsSupported} and {@link
- * JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job
- * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * Class {@code JobMediaSheets} is an integer valued printing attribute class
+ * that specifies the total number of media sheets to be produced for this job.
+ * <p>
+ * The {@code JobMediaSheets} attribute describes the size of the job. This
+ * attribute is not intended to be a counter; it is intended to be useful
+ * routing and scheduling information if known. The printer may try to compute
+ * the {@code JobMediaSheets} attribute's value if it is not supplied in the
+ * Print Request. Even if the client does supply a value for the
+ * {@code JobMediaSheets} attribute in the Print Request, the printer may choose
+ * to change the value if the printer is able to compute a value which is more
+ * accurate than the client supplied value. The printer may be able to determine
+ * the correct value for the {@code JobMediaSheets} attribute either right at
+ * job submission time or at any later point in time.
+ * <p>
+ * Unlike the {@link JobKOctets JobKOctets} and
+ * {@link JobImpressions JobImpressions} attributes, the {@code JobMediaSheets}
+ * value must include the multiplicative factors contributed by the number of
+ * copies specified by the {@link Copies Copies} attribute and a "number of
+ * copies" instruction embedded in the document data, if any. This difference
+ * allows the system administrator to control the lower and upper bounds of both
+ * (1) the size of the document(s) with
+ * {@link JobKOctetsSupported JobKOctetsSupported} and
+ * {@link JobImpressionsSupported JobImpressionsSupported} and (2) the size of
+ * the job with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobMediaSheetsSupported
* @see JobMediaSheetsCompleted
* @see JobKOctets
* @see JobImpressions
- *
- * @author Alan Kaminsky
*/
public class JobMediaSheets extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
-
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 408871131531979741L;
/**
- * Construct a new job media sheets attribute with the given integer
- * value.
+ * Construct a new job media sheets attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public JobMediaSheets(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -88,20 +87,16 @@
* Returns whether this job media sheets attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobMediaSheets.
- * <LI>
- * This job media sheets attribute's value and {@code object}'s
- * value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobMediaSheets}.
+ * <li>This job media sheets attribute's value and {@code object}'s value
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job media
- * sheets attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job media
+ * sheets attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return super.equals(object) && object instanceof JobMediaSheets;
@@ -110,12 +105,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobMediaSheets and any vendor-defined subclasses, the category
- * is class JobMediaSheets itself.
+ * <p>
+ * For class {@code JobMediaSheets} and any vendor-defined subclasses, the
+ * category is class {@code JobMediaSheets} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheets.class;
@@ -124,14 +119,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobMediaSheets and any vendor-defined subclasses, the
+ * <p>
+ * For class {@code JobMediaSheets} and any vendor-defined subclasses, the
* category name is {@code "job-media-sheets"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-media-sheets";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,46 +30,46 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobMediaSheetsCompleted is an integer valued printing attribute class
- * that specifies the number of media sheets which have completed marking and
- * stacking for the entire job so far, whether those sheets have been processed
- * on one side or on both.
- * <P>
- * The JobMediaSheetsCompleted attribute describes the progress of the job. This
- * attribute is intended to be a counter. That is, the JobMediaSheetsCompleted
- * value for a job that has not started processing must be 0. When the job's
- * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
- * JobMediaSheetsCompleted value is intended to increase as the job is
+ * Class {@code JobMediaSheetsCompleted} is an integer valued printing attribute
+ * class that specifies the number of media sheets which have completed marking
+ * and stacking for the entire job so far, whether those sheets have been
+ * processed on one side or on both.
+ * <p>
+ * The {@code JobMediaSheetsCompleted} attribute describes the progress of the
+ * job. This attribute is intended to be a counter. That is, the
+ * {@code JobMediaSheetsCompleted} value for a job that has not started
+ * processing must be 0. When the job's {@link JobState JobState} is
+ * {@code PROCESSING} or {@code PROCESSING_STOPPED}, the
+ * {@code JobMediaSheetsCompleted} value is intended to increase as the job is
* processed; it indicates the amount of the job that has been processed at the
* time the Print Job's attribute set is queried or at the time a print job
- * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
- * states, the JobMediaSheetsCompleted value is the final value for the job.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * event is reported. When the job enters the {@code COMPLETED},
+ * {@code CANCELED}, or {@code ABORTED} states, the
+ * {@code JobMediaSheetsCompleted} value is the final value for the job.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
+ * @author Alan Kaminsky
* @see JobMediaSheets
* @see JobMediaSheetsSupported
* @see JobKOctetsProcessed
* @see JobImpressionsCompleted
- *
- * @author Alan Kaminsky
*/
public final class JobMediaSheetsCompleted extends IntegerSyntax
implements PrintJobAttribute {
-
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 1739595973810840475L;
/**
* Construct a new job media sheets completed attribute with the given
* integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public JobMediaSheetsCompleted(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -78,20 +79,17 @@
* Returns whether this job media sheets completed attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobMediaSheetsCompleted.
- * <LI>
- * This job media sheets completed attribute's value and
- * {@code object}'s value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobMediaSheetsCompleted}.
+ * <li>This job media sheets completed attribute's value and
+ * {@code object}'s value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job media
- * sheets completed attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job media
+ * sheets completed attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -101,12 +99,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobMediaSheetsCompleted, the category is class
- * JobMediaSheetsCompleted itself.
+ * <p>
+ * For class {@code JobMediaSheetsCompleted}, the category is class
+ * {@code JobMediaSheetsCompleted} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheetsCompleted.class;
@@ -115,11 +113,11 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobMediaSheetsCompleted, the category name is
+ * <p>
+ * For class {@code JobMediaSheetsCompleted}, the category name is
* {@code "job-media-sheets-completed"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-media-sheets-completed";
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,39 +30,40 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class JobMediaSheetsSupported is a printing attribute class, a set of
- * integers, that gives the supported values for a {@link JobMediaSheets
- * JobMediaSheets} attribute. It is restricted to a single contiguous range of
- * integers; multiple non-overlapping ranges are not allowed. This gives the
- * lower and upper bounds of the total sizes of print jobs in number of media
- * sheets that the printer will accept.
- * <P>
- * <B>IPP Compatibility:</B> The JobMediaSheetsSupported attribute's canonical
- * array form gives the lower and upper bound for the range of values to be
- * included in an IPP "job-media-sheets-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * Class {@code JobMediaSheetsSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a
+ * {@link JobMediaSheets JobMediaSheets} attribute. It is restricted to a single
+ * contiguous range of integers; multiple non-overlapping ranges are not
+ * allowed. This gives the lower and upper bounds of the total sizes of print
+ * jobs in number of media sheets that the printer will accept.
+ * <p>
+ * <b>IPP Compatibility:</b> The {@code JobMediaSheetsSupported} attribute's
+ * canonical array form gives the lower and upper bound for the range of values
+ * to be included in an IPP "job-media-sheets-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobMediaSheetsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2953685470388672940L;
/**
* Construct a new job media sheets supported attribute containing a single
- * range of integers. That is, only those values of JobMediaSheets in the
- * one range are supported.
+ * range of integers. That is, only those values of {@code JobMediaSheets}
+ * in the one range are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 0.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than zero
*/
public JobMediaSheetsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -77,20 +79,17 @@
* Returns whether this job media sheets supported attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobMediaSheetsSupported.
- * <LI>
- * This job media sheets supported attribute's members and
- * {@code object}'s members are the same.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobMediaSheetsSupported}.
+ * <li>This job media sheets supported attribute's members and
+ * {@code object}'s members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job media
- * sheets supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job media
+ * sheets supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -100,12 +99,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobMediaSheetsSupported, the
- * category is class JobMediaSheetsSupported itself.
+ * <p>
+ * For class {@code JobMediaSheetsSupported}, the category is class
+ * {@code JobMediaSheetsSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheetsSupported.class;
@@ -114,14 +113,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobMediaSheetsSupported, the
- * category name is {@code "job-media-sheets-supported"}.
+ * <p>
+ * For class {@code JobMediaSheetsSupported}, the category name is
+ * {@code "job-media-sheets-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-media-sheets-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,50 +22,53 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobMessageFromOperator is a printing attribute class, a text attribute,
- * that provides a message from an operator, system administrator, or
+ * Class {@code JobMessageFromOperator} is a printing attribute class, a text
+ * attribute, that provides a message from an operator, system administrator, or
* "intelligent" process to indicate to the end user the reasons for
* modification or other management action taken on a job.
- * <P>
+ * <p>
* A Print Job's attribute set includes zero instances or one instance of a
- * JobMessageFromOperator attribute, not more than one instance. A new
- * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
- * attribute, if any. In other words, JobMessageFromOperator is not intended to
- * be a history log. If it wishes, the client can detect changes to a Print
- * Job's JobMessageFromOperator attribute and maintain the client's own history
- * log of the JobMessageFromOperator attribute values.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * {@code JobMessageFromOperator} attribute, not more than one instance. A new
+ * {@code JobMessageFromOperator} attribute replaces an existing
+ * {@code JobMessageFromOperator} attribute, if any. In other words,
+ * {@code JobMessageFromOperator} is not intended to be a history log. If it
+ * wishes, the client can detect changes to a Print Job's
+ * {@code JobMessageFromOperator} attribute and maintain the client's own
+ * history log of the {@code JobMessageFromOperator} attribute values.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobMessageFromOperator extends TextSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4620751846003142047L;
/**
* Constructs a new job message from operator attribute with the given
* message and locale.
*
- * @param message Message.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code message} is null.
+ * @param message the message
+ * @param locale Natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code message} is {@code null}
*/
public JobMessageFromOperator(String message, Locale locale) {
super (message, locale);
@@ -75,23 +78,19 @@
* Returns whether this job message from operator attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobMessageFromOperator.
- * <LI>
- * This job message from operator attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This job message from operator attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobMessageFromOperator}.
+ * <li>This job message from operator attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This job message from operator attribute's locale and
+ * {@code object}'s locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * message from operator attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job message
+ * from operator attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -101,12 +100,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobMessageFromOperator, the
- * category is class JobMessageFromOperator itself.
+ * <p>
+ * For class {@code JobMessageFromOperator}, the category is class
+ * {@code JobMessageFromOperator} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobMessageFromOperator.class;
@@ -115,14 +114,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobMessageFromOperator, the
- * category name is {@code "job-message-from-operator"}.
+ * <p>
+ * For class {@code JobMessageFromOperator}, the category name is
+ * {@code "job-message-from-operator"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-message-from-operator";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,50 +22,53 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
-import javax.print.attribute.TextSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.TextSyntax;
/**
- * Class JobName is a printing attribute class, a text attribute, that specifies
- * the name of a print job. A job's name is an arbitrary string defined by the
- * client. It does not need to be unique between different jobs. A Print Job's
- * JobName attribute is set to the value supplied by the client in the Print
- * Request's attribute set. If, however, the client does not supply a JobName
- * attribute in the Print Request, the printer, when it creates the Print Job,
- * must generate a JobName. The printer should generate the value of the Print
- * Job's JobName attribute from the first of the following sources that produces
- * a value: (1) the {@link DocumentName DocumentName} attribute of the first (or
- * only) doc in the job, (2) the URL of the first (or only) doc in the job, if
- * the doc's print data representation object is a URL, or (3) any other piece
- * of Print Job specific and/or document content information.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code JobName} is a printing attribute class, a text attribute, that
+ * specifies the name of a print job. A job's name is an arbitrary string
+ * defined by the client. It does not need to be unique between different jobs.
+ * A Print Job's {@code JobName} attribute is set to the value supplied by the
+ * client in the Print Request's attribute set. If, however, the client does not
+ * supply a {@code JobName} attribute in the Print Request, the printer, when it
+ * creates the Print Job, must generate a {@code JobName}. The printer should
+ * generate the value of the Print Job's {@code JobName} attribute from the
+ * first of the following sources that produces a value: (1) the
+ * {@link DocumentName DocumentName} attribute of the first (or only) doc in the
+ * job, (2) the {@code URL} of the first (or only) doc in the job, if the doc's
+ * print data representation object is a {@code URL}, or (3) any other piece of
+ * Print Job specific and/or document content information.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobName extends TextSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4660359192078689545L;
/**
* Constructs a new job name attribute with the given job name and locale.
*
- * @param jobName Job name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code jobName} is null.
+ * @param jobName job name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code jobName} is {@code null}
*/
public JobName(String jobName, Locale locale) {
super (jobName, locale);
@@ -74,23 +77,18 @@
/**
* Returns whether this job name attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobName.
- * <LI>
- * This job name attribute's underlying string and {@code object}'s
- * underlying string are equal.
- * <LI>
- * This job name attribute's locale and {@code object}'s locale are
- * equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobName}.
+ * <li>This job name attribute's underlying string and {@code object}'s
+ * underlying string are equal.
+ * <li>This job name attribute's locale and {@code object}'s locale are
+ * equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job name
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job name
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof JobName);
@@ -99,11 +97,11 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobName, the category is class JobName itself.
+ * <p>
+ * For class {@code JobName}, the category is class {@code JobName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobName.class;
@@ -112,13 +110,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobName, the category name is {@code "job-name"}.
+ * <p>
+ * For class {@code JobName}, the category name is {@code "job-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-name";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,50 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobOriginatingUserName is a printing attribute class, a text
- * attribute, that contains the name of the end user that submitted the
- * print job. If possible, the printer sets this attribute to the most
- * authenticated printable user name that it can obtain from the
- * authentication service that authenticated the submitted Print Request.
- * If such is not available, the printer uses the value of the
- * {@link RequestingUserName RequestingUserName}
- * attribute supplied by the client in the Print Request's attribute set.
- * If no authentication service is available, and the client did not supply
- * a {@link RequestingUserName RequestingUserName} attribute,
- * the printer sets the JobOriginatingUserName attribute to an empty
- * (zero-length) string.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code JobOriginatingUserName} is a printing attribute class, a text
+ * attribute, that contains the name of the end user that submitted the print
+ * job. If possible, the printer sets this attribute to the most authenticated
+ * printable user name that it can obtain from the authentication service that
+ * authenticated the submitted Print Request. If such is not available, the
+ * printer uses the value of the {@link RequestingUserName RequestingUserName}
+ * attribute supplied by the client in the Print Request's attribute set. If no
+ * authentication service is available, and the client did not supply a
+ * {@link RequestingUserName RequestingUserName} attribute, the printer sets the
+ * JobOriginatingUserName attribute to an empty (zero-length) string.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobOriginatingUserName extends TextSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8052537926362933477L;
/**
- * Constructs a new job originating user name attribute with the given
- * user name and locale.
+ * Constructs a new job originating user name attribute with the given user
+ * name and locale.
*
- * @param userName User name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code userName} is null.
+ * @param userName user name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code userName} is {@code null}
*/
public JobOriginatingUserName(String userName, Locale locale) {
super (userName, locale);
@@ -75,23 +75,19 @@
* Returns whether this job originating user name attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobOriginatingUserName.
- * <LI>
- * This job originating user name attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This job originating user name attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobOriginatingUserName}.
+ * <li>This job originating user name attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This job originating user name attribute's locale and
+ * {@code object}'s locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * originating user name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job
+ * originating user name attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -101,12 +97,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobOriginatingUserName, the
- * category is class JobOriginatingUserName itself.
+ * <p>
+ * For class {@code JobOriginatingUserName}, the category is class
+ * {@code JobOriginatingUserName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobOriginatingUserName.class;
@@ -115,14 +111,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobOriginatingUserName, the
- * category name is {@code "job-originating-user-name"}.
+ * <p>
+ * For class {@code JobOriginatingUserName}, the category name is
+ * {@code "job-originating-user-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-originating-user-name";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,54 +22,55 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobPriority is an integer valued printing attribute class that
+ * Class {@code JobPriority} is an integer valued printing attribute class that
* specifies a print job's priority.
- * <P>
- * If a JobPriority attribute is specified for a Print Job, it specifies a
- * priority for scheduling the job. A higher value specifies a higher priority.
- * The value 1 indicates the lowest possible priority. The value 100 indicates
- * the highest possible priority. Among those jobs that are ready to print, a
- * printer must print all jobs with a priority value of <I>n</I> before printing
- * those with a priority value of <I>n</I>-1 for all <I>n.</I>
- * <P>
- * If the client does not specify a JobPriority attribute for a Print Job and
- * the printer does support the JobPriority attribute, the printer must use an
- * implementation-defined default JobPriority value.
- * <P>
+ * <p>
+ * If a {@code JobPriority} attribute is specified for a Print Job, it specifies
+ * a priority for scheduling the job. A higher value specifies a higher
+ * priority. The value 1 indicates the lowest possible priority. The value 100
+ * indicates the highest possible priority. Among those jobs that are ready to
+ * print, a printer must print all jobs with a priority value of <i>n</i> before
+ * printing those with a priority value of <i>n</i>-1 for all <i>n.</i>
+ * <p>
+ * If the client does not specify a {@code JobPriority} attribute for a Print
+ * Job and the printer does support the JobPriority attribute, the printer must
+ * use an implementation-defined default JobPriority value.
+ * <p>
* The client can always specify any job priority value from 1 to 100 for a job.
- * However, a Print Service instance may support fewer than 100 different
- * job priority levels. If this is the case, the Print Service instance
+ * However, a Print Service instance may support fewer than 100 different job
+ * priority levels. If this is the case, the Print Service instance
* automatically maps the client-specified job priority value to one of the
* supported job priority levels, dividing the 100 job priority values equally
* among the available job priority levels.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobPriority extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4599900369040602769L;
/**
* Construct a new job priority attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 1
- * or greater than 100.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is less than 1 or
+ * greater than 100
*/
public JobPriority(int value) {
super (value, 1, 100);
@@ -79,20 +80,16 @@
* Returns whether this job priority attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobPriority.
- * <LI>
- * This job priority attribute's value and {@code object}'s value
- * are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code JobPriority}.
+ * <li>This job priority attribute's value and {@code object}'s value are
+ * equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * priority attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job priority
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) && object instanceof JobPriority);
@@ -101,11 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobPriority, the category is class JobPriority itself.
+ * <p>
+ * For class {@code JobPriority}, the category is class
+ * {@code JobPriority} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobPriority.class;
@@ -114,13 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobPriority, the category name is {@code "job-priority"}.
+ * <p>
+ * For class {@code JobPriority}, the category name is
+ * {@code "job-priority"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-priority";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,39 +30,38 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class JobPrioritySupported is an integer valued printing attribute class
- * that specifies whether a Print Service instance supports the {@link
- * JobPriority JobPriority} attribute and the number of different job priority
- * levels supported.
- * <P>
- * The client can always specify any {@link JobPriority JobPriority} value
- * from 1 to 100 for a job. However, the Print Service instance may support
- * fewer than 100 different job priority levels. If this is the case, the
- * Print Service instance automatically maps the client-specified job priority
- * value to one of the supported job priority levels, dividing the 100 job
- * priority values equally among the available job priority levels.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * Class {@code JobPrioritySupported} is an integer valued printing attribute
+ * class that specifies whether a Print Service instance supports the
+ * {@link JobPriority JobPriority} attribute and the number of different job
+ * priority levels supported.
+ * <p>
+ * The client can always specify any {@link JobPriority JobPriority} value from
+ * 1 to 100 for a job. However, the Print Service instance may support fewer
+ * than 100 different job priority levels. If this is the case, the Print
+ * Service instance automatically maps the client-specified job priority value
+ * to one of the supported job priority levels, dividing the 100 job priority
+ * values equally among the available job priority levels.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobPrioritySupported extends IntegerSyntax
implements SupportedValuesAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2564840378013555894L;
-
/**
* Construct a new job priority supported attribute with the given integer
* value.
*
- * @param value Number of different job priority levels supported.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 1
- * or greater than 100.
+ * @param value number of different job priority levels supported
+ * @throws IllegalArgumentException if {@code value} is less than 1 or
+ * greater than 100
*/
public JobPrioritySupported(int value) {
super (value, 1, 100);
@@ -71,20 +71,17 @@
* Returns whether this job priority supported attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class JobPrioritySupported.
- * <LI>
- * This job priority supported attribute's value and
- * {@code object}'s value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code JobPrioritySupported}.
+ * <li>This job priority supported attribute's value and {@code object}'s
+ * value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this job
- * priority supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this job priority
+ * supported attribute, {@code false} otherwise
*/
public boolean equals (Object object) {
@@ -92,16 +89,15 @@
object instanceof JobPrioritySupported);
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobPrioritySupported, the
- * category is class JobPrioritySupported itself.
+ * <p>
+ * For class {@code JobPrioritySupported}, the category is class
+ * {@code JobPrioritySupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobPrioritySupported.class;
@@ -110,14 +106,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobPrioritySupported, the
- * category name is {@code "job-priority-supported"}.
+ * <p>
+ * For class {@code JobPrioritySupported}, the category name is
+ * {@code "job-priority-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-priority-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,39 +22,40 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
-
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobSheets is a printing attribute class, an enumeration, that
+ * Class {@code JobSheets} is a printing attribute class, an enumeration, that
* determines which job start and end sheets, if any, must be printed with a
- * job. Class JobSheets declares keywords for standard job sheets values.
- * Implementation- or site-defined names for a job sheets attribute may also be
- * created by defining a subclass of class JobSheets.
- * <P>
- * The effect of a JobSheets attribute on multidoc print jobs (jobs with
- * multiple documents) may be affected by the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} job attribute, depending on the meaning of the
- * particular JobSheets value.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The
- * enumeration's integer value is the IPP enum value. The
- * {@code toString()} method returns the IPP string representation of
- * the attribute value. For a subclass, the attribute value must be
- * localized to give the IPP name and natural language values.
+ * job. Class {@code JobSheets} declares keywords for standard job sheets
+ * values. Implementation- or site-defined names for a job sheets attribute may
+ * also be created by defining a subclass of class {@code JobSheets}.
+ * <p>
+ * The effect of a {@code JobSheets} attribute on multidoc print jobs (jobs with
+ * multiple documents) may be affected by the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} job attribute,
+ * depending on the meaning of the particular {@code JobSheets} value.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value. For a subclass, the attribute value must be localized to
+ * give the IPP name and natural language values.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class JobSheets extends EnumSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4735258056132519759L;
/**
@@ -63,9 +64,8 @@
public static final JobSheets NONE = new JobSheets(0);
/**
- * One or more site specific standard job sheets are printed. e.g. a
- * single start sheet is printed, or both start and end sheets are
- * printed.
+ * One or more site specific standard job sheets are printed. e.g. a single
+ * start sheet is printed, or both start and end sheets are printed.
*/
public static final JobSheets STANDARD = new JobSheets(1);
@@ -73,31 +73,37 @@
* Construct a new job sheets enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected JobSheets(int value) {
super (value);
}
+ /**
+ * The string table for class {@code JobSheets}.
+ */
private static final String[] myStringTable = {
"none",
"standard"
};
+ /**
+ * The enumeration value table for class {@code JobSheets}.
+ */
private static final JobSheets[] myEnumValueTable = {
NONE,
STANDARD
};
/**
- * Returns the string table for class JobSheets.
+ * Returns the string table for class {@code JobSheets}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class JobSheets.
+ * Returns the enumeration value table for class {@code JobSheets}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -106,12 +112,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobSheets and any vendor-defined subclasses, the category is
- * class JobSheets itself.
+ * <p>
+ * For class {@code JobSheets} and any vendor-defined subclasses, the
+ * category is class {@code JobSheets} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobSheets.class;
@@ -120,14 +126,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobSheets and any vendor-defined subclasses, the category
- * name is {@code "job-sheets"}.
+ * <p>
+ * For class {@code JobSheets} and any vendor-defined subclasses, the
+ * category name is {@code "job-sheets"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-sheets";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,24 +30,27 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * JobState is a printing attribute class, an enumeration, that identifies
- * the current state of a print job. Class JobState defines standard job state
- * values. A Print Service implementation only needs to report those job
- * states which are appropriate for the particular implementation; it does not
- * have to report every defined job state. The {@link JobStateReasons
- * JobStateReasons} attribute augments the JobState attribute to give more
- * detailed information about the job in the given job state.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * {@code JobState} is a printing attribute class, an enumeration, that
+ * identifies the current state of a print job. Class {@code JobState} defines
+ * standard job state values. A Print Service implementation only needs to
+ * report those job states which are appropriate for the particular
+ * implementation; it does not have to report every defined job state. The
+ * {@link JobStateReasons JobStateReasons} attribute augments the
+ * {@code JobState} attribute to give more detailed information about the job in
+ * the given job state.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
-
public class JobState extends EnumSyntax implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 400465010094018920L;
/**
@@ -62,61 +65,57 @@
/**
* The job is not a candidate for processing for any number of reasons but
- * will return to the PENDING state as soon as the reasons are no longer
- * present. The job's {@link JobStateReasons JobStateReasons} attribute must
- * indicate why the job is no longer a candidate for processing.
+ * will return to the {@code PENDING} state as soon as the reasons are no
+ * longer present. The job's {@link JobStateReasons JobStateReasons}
+ * attribute must indicate why the job is no longer a candidate for
+ * processing.
*/
public static final JobState PENDING_HELD = new JobState(4);
/**
* The job is processing. One or more of the following activities is
* occurring:
- * <OL TYPE=1>
- * <LI>
- * The job is using, or is attempting to use, one or more purely software
- * processes that are analyzing, creating, or interpreting a PDL, etc.
- *
- * <LI>
- * The job is using, or is attempting to use, one or more hardware
- * devices that are interpreting a PDL, making marks on a medium, and/or
- * performing finishing, such as stapling, etc.
- *
- * <LI>
- * The printer has made the job ready for printing, but the output
- * device is not yet printing it, either because the job hasn't reached the
- * output device or because the job is queued in the output device or some
- * other spooler, awaiting the output device to print it.
- * </OL>
- * <P>
- * When the job is in the PROCESSING state, the entire job state includes
- * the detailed status represented in the printer's {@link PrinterState
- * PrinterState} and {@link PrinterStateReasons PrinterStateReasons}
- * attributes.
- * <P>
+ * <ol type=1>
+ * <li>The job is using, or is attempting to use, one or more purely
+ * software processes that are analyzing, creating, or interpreting a PDL,
+ * etc.
+ * <li>The job is using, or is attempting to use, one or more hardware
+ * devices that are interpreting a PDL, making marks on a medium, and/or
+ * performing finishing, such as stapling, etc.
+ * <li>The printer has made the job ready for printing, but the output
+ * device is not yet printing it, either because the job hasn't reached
+ * the output device or because the job is queued in the output device or
+ * some other spooler, awaiting the output device to print it.
+ * </ol>
+ * When the job is in the {@code PROCESSING} state, the entire job state
+ * includes the detailed status represented in the printer's
+ * {@link PrinterState PrinterState} and
+ * {@link PrinterStateReasons PrinterStateReasons} attributes.
+ * <p>
* Implementations may, though they need not, include additional values in
* the job's {@link JobStateReasons JobStateReasons} attribute to indicate
- * the progress of the job, such as adding the JOB_PRINTING value to
+ * the progress of the job, such as adding the {@code JOB_PRINTING} value to
* indicate when the output device is actually making marks on paper and/or
- * the PROCESSING_TO_STOP_POINT value to indicate that the printer is in the
- * process of canceling or aborting the job.
+ * the {@code PROCESSING_TO_STOP_POINT} value to indicate that the printer
+ * is in the process of canceling or aborting the job.
*/
public static final JobState PROCESSING = new JobState (5);
/**
* The job has stopped while processing for any number of reasons and will
- * return to the PROCESSING state as soon as the reasons are no longer
- * present.
- * <P>
+ * return to the {@code PROCESSING} state as soon as the reasons are no
+ * longer present.
+ * <p>
* The job's {@link JobStateReasons JobStateReasons} attribute may indicate
* why the job has stopped processing. For example, if the output device is
- * stopped, the PRINTER_STOPPED value may be included in the job's {@link
- * JobStateReasons JobStateReasons} attribute.
- * <P>
- * <I>Note:</I> When an output device is stopped, the device usually
+ * stopped, the {@code PRINTER_STOPPED} value may be included in the job's
+ * {@link JobStateReasons JobStateReasons} attribute.
+ * <p>
+ * <i>Note:</i> When an output device is stopped, the device usually
* indicates its condition in human readable form locally at the device. A
* client can obtain more complete device status remotely by querying the
- * printer's {@link PrinterState PrinterState} and {@link
- * PrinterStateReasons PrinterStateReasons} attributes.
+ * printer's {@link PrinterState PrinterState} and
+ * {@link PrinterStateReasons PrinterStateReasons} attributes.
*/
public static final JobState PROCESSING_STOPPED = new JobState (6);
@@ -125,24 +124,27 @@
* canceling the job, and all job status attributes have reached their final
* values for the job. While the printer is canceling the job, the job
* remains in its current state, but the job's {@link JobStateReasons
- * JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT
- * value and one of the CANCELED_BY_USER, CANCELED_BY_OPERATOR, or
- * CANCELED_AT_DEVICE values. When the job moves to the CANCELED state, the
- * PROCESSING_TO_STOP_POINT value, if present, must be removed, but the
- * CANCELED_BY_<I>xxx</I> value, if present, must remain.
+ * JobStateReasons} attribute should contain the
+ * {@code PROCESSING_TO_STOP_POINT} value and one of the
+ * {@code CANCELED_BY_USER}, {@code CANCELED_BY_OPERATOR}, or
+ * {@code CANCELED_AT_DEVICE} values. When the job moves to the
+ * {@code CANCELED} state, the {@code PROCESSING_TO_STOP_POINT} value, if
+ * present, must be removed, but the CANCELED_BY_<i>xxx</i> value, if
+ * present, must remain.
*/
public static final JobState CANCELED = new JobState (7);
/**
* The job has been aborted by the system (usually while the job was in the
- * PROCESSING or PROCESSING_STOPPED state), the printer has completed
- * aborting the job, and all job status attributes have reached their final
- * values for the job. While the printer is aborting the job, the job
- * remains in its current state, but the job's {@link JobStateReasons
- * JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT
- * and ABORTED_BY_SYSTEM values. When the job moves to the ABORTED state,
- * the PROCESSING_TO_STOP_POINT value, if present, must be removed, but the
- * ABORTED_BY_SYSTEM value, if present, must remain.
+ * {@code PROCESSING} or {@code PROCESSING_STOPPED} state), the printer has
+ * completed aborting the job, and all job status attributes have reached
+ * their final values for the job. While the printer is aborting the job,
+ * the job remains in its current state, but the job's
+ * {@link JobStateReasons JobStateReasons} attribute should contain the
+ * {@code PROCESSING_TO_STOP_POINT} and {@code ABORTED_BY_SYSTEM} values.
+ * When the job moves to the {@code ABORTED} state, the
+ * {@code PROCESSING_TO_STOP_POINT} value, if present, must be removed, but
+ * the {@code ABORTED_BY_SYSTEM} value, if present, must remain.
*/
public static final JobState ABORTED = new JobState (8);
@@ -150,10 +152,10 @@
* The job has completed successfully or with warnings or errors after
* processing, all of the job media sheets have been successfully stacked in
* the appropriate output bin(s), and all job status attributes have reached
- * their final values for the job. The job's {@link JobStateReasons
- * JobStateReasons} attribute should contain one of these values:
- * COMPLETED_SUCCESSFULLY, COMPLETED_WITH_WARNINGS, or
- * COMPLETED_WITH_ERRORS.
+ * their final values for the job. The job's
+ * {@link JobStateReasons JobStateReasons} attribute should contain one of
+ * these values: {@code COMPLETED_SUCCESSFULLY},
+ * {@code COMPLETED_WITH_WARNINGS}, or {@code COMPLETED_WITH_ERRORS}.
*/
public static final JobState COMPLETED = new JobState (9);
@@ -162,12 +164,15 @@
/**
* Construct a new job state enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected JobState(int value) {
super (value);
}
+ /**
+ * The string table for class {@code JobState}.
+ */
private static final String[] myStringTable =
{"unknown",
null,
@@ -180,6 +185,9 @@
"aborted",
"completed"};
+ /**
+ * The enumeration value table for class {@code JobState}.
+ */
private static final JobState[] myEnumValueTable =
{UNKNOWN,
null,
@@ -193,14 +201,14 @@
COMPLETED};
/**
- * Returns the string table for class JobState.
+ * Returns the string table for class {@code JobState}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class JobState.
+ * Returns the enumeration value table for class {@code JobState}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -209,12 +217,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobState and any vendor-defined subclasses, the category is
- * class JobState itself.
+ * <p>
+ * For class {@code JobState} and any vendor-defined subclasses, the
+ * category is class {@code JobState} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobState.class;
@@ -223,14 +231,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobState and any vendor-defined subclasses, the category
- * name is {@code "job-state"}.
+ * <p>
+ * For class {@code JobState} and any vendor-defined subclasses, the
+ * category name is {@code "job-state"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-state";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,40 +22,45 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class JobStateReason is a printing attribute class, an enumeration, that
- * provides additional information about the job's current state, i.e.,
+ * Class {@code JobStateReason} is a printing attribute class, an enumeration,
+ * that provides additional information about the job's current state, i.e.,
* information that augments the value of the job's {@link JobState JobState}
- * attribute. Class JobStateReason defines standard job state reason values. A
- * Print Service implementation only needs to report those job state
+ * attribute. Class {@code JobStateReason} defines standard job state reason
+ * values. A Print Service implementation only needs to report those job state
* reasons which are appropriate for the particular implementation; it does not
* have to report every defined job state reason.
- * <P>
- * Instances of JobStateReason do not appear in a Print Job's attribute set
- * directly. Rather, a {@link JobStateReasons JobStateReasons} attribute appears
- * in the Print Job's attribute set. The {@link JobStateReasons JobStateReasons}
- * attribute contains zero, one, or more than one JobStateReason objects which
- * pertain to the Print Job's status. The printer adds a JobStateReason object
- * to the Print Job's {@link JobStateReasons JobStateReasons} attribute when the
- * corresponding condition becomes true of the Print Job, and the printer
- * removes the JobStateReason object again when the corresponding condition
- * becomes false, regardless of whether the Print Job's overall {@link JobState
- * JobState} also changed.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * <p>
+ * Instances of {@code JobStateReason} do not appear in a Print Job's attribute
+ * set directly. Rather, a {@link JobStateReasons JobStateReasons} attribute
+ * appears in the Print Job's attribute set. The
+ * {@link JobStateReasons JobStateReasons} attribute contains zero, one, or more
+ * than one {@code JobStateReason} objects which pertain to the Print Job's
+ * status. The printer adds a JobStateReason object to the Print Job's
+ * {@link JobStateReasons JobStateReasons} attribute when the corresponding
+ * condition becomes true of the Print Job, and the printer removes the
+ * {@code JobStateReason} object again when the corresponding condition becomes
+ * false, regardless of whether the Print Job's overall
+ * {@link JobState JobState} also changed.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class JobStateReason extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8765894420449009168L;
/**
@@ -67,27 +72,29 @@
/**
* The printer has created the Print Job, but the printer is expecting
- * additional print data before it can move the job into the PROCESSING
- * state. If a printer starts processing before it has received all data,
- * the printer removes the JOB_DATA_INSUFFICIENT reason, but the
- * JOB_INCOMING reason remains. If a printer starts processing after it
- * has received all data, the printer removes the JOB_DATA_INSUFFICIENT
- * and JOB_INCOMING reasons at the same time.
+ * additional print data before it can move the job into the
+ * {@code PROCESSING} state. If a printer starts processing before it has
+ * received all data, the printer removes the {@code JOB_DATA_INSUFFICIENT}
+ * reason, but the {@code JOB_INCOMING} reason remains. If a printer starts
+ * processing after it has received all data, the printer removes the
+ * {@code JOB_DATA_INSUFFICIENT} and {@code JOB_INCOMING} reasons at the
+ * same time.
*/
public static final JobStateReason
JOB_DATA_INSUFFICIENT = new JobStateReason(1);
/**
- * The Printer could not access one or more documents passed by reference
- * (i.e., the print data representation object is a URL). This reason is
- * intended to cover any file access problem,including file does not exist
- * and access denied because of an access control problem. Whether the
- * printer aborts the job and moves the job to the ABORTED job state or
- * prints all documents that are accessible and moves the job to the
- * COMPLETED job state and adds the COMPLETED_WITH_ERRORS reason to the
- * job's {@link JobStateReasons JobStateReasons} attribute depends on
- * implementation and/or site policy. This value should be supported if
- * the printer supports doc flavors with URL print data representation
+ * The printer could not access one or more documents passed by reference
+ * (i.e., the print data representation object is a {@code URL}). This
+ * reason is intended to cover any file access problem,including file does
+ * not exist and access denied because of an access control problem. Whether
+ * the printer aborts the job and moves the job to the {@code ABORTED} job
+ * state or prints all documents that are accessible and moves the job to
+ * the {@code COMPLETED} job state and adds the
+ * {@code COMPLETED_WITH_ERRORS} reason to the job's
+ * {@link JobStateReasons JobStateReasons} attribute depends on
+ * implementation and/or site policy. This value should be supported if the
+ * printer supports doc flavors with {@code URL} print data representation
* objects.
*/
public static final JobStateReason
@@ -112,9 +119,8 @@
/**
* The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was
- * specified with a date-time that is still in the future. The job must
- * not be a candidate for processing until this reason is removed and
- * there are
+ * specified with a date-time that is still in the future. The job must not
+ * be a candidate for processing until this reason is removed and there are
* no other reasons to hold the job. This value should be supported if the
* {@link JobHoldUntil JobHoldUntil} job template attribute is supported.
*/
@@ -123,63 +129,64 @@
/**
* At least one of the resources needed by the job, such as media, fonts,
- * resource objects, etc., is not ready on any of the physical printers
- * for which the job is a candidate. This condition may be detected
- * when the job is accepted, or subsequently while the job is pending
- * or processing, depending on implementation.
- * The job may remain in its current state or
- * be moved to the PENDING_HELD state, depending on implementation and/or
- * job scheduling policy.
+ * resource objects, etc., is not ready on any of the physical printers for
+ * which the job is a candidate. This condition may be detected when the job
+ * is accepted, or subsequently while the job is pending or processing,
+ * depending on implementation. The job may remain in its current state or
+ * be moved to the {@code PENDING_HELD} state, depending on implementation
+ * and/or job scheduling policy.
*/
public static final JobStateReason
RESOURCES_ARE_NOT_READY = new JobStateReason(6);
/**
* The value of the printer's {@link PrinterStateReasons
- * PrinterStateReasons} attribute contains a {@link PrinterStateReason
- * PrinterStateReason} value of STOPPED_PARTLY.
+ * PrinterStateReasons} attribute contains a
+ * {@link PrinterStateReason PrinterStateReason} value of
+ * {@code STOPPED_PARTLY}.
*/
public static final JobStateReason
PRINTER_STOPPED_PARTLY = new JobStateReason(7);
/**
- * The value of the printer's {@link PrinterState PrinterState} attribute
- * ia STOPPED.
+ * The value of the printer's {@link PrinterState PrinterState} attribute ia
+ * {@code STOPPED}.
*/
public static final JobStateReason
PRINTER_STOPPED = new JobStateReason(8);
/**
- * The job is in the PROCESSING state, but more specifically, the printer
- * ia interpreting the document data.
+ * The job is in the {@code PROCESSING} state, but more specifically, the
+ * printer ia interpreting the document data.
*/
public static final JobStateReason
JOB_INTERPRETING = new JobStateReason(9);
/**
- * The job is in the PROCESSING state, but more specifically, the printer
- * has queued the document data.
+ * The job is in the {@code PROCESSING} state, but more specifically, the
+ * printer has queued the document data.
*/
public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
/**
- * The job is in the PROCESSING state, but more specifically, the printer
- * is interpreting document data and producing another electronic
+ * The job is in the {@code PROCESSING} state, but more specifically, the
+ * printer is interpreting document data and producing another electronic
* representation.
*/
public static final JobStateReason
JOB_TRANSFORMING = new JobStateReason(11);
/**
- * The job is in the PENDING_HELD, PENDING, or PROCESSING state, but more
- * specifically, the printer has completed enough processing of the document
- * to be able to start marking and the job is waiting for the marker.
- * Systems that require human intervention to release jobs put the job into
- * the PENDING_HELD job state. Systems that automatically select a job to
- * use the marker put the job into the PENDING job state or keep the job
- * in the PROCESSING job state while waiting for the marker, depending on
+ * The job is in the {@code PENDING_HELD}, {@code PENDING}, or
+ * {@code PROCESSING} state, but more specifically, the printer has
+ * completed enough processing of the document to be able to start marking
+ * and the job is waiting for the marker. Systems that require human
+ * intervention to release jobs put the job into the {@code PENDING_HELD}
+ * job state. Systems that automatically select a job to use the marker put
+ * the job into the {@code PENDING} job state or keep the job in the
+ * {@code PROCESSING} job state while waiting for the marker, depending on
* implementation. All implementations put the job into (or back into) the
- * PROCESSING state when marking does begin.
+ * {@code PROCESSING} state when marking does begin.
*/
public static final JobStateReason
JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
@@ -189,8 +196,9 @@
* which spend a great deal of time processing (1) when no marking is
* happening and then want to show that marking is now happening or (2) when
* the job is in the process of being canceled or aborted while the job
- * remains in the PROCESSING state, but the marking has not yet stopped so
- * that impression or sheet counts are still increasing for the job.
+ * remains in the {@code PROCESSING} state, but the marking has not yet
+ * stopped so that impression or sheet counts are still increasing for the
+ * job.
*/
public static final JobStateReason
JOB_PRINTING = new JobStateReason(13);
@@ -229,9 +237,9 @@
/**
* The job was aborted by the system. Either the job (1) is in the process
* of being aborted, (2) has been aborted by the system and placed in the
- * ABORTED state, or (3) has been aborted by the system and placed in the
- * PENDING_HELD state, so that a user or operator can manually try the job
- * again. This value should be supported.
+ * {@code ABORTED} state, or (3) has been aborted by the system and placed
+ * in the {@code PENDING_HELD} state, so that a user or operator can
+ * manually try the job again. This value should be supported.
*/
public static final JobStateReason
ABORTED_BY_SYSTEM = new JobStateReason(17);
@@ -250,7 +258,7 @@
* The job was aborted by the system because the printer encountered an
* error in the document data while decompressing it. If the printer posts
* this reason, the document data has already passed any tests that would
- * have led to the UNSUPPORTED_COMPRESSION job state reason.
+ * have led to the {@code UNSUPPORTED_COMPRESSION} job state reason.
*/
public static final JobStateReason
COMPRESSION_ERROR = new JobStateReason(19);
@@ -259,8 +267,8 @@
* The job was aborted by the system because the document data's document
* format (doc flavor) is not among those supported by the printer. If the
* client specifies a doc flavor with a MIME type of
- * {@code "application/octet-stream"}, the printer may abort the job if
- * the printer cannot determine the document data's actual format through
+ * {@code "application/octet-stream"}, the printer may abort the job if the
+ * printer cannot determine the document data's actual format through
* auto-sensing (even if the printer supports the document format if
* specified explicitly). This value must be supported, since a doc flavor
* is required to be specified for each doc.
@@ -272,7 +280,7 @@
* The job was aborted by the system because the printer encountered an
* error in the document data while processing it. If the printer posts this
* reason, the document data has already passed any tests that would have
- * led to the UNSUPPORTED_DOCUMENT_FORMAT job state reason.
+ * led to the {@code UNSUPPORTED_DOCUMENT_FORMAT} job state reason.
*/
public static final JobStateReason
DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
@@ -281,22 +289,23 @@
* The requester has canceled the job or the printer has aborted the job,
* but the printer is still performing some actions on the job until a
* specified stop point occurs or job termination/cleanup is completed.
- * <P>
+ * <p>
* If the implementation requires some measurable time to cancel the job in
- * the PROCESSING or PROCESSING_STOPPED job states, the printer must use
- * this reason to indicate that the printer is still performing some actions
- * on the job while the job remains in the PROCESSING or PROCESSING_STOPPED
- * state. After all the job's job description attributes have stopped
- * incrementing, the printer moves the job from the PROCESSING state to the
- * CANCELED or ABORTED job states.
+ * the {@code PROCESSING} or {@code PROCESSING_STOPPED} job states, the
+ * printer must use this reason to indicate that the printer is still
+ * performing some actions on the job while the job remains in the
+ * {@code PROCESSING} or {@code PROCESSING_STOPPED} state. After all the
+ * job's job description attributes have stopped incrementing, the printer
+ * moves the job from the PROCESSING state to the {@code CANCELED} or
+ * {@code ABORTED} job states.
*/
public static final JobStateReason
PROCESSING_TO_STOP_POINT = new JobStateReason(22);
/**
- * The printer is off-line and accepting no jobs. All PENDING jobs are put
- * into the PENDING_HELD state. This situation could be true if the
- * service's or document transform's input is impaired or broken.
+ * The printer is off-line and accepting no jobs. All {@code PENDING} jobs
+ * are put into the {@code PENDING_HELD} state. This situation could be true
+ * if the service's or document transform's input is impaired or broken.
*/
public static final JobStateReason
SERVICE_OFF_LINE = new JobStateReason(23);
@@ -323,11 +332,11 @@
/**
* This job is retained and is currently able to be restarted. If
- * JOB_RESTARTABLE is contained in the job's {@link JobStateReasons
- * JobStateReasons} attribute, then the printer must accept a request to
- * restart that job. This value should be supported if restarting jobs is
- * supported. <I>[The capability for restarting jobs is not in the Java
- * Print Service API at present.]</I>
+ * {@code JOB_RESTARTABLE} is contained in the job's
+ * {@link JobStateReasons JobStateReasons} attribute, then the printer must
+ * accept a request to restart that job. This value should be supported if
+ * restarting jobs is supported. <i>[The capability for restarting jobs is
+ * not in the Java Print Service API at present.]</i>
*/
public static final JobStateReason
JOB_RESTARTABLE = new JobStateReason(27);
@@ -335,24 +344,27 @@
/**
* The job has been forwarded to a device or print system that is unable to
* send back status. The printer sets the job's {@link JobState JobState}
- * attribute to COMPLETED and adds the QUEUED_IN_DEVICE reason to the job's
- * {@link JobStateReasons JobStateReasons} attribute to indicate that the
- * printer has no additional information about the job and never will have
- * any better information.
+ * attribute to {@code COMPLETED} and adds the {@code QUEUED_IN_DEVICE}
+ * reason to the job's {@link JobStateReasons JobStateReasons} attribute to
+ * indicate that the printer has no additional information about the job and
+ * never will have any better information.
*/
public static final JobStateReason
QUEUED_IN_DEVICE = new JobStateReason(28);
/**
- * Construct a new job state reason enumeration value with the given
- * integer value.
+ * Construct a new job state reason enumeration value with the given integer
+ * value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected JobStateReason(int value) {
super (value);
}
+ /**
+ * The string table for class {@code JobStateReason}.
+ */
private static final String[] myStringTable = {
"job-incoming",
"job-data-insufficient",
@@ -384,6 +396,9 @@
"job-restartable",
"queued-in-device"};
+ /**
+ * The enumeration value table for class {@code JobStateReason}.
+ */
private static final JobStateReason[] myEnumValueTable = {
JOB_INCOMING,
JOB_DATA_INSUFFICIENT,
@@ -416,29 +431,28 @@
QUEUED_IN_DEVICE};
/**
- * Returns the string table for class JobStateReason.
+ * Returns the string table for class {@code JobStateReason}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class JobStateReason.
+ * Returns the enumeration value table for class {@code JobStateReason}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobStateReason and any vendor-defined subclasses, the
- * category is class JobStateReason itself.
+ * <p>
+ * For class {@code JobStateReason} and any vendor-defined subclasses, the
+ * category is class {@code JobStateReason} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobStateReason.class;
@@ -447,14 +461,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobStateReason and any vendor-defined subclasses, the
+ * <p>
+ * For class {@code JobStateReason} and any vendor-defined subclasses, the
* category name is {@code "job-state-reason"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-state-reason";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Collection;
@@ -31,43 +32,47 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class JobStateReasons is a printing attribute class, a set of enumeration
- * values, that provides additional information about the job's current state,
- * i.e., information that augments the value of the job's {@link JobState
- * JobState} attribute.
- * <P>
+ * Class {@code JobStateReasons} is a printing attribute class, a set of
+ * enumeration values, that provides additional information about the job's
+ * current state, i.e., information that augments the value of the job's
+ * {@link JobState JobState} attribute.
+ * <p>
* Instances of {@link JobStateReason JobStateReason} do not appear in a Print
- * Job's attribute set directly. Rather, a JobStateReasons attribute appears in
- * the Print Job's attribute set. The JobStateReasons attribute contains zero,
- * one, or more than one {@link JobStateReason JobStateReason} objects which
- * pertain to the Print Job's status. The printer adds a {@link JobStateReason
- * JobStateReason} object to the Print Job's JobStateReasons attribute when the
- * corresponding condition becomes true of the Print Job, and the printer
- * removes the {@link JobStateReason JobStateReason} object again when the
- * corresponding condition becomes false, regardless of whether the Print Job's
- * overall {@link JobState JobState} also changed.
- * <P>
- * Class JobStateReasons inherits its implementation from class {@link
- * java.util.HashSet java.util.HashSet}. Unlike most printing attributes which
- * are immutable once constructed, class JobStateReasons is designed to be
- * mutable; you can add {@link JobStateReason JobStateReason} objects to an
- * existing JobStateReasons object and remove them again. However, like class
- * {@link java.util.HashSet java.util.HashSet}, class JobStateReasons is not
- * multiple thread safe. If a JobStateReasons object will be used by multiple
- * threads, be sure to synchronize its operations (e.g., using a synchronized
- * set view obtained from class {@link java.util.Collections
- * java.util.Collections}).
- * <P>
- * <B>IPP Compatibility:</B> The string value returned by each individual {@link
- * JobStateReason JobStateReason} object's {@code toString()} method gives
- * the IPP keyword value. The category name returned by {@code getName()}
+ * Job's attribute set directly. Rather, a {@code JobStateReasons} attribute
+ * appears in the Print Job's attribute set. The {@code JobStateReasons}
+ * attribute contains zero, one, or more than one
+ * {@link JobStateReason JobStateReason} objects which pertain to the Print
+ * Job's status. The printer adds a {@link JobStateReason JobStateReason} object
+ * to the Print Job's JobStateReasons attribute when the corresponding condition
+ * becomes true of the Print Job, and the printer removes the
+ * {@link JobStateReason JobStateReason} object again when the corresponding
+ * condition becomes false, regardless of whether the Print Job's overall
+ * {@link JobState JobState} also changed.
+ * <p>
+ * Class {@code JobStateReasons} inherits its implementation from class
+ * {@link HashSet java.util.HashSet}. Unlike most printing attributes
+ * which are immutable once constructed, class {@code JobStateReasons} is
+ * designed to be mutable; you can add {@link JobStateReason JobStateReason}
+ * objects to an existing {@code JobStateReasons} object and remove them again.
+ * However, like class {@link HashSet java.util.HashSet}, class
+ * {@code JobStateReasons} is not multiple thread safe. If a
+ * {@code JobStateReasons} object will be used by multiple threads, be sure to
+ * synchronize its operations (e.g., using a synchronized set view obtained
+ * from class {@link java.util.Collections java.util.Collections}).
+ * <p>
+ * <b>IPP Compatibility:</b> The string value returned by each individual
+ * {@link JobStateReason JobStateReason} object's {@code toString()} method
+ * gives the IPP keyword value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobStateReasons
extends HashSet<JobStateReason> implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8849088261264331812L;
/**
@@ -82,9 +87,8 @@
* Construct a new, empty job state reasons attribute; the underlying hash
* set has the given initial capacity and the default load factor.
*
- * @param initialCapacity Initial capacity.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
+ * @param initialCapacity initial capacity
+ * @throws IllegalArgumentException if the initial capacity is negative
*/
public JobStateReasons(int initialCapacity) {
super (initialCapacity);
@@ -94,10 +98,9 @@
* Construct a new, empty job state reasons attribute; the underlying hash
* set has the given initial capacity and load factor.
*
- * @param initialCapacity Initial capacity.
- * @param loadFactor Load factor.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
+ * @param initialCapacity initial capacity
+ * @param loadFactor load factor
+ * @throws IllegalArgumentException if the initial capacity is negative
*/
public JobStateReasons(int initialCapacity, float loadFactor) {
super (initialCapacity, loadFactor);
@@ -107,23 +110,18 @@
* Construct a new job state reasons attribute that contains the same
* {@link JobStateReason JobStateReason} objects as the given collection.
* The underlying hash set's initial capacity and load factor are as
- * specified in the superclass constructor {@link
- * java.util.HashSet#HashSet(java.util.Collection)
- * HashSet(Collection)}.
- *
- * @param collection Collection to copy.
+ * specified in the superclass constructor
+ * {@link HashSet#HashSet(Collection) HashSet(Collection)}.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code collection} is null or
- * if any element in {@code collection} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if any element in
- * {@code collection} is not an instance of class {@link
- * JobStateReason JobStateReason}.
+ * @param collection collection to copy
+ * @throws NullPointerException if {@code collection} is {@code null} or if
+ * any element in {@code collection} is {@code null}
+ * @throws ClassCastException if any element in {@code collection} is not an
+ * instance of class {@link JobStateReason JobStateReason}
*/
- public JobStateReasons(Collection<JobStateReason> collection) {
- super (collection);
- }
+ public JobStateReasons(Collection<JobStateReason> collection) {
+ super (collection);
+ }
/**
* Adds the specified element to this job state reasons attribute if it is
@@ -132,16 +130,12 @@
* attribute already contains the specified element, the call leaves this
* job state reasons attribute unchanged and returns {@code false}.
*
- * @param o Element to be added to this job state reasons attribute.
- *
- * @return {@code true} if this job state reasons attribute did not
- * already contain the specified element.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the specified element is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the specified element is not an
- * instance of class {@link JobStateReason JobStateReason}.
+ * @param o element to be added to this job state reasons attribute
+ * @return {@code true} if this job state reasons attribute did not already
+ * contain the specified element
+ * @throws NullPointerException if the specified element is {@code null}
+ * @throws ClassCastException if the specified element is not an instance of
+ * class {@link JobStateReason JobStateReason}
* @since 1.5
*/
public boolean add(JobStateReason o) {
@@ -154,11 +148,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class JobStateReasons, the category is class JobStateReasons itself.
+ * <p>
+ * For class {@code JobStateReasons}, the category is class
+ * JobStateReasons itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return JobStateReasons.class;
@@ -167,14 +162,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class JobStateReasons, the category
- * name is {@code "job-state-reasons"}.
+ * <p>
+ * For class JobStateReasons, the category name is
+ * {@code "job-state-reasons"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-state-reasons";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Media is a printing attribute class that specifies the
- * medium on which to print.
+ * Class {@code Media} is a printing attribute class that specifies the medium
+ * on which to print.
* <p>
* Media may be specified in different ways.
* <ul>
- * <li> it may be specified by paper source - eg paper tray
- * <li> it may be specified by a standard size - eg "A4"
- * <li> it may be specified by a name - eg "letterhead"
+ * <li>it may be specified by paper source - eg paper tray
+ * <li>it may be specified by a standard size - eg "A4"
+ * <li>it may be specified by a name - eg "letterhead"
* </ul>
- * Each of these corresponds to the IPP "media" attribute.
- * The current API does not support describing media by characteristics
- * (eg colour, opacity).
- * This may be supported in a later revision of the specification.
+ * Each of these corresponds to the IPP "media" attribute. The current API does
+ * not support describing media by characteristics (eg colour, opacity). This
+ * may be supported in a later revision of the specification.
* <p>
- * A Media object is constructed with a value which represents
- * one of the ways in which the Media attribute can be specified.
+ * A {@code Media} object is constructed with a value which represents one of
+ * the ways in which the Media attribute can be specified.
* <p>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
* @author Phil Race
*/
public abstract class Media extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2823970704630722439L;
/**
* Constructs a new media attribute specified by name.
*
- * @param value a value
+ * @param value a value
*/
protected Media(int value) {
super (value);
@@ -72,19 +75,16 @@
/**
* Returns whether this media attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is of the same subclass of Media as this object.
- * <LI>
- * The values are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is of the same subclass of {@code Media} as this
+ * object.
+ * <li>The values are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null && object instanceof Media &&
@@ -95,12 +95,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Media and any vendor-defined subclasses, the category is
- * class Media itself.
+ * <p>
+ * For class {@code Media} and any vendor-defined subclasses, the category
+ * is class {@code Media} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Media.class;
@@ -109,14 +109,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Media and any vendor-defined subclasses, the category name is
- * {@code "media"}.
+ * <p>
+ * For class {@code Media} and any vendor-defined subclasses, the category
+ * name is {@code "media"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,37 +22,40 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
/**
- * Class MediaName is a subclass of Media, a printing attribute class (an
- * enumeration) that specifies the media for a print job as a name.
- * <P>
- * This attribute can be used instead of specifying MediaSize or MediaTray.
+ * Class {@code MediaName} is a subclass of {@code Media}, a printing attribute
+ * class (an enumeration) that specifies the media for a print job as a name.
+ * <p>
+ * This attribute can be used instead of specifying {@code MediaSize} or
+ * {@code MediaTray}.
* <p>
- * Class MediaName currently declares a few standard media names.
- * Implementation- or site-defined names for a media name attribute may also
- * be created by defining a subclass of class MediaName.
- * <P>
- * <B>IPP Compatibility:</B> MediaName is a representation class for
+ * Class {@code MediaName} currently declares a few standard media names.
+ * Implementation- or site-defined names for a media name attribute may also be
+ * created by defining a subclass of class {@code MediaName}.
+ * <p>
+ * <b>IPP Compatibility:</b> {@code MediaName} is a representation class for
* values of the IPP "media" attribute which names media.
- *
*/
public class MediaName extends Media implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4653117714524155448L;
/**
- * white letter paper.
+ * white letter paper.
*/
public static final MediaName NA_LETTER_WHITE = new MediaName(0);
/**
- * letter transparency.
+ * letter transparency.
*/
public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
@@ -61,23 +64,24 @@
*/
public static final MediaName ISO_A4_WHITE = new MediaName(2);
-
/**
- * A4 transparency.
+ * A4 transparency.
*/
public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);
-
/**
* Constructs a new media name enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaName(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaTray}.
+ */
private static final String[] myStringTable = {
"na-letter-white",
"na-letter-transparent",
@@ -85,6 +89,9 @@
"iso-a4-transparent"
};
+ /**
+ * The enumeration value table for class {@code MediaTray}.
+ */
private static final MediaName[] myEnumValueTable = {
NA_LETTER_WHITE,
NA_LETTER_TRANSPARENT,
@@ -93,8 +100,9 @@
};
/**
- * Returns the string table for class MediaTray.
- * @return the String table.
+ * Returns the string table for class {@code MediaTray}.
+ *
+ * @return the string table
*/
protected String[] getStringTable()
{
@@ -102,11 +110,11 @@
}
/**
- * Returns the enumeration value table for class MediaTray.
- * @return the enumeration value table.
+ * Returns the enumeration value table for class {@code MediaTray}.
+ *
+ * @return the enumeration value table
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java Thu Aug 31 15:47:34 2017 -0700
@@ -22,9 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.DocFlavor;
+import javax.print.PrintService;
import javax.print.attribute.Attribute;
import javax.print.attribute.AttributeSet;
import javax.print.attribute.DocAttribute;
@@ -32,60 +34,67 @@
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class MediaPrintableArea is a printing attribute used to distinguish
+ * Class {@code MediaPrintableArea} is a printing attribute used to distinguish
* the printable and non-printable areas of media.
* <p>
* The printable area is specified to be a rectangle, within the overall
* dimensions of a media.
* <p>
- * Most printers cannot print on the entire surface of the media, due
- * to printer hardware limitations. This class can be used to query
- * the acceptable values for a supposed print job, and to request an area
- * within the constraints of the printable area to be used in a print job.
+ * Most printers cannot print on the entire surface of the media, due to printer
+ * hardware limitations. This class can be used to query the acceptable values
+ * for a supposed print job, and to request an area within the constraints of
+ * the printable area to be used in a print job.
* <p>
* To query for the printable area, a client must supply a suitable context.
- * Without specifying at the very least the size of the media being used
- * no meaningful value for printable area can be obtained.
+ * Without specifying at the very least the size of the media being used no
+ * meaningful value for printable area can be obtained.
* <p>
- * The attribute is not described in terms of the distance from the edge
- * of the paper, in part to emphasise that this attribute is not independent
- * of a particular media, but must be described within the context of a
- * choice of other attributes. Additionally it is usually more convenient
- * for a client to use the printable area.
+ * The attribute is not described in terms of the distance from the edge of the
+ * paper, in part to emphasise that this attribute is not independent of a
+ * particular media, but must be described within the context of a choice of
+ * other attributes. Additionally it is usually more convenient for a client to
+ * use the printable area.
* <p>
- * The hardware's minimum margins is not just a property of the printer,
- * but may be a function of the media size, orientation, media type, and
- * any specified finishings.
- * {@code PrintService} provides the method to query the supported
- * values of an attribute in a suitable context :
- * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()}
+ * The hardware's minimum margins is not just a property of the printer, but may
+ * be a function of the media size, orientation, media type, and any specified
+ * finishings. {@code PrintService} provides the method to query the supported
+ * values of an attribute in a suitable context : See
+ * {@link PrintService#getSupportedAttributeValues(Class, DocFlavor, AttributeSet)
+ * PrintService.getSupportedAttributeValues()}
* <p>
- * The rectangular printable area is defined thus:
- * The (x,y) origin is positioned at the top-left of the paper in portrait
- * mode regardless of the orientation specified in the requesting context.
- * For example a printable area for A4 paper in portrait or landscape
- * orientation will have height {@literal >} width.
+ * The rectangular printable area is defined thus: The (x,y) origin is
+ * positioned at the top-left of the paper in portrait mode regardless of the
+ * orientation specified in the requesting context. For example a printable area
+ * for A4 paper in portrait or landscape orientation will have height
+ * {@literal >} width.
* <p>
- * A printable area attribute's values are stored
- * internally as integers in units of micrometers (µm), where 1 micrometer
- * = 10<SUP>-6</SUP> meter = 1/1000 millimeter = 1/25400 inch. This permits
- * dimensions to be represented exactly to a precision of 1/1000 mm (= 1
- * µm) or 1/100 inch (= 254 µm). If fractional inches are expressed in
-
- * negative powers of two, this permits dimensions to be represented exactly to
- * a precision of 1/8 inch (= 3175 µm) but not 1/16 inch (because 1/16 inch
-
- * does not equal an integral number of µm).
+ * A printable area attribute's values are stored internally as integers in
+ * units of micrometers (µm), where 1 micrometer = 10<SUP>-6</SUP> meter =
+ * 1/1000 millimeter = 1/25400 inch. This permits dimensions to be represented
+ * exactly to a precision of 1/1000 mm (= 1 µm) or 1/100 inch (= 254
+ * µm). If fractional inches are expressed in negative powers of two, this
+ * permits dimensions to be represented exactly to a precision of 1/8 inch
+ * (= 3175 µm) but not 1/16 inch (because 1/16 inch does not equal an
+ * integral number of µm).
* <p>
- * <B>IPP Compatibility:</B> MediaPrintableArea is not an IPP attribute.
+ * <b>IPP Compatibility:</b> MediaPrintableArea is not an IPP attribute.
*/
-
public final class MediaPrintableArea
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Printable {@code x}, {@code y}, {@code width} and {@code height}.
+ */
private int x, y, w, h;
+
+ /**
+ * The units in which the values are expressed.
+ */
private int units;
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1597171464050795793L;
/**
@@ -101,18 +110,17 @@
public static final int MM = 1000;
/**
- * Constructs a MediaPrintableArea object from floating point values.
- * @param x printable x
- * @param y printable y
- * @param w printable width
- * @param h printable height
- * @param units in which the values are expressed.
- *
- * @exception IllegalArgumentException
- * Thrown if {@code x < 0} or {@code y < 0}
- * or {@code w <= 0} or {@code h <= 0} or
- * {@code units < 1}.
- */
+ * Constructs a {@code MediaPrintableArea} object from floating point
+ * values.
+ *
+ * @param x printable x
+ * @param y printable y
+ * @param w printable width
+ * @param h printable height
+ * @param units in which the values are expressed
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code w <= 0} or {@code h <= 0} or {@code units < 1}
+ */
public MediaPrintableArea(float x, float y, float w, float h, int units) {
if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
(units < 1)) {
@@ -127,18 +135,16 @@
}
/**
- * Constructs a MediaPrintableArea object from integer values.
- * @param x printable x
- * @param y printable y
- * @param w printable width
- * @param h printable height
- * @param units in which the values are expressed.
- *
- * @exception IllegalArgumentException
- * Thrown if {@code x < 0} or {@code y < 0}
- * or {@code w <= 0} or {@code h <= 0} or
- * {@code units < 1}.
- */
+ * Constructs a {@code MediaPrintableArea} object from integer values.
+ *
+ * @param x printable x
+ * @param y printable y
+ * @param w printable width
+ * @param h printable height
+ * @param units in which the values are expressed
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code w <= 0} or {@code h <= 0} or {@code units < 1}
+ */
public MediaPrintableArea(int x, int y, int w, int h, int units) {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
(units < 1)) {
@@ -153,15 +159,13 @@
/**
* Get the printable area as an array of 4 values in the order
- * x, y, w, h. The values returned are in the given units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * {@code x, y, w, h}. The values returned are in the given units.
*
- * @return printable area as array of x, y, w, h in the specified units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return printable area as array of {@code x, y, w, h} in the specified
+ * units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float[] getPrintableArea(int units) {
return new float[] { getX(units), getY(units),
@@ -169,86 +173,70 @@
}
/**
- * Get the x location of the origin of the printable area in the
- * specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return x location of the origin of the printable area in the
+ * Get the {@code x} location of the origin of the printable area in the
* specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code x} location of the origin of the printable area in the
+ * specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getX(int units) {
+ public float getX(int units) {
return convertFromMicrometers(x, units);
- }
+ }
/**
- * Get the y location of the origin of the printable area in the
- * specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return y location of the origin of the printable area in the
+ * Get the {@code y} location of the origin of the printable area in the
* specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code y} location of the origin of the printable area in the
+ * specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getY(int units) {
+ public float getY(int units) {
return convertFromMicrometers(y, units);
- }
+ }
/**
- * Get the width of the printable area in the specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return width of the printable area in the specified units.
+ * Get the {@code width} of the printable area in the specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code width} of the printable area in the specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getWidth(int units) {
+ public float getWidth(int units) {
return convertFromMicrometers(w, units);
- }
+ }
/**
- * Get the height of the printable area in the specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return height of the printable area in the specified units.
+ * Get the {@code height} of the printable area in the specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code height} of the printable area in the specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getHeight(int units) {
+ public float getHeight(int units) {
return convertFromMicrometers(h, units);
- }
+ }
/**
* Returns whether this media margins attribute is equivalent to the passed
- * in object.
- * To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class MediaPrintableArea.
- * <LI>
- * The origin and dimensions are the same.
- * </OL>
+ * in object. To be equivalent, all of the following conditions must be
+ * true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code MediaPrintableArea}.
+ * <li>The origin and dimensions are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media margins
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media
+ * margins attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
boolean ret = false;
@@ -264,12 +252,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class MediaPrintableArea, the category is
- * class MediaPrintableArea itself.
+ * <p>
+ * For class {@code MediaPrintableArea}, the category is class
+ * {@code MediaPrintableArea} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return MediaPrintableArea.class;
@@ -278,32 +266,28 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class MediaPrintableArea,
- * the category name is {@code "media-printable-area"}.
- * <p>This is not an IPP V1.1 attribute.
+ * <p>
+ * For class {@code MediaPrintableArea}, the category name is
+ * {@code "media-printable-area"}.
+ * <p>
+ * This is not an IPP V1.1 attribute.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media-printable-area";
}
/**
- * Returns a string version of this rectangular size attribute in the
- * given units.
+ * Returns a string version of this rectangular size attribute in the given
+ * units.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- * @param unitsName
- * Units name string, e.g. {@code "in"} or {@code "mm"}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this two-dimensional size attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @param unitsName units name string, e.g. {@code "in"} or {@code "mm"}.
+ * If {@code null}, no units name is appended to the result
+ * @return string version of this two-dimensional size attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
if (unitsName == null) {
@@ -328,6 +312,14 @@
return x + 37*y + 43*w + 47*h;
}
+ /**
+ * Converts the {@code x} from micrometers to {@code units}.
+ *
+ * @param x the value
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return the value of {@code x} in the specified units
+ */
private static float convertFromMicrometers(int x, int units) {
if (units < 1) {
throw new IllegalArgumentException("units is < 1");
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,37 +22,44 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.HashMap;
import java.util.Vector;
+import javax.print.attribute.Attribute;
import javax.print.attribute.Size2DSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class MediaSize is a two-dimensional size valued printing attribute class
- * that indicates the dimensions of the medium in a portrait orientation, with
- * the X dimension running along the bottom edge and the Y dimension running
- * along the left edge. Thus, the Y dimension must be greater than or equal to
- * the X dimension. Class MediaSize declares many standard media size
- * values, organized into nested classes for ISO, JIS, North American,
- * engineering, and other media.
- * <P>
- * MediaSize is not yet used to specify media. Its current role is
- * as a mapping for named media (see {@link MediaSizeName MediaSizeName}).
- * Clients can use the mapping method
- * {@code MediaSize.getMediaSizeForName(MediaSizeName)}
- * to find the physical dimensions of the MediaSizeName instances
- * enumerated in this API. This is useful for clients which need this
- * information to format {@literal &} paginate printing.
+ * Class {@code MediaSize} is a two-dimensional size valued printing attribute
+ * class that indicates the dimensions of the medium in a portrait orientation,
+ * with the {@code X} dimension running along the bottom edge and the {@code Y}
+ * dimension running along the left edge. Thus, the {@code Y} dimension must be
+ * greater than or equal to the {@code X} dimension. Class {@code MediaSize}
+ * declares many standard media size values, organized into nested classes for
+ * ISO, JIS, North American, engineering, and other media.
+ * <p>
+ * {@code MediaSize} is not yet used to specify media. Its current role is as a
+ * mapping for named media (see {@link MediaSizeName MediaSizeName}). Clients
+ * can use the mapping method
+ * {@code MediaSize.getMediaSizeForName(MediaSizeName)} to find the physical
+ * dimensions of the {@code MediaSizeName} instances enumerated in this API.
+ * This is useful for clients which need this information to format {@literal &}
+ * paginate printing.
*
- * @author Phil Race, Alan Kaminsky
+ * @author Phil Race, Alan Kaminsky
*/
public class MediaSize extends Size2DSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1967958664615414771L;
+ /**
+ * The media name.
+ */
private MediaSizeName mediaName;
private static HashMap<MediaSizeName, MediaSize> mediaMap = new HashMap<>(100, 10);
@@ -63,15 +70,12 @@
* Construct a new media size attribute from the given floating-point
* values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1} or {@code x > y}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}
*/
public MediaSize(float x, float y,int units) {
super (x, y, units);
@@ -84,15 +88,12 @@
/**
* Construct a new media size attribute from the given integer values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1} or {@code x > y}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}
*/
public MediaSize(int x, int y,int units) {
super (x, y, units);
@@ -102,20 +103,17 @@
sizeVector.add(this);
}
- /**
+ /**
* Construct a new media size attribute from the given floating-point
* values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}.
- * @param media a media name to associate with this MediaSize
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1} or {@code x > y}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @param media a media name to associate with this {@code MediaSize}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}
*/
public MediaSize(float x, float y,int units, MediaSizeName media) {
super (x, y, units);
@@ -132,16 +130,13 @@
/**
* Construct a new media size attribute from the given integer values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}.
- * @param media a media name to associate with this MediaSize
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1} or {@code x > y}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @param media a media name to associate with this {@code MediaSize}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}
*/
public MediaSize(int x, int y,int units, MediaSizeName media) {
super (x, y, units);
@@ -158,44 +153,43 @@
/**
* Get the media name, if any, for this size.
*
- * @return the name for this media size, or null if no name was
- * associated with this size (an anonymous size).
+ * @return the name for this media size, or {@code null} if no name was
+ * associated with this size (an anonymous size)
*/
public MediaSizeName getMediaSizeName() {
return mediaName;
}
/**
- * Get the MediaSize for the specified named media.
+ * Get the {@code MediaSize} for the specified named media.
*
- * @param media the name of the media for which the size is sought
- * @return size of the media, or null if this media is not associated
- * with any size.
+ * @param media the name of the media for which the size is sought
+ * @return size of the media, or {@code null} if this media is not
+ * associated with any size
*/
public static MediaSize getMediaSizeForName(MediaSizeName media) {
return mediaMap.get(media);
}
/**
- * The specified dimensions are used to locate a matching MediaSize
- * instance from amongst all the standard MediaSize instances.
- * If there is no exact match, the closest match is used.
+ * The specified dimensions are used to locate a matching {@code MediaSize}
+ * instance from amongst all the standard {@code MediaSize} instances. If
+ * there is no exact match, the closest match is used.
* <p>
- * The MediaSize is in turn used to locate the MediaSizeName object.
- * This method may return null if the closest matching MediaSize
- * has no corresponding Media instance.
+ * The {@code MediaSize} is in turn used to locate the {@code MediaSizeName}
+ * object. This method may return {@code null} if the closest matching
+ * {@code MediaSize} has no corresponding {@code Media} instance.
* <p>
- * This method is useful for clients which have only dimensions and
- * want to find a Media which corresponds to the dimensions.
- * @param x X dimension
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}
- * @return MediaSizeName matching these dimensions, or null.
- * @exception IllegalArgumentException if {@code x <= 0},
- * {@code y <= 0}, or {@code units < 1}.
+ * This method is useful for clients which have only dimensions and want to
+ * find a {@code Media} which corresponds to the dimensions.
*
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @return {@code MediaSizeName} matching these dimensions, or {@code null}
+ * @throws IllegalArgumentException if {@code x <= 0}, {@code y <= 0}, or
+ * {@code units < 1}
*/
public static MediaSizeName findMedia(float x, float y, int units) {
@@ -232,26 +226,20 @@
}
/**
- * Returns whether this media size attribute is equivalent to the passed
- * in object.
- * To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class MediaSize.
- * <LI>
- * This media size attribute's X dimension is equal to
- * {@code object}'s X dimension.
- * <LI>
- * This media size attribute's Y dimension is equal to
- * {@code object}'s Y dimension.
- * </OL>
+ * Returns whether this media size attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code MediaSize}.
+ * <li>This media size attribute's {@code X} dimension is equal to
+ * {@code object}'s {@code X} dimension.
+ * <li>This media size attribute's {@code Y} dimension is equal to
+ * {@code object}'s {@code Y} dimension.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media size
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media size
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof MediaSize);
@@ -260,12 +248,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class MediaSize and any vendor-defined subclasses, the category is
- * class MediaSize itself.
+ * <p>
+ * For class {@code MediaSize} and any vendor-defined subclasses, the
+ * category is class {@code MediaSize} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return MediaSize.class;
@@ -274,151 +262,178 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class MediaSize and any vendor-defined subclasses, the category
- * name is {@code "media-size"}.
+ * <p>
+ * For class {@code MediaSize} and any vendor-defined subclasses, the
+ * category name is {@code "media-size"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media-size";
}
/**
- * Class MediaSize.ISO includes {@link MediaSize MediaSize} values for ISO
- * media.
+ * Class {@code MediaSize.ISO} includes {@link MediaSize MediaSize} values
+ * for ISO media.
*/
public static final class ISO {
+
/**
* Specifies the ISO A0 size, 841 mm by 1189 mm.
*/
public static final MediaSize
A0 = new MediaSize(841, 1189, Size2DSyntax.MM, MediaSizeName.ISO_A0);
+
/**
* Specifies the ISO A1 size, 594 mm by 841 mm.
*/
public static final MediaSize
A1 = new MediaSize(594, 841, Size2DSyntax.MM, MediaSizeName.ISO_A1);
+
/**
* Specifies the ISO A2 size, 420 mm by 594 mm.
*/
public static final MediaSize
A2 = new MediaSize(420, 594, Size2DSyntax.MM, MediaSizeName.ISO_A2);
+
/**
* Specifies the ISO A3 size, 297 mm by 420 mm.
*/
public static final MediaSize
A3 = new MediaSize(297, 420, Size2DSyntax.MM, MediaSizeName.ISO_A3);
+
/**
* Specifies the ISO A4 size, 210 mm by 297 mm.
*/
public static final MediaSize
A4 = new MediaSize(210, 297, Size2DSyntax.MM, MediaSizeName.ISO_A4);
+
/**
* Specifies the ISO A5 size, 148 mm by 210 mm.
*/
public static final MediaSize
A5 = new MediaSize(148, 210, Size2DSyntax.MM, MediaSizeName.ISO_A5);
+
/**
* Specifies the ISO A6 size, 105 mm by 148 mm.
*/
public static final MediaSize
A6 = new MediaSize(105, 148, Size2DSyntax.MM, MediaSizeName.ISO_A6);
+
/**
* Specifies the ISO A7 size, 74 mm by 105 mm.
*/
public static final MediaSize
A7 = new MediaSize(74, 105, Size2DSyntax.MM, MediaSizeName.ISO_A7);
+
/**
* Specifies the ISO A8 size, 52 mm by 74 mm.
*/
public static final MediaSize
A8 = new MediaSize(52, 74, Size2DSyntax.MM, MediaSizeName.ISO_A8);
+
/**
* Specifies the ISO A9 size, 37 mm by 52 mm.
*/
public static final MediaSize
A9 = new MediaSize(37, 52, Size2DSyntax.MM, MediaSizeName.ISO_A9);
+
/**
* Specifies the ISO A10 size, 26 mm by 37 mm.
*/
public static final MediaSize
A10 = new MediaSize(26, 37, Size2DSyntax.MM, MediaSizeName.ISO_A10);
+
/**
* Specifies the ISO B0 size, 1000 mm by 1414 mm.
*/
public static final MediaSize
B0 = new MediaSize(1000, 1414, Size2DSyntax.MM, MediaSizeName.ISO_B0);
+
/**
* Specifies the ISO B1 size, 707 mm by 1000 mm.
*/
public static final MediaSize
B1 = new MediaSize(707, 1000, Size2DSyntax.MM, MediaSizeName.ISO_B1);
+
/**
* Specifies the ISO B2 size, 500 mm by 707 mm.
*/
public static final MediaSize
B2 = new MediaSize(500, 707, Size2DSyntax.MM, MediaSizeName.ISO_B2);
+
/**
* Specifies the ISO B3 size, 353 mm by 500 mm.
*/
public static final MediaSize
B3 = new MediaSize(353, 500, Size2DSyntax.MM, MediaSizeName.ISO_B3);
+
/**
* Specifies the ISO B4 size, 250 mm by 353 mm.
*/
public static final MediaSize
B4 = new MediaSize(250, 353, Size2DSyntax.MM, MediaSizeName.ISO_B4);
+
/**
* Specifies the ISO B5 size, 176 mm by 250 mm.
*/
public static final MediaSize
B5 = new MediaSize(176, 250, Size2DSyntax.MM, MediaSizeName.ISO_B5);
+
/**
* Specifies the ISO B6 size, 125 mm by 176 mm.
*/
public static final MediaSize
B6 = new MediaSize(125, 176, Size2DSyntax.MM, MediaSizeName.ISO_B6);
+
/**
* Specifies the ISO B7 size, 88 mm by 125 mm.
*/
public static final MediaSize
B7 = new MediaSize(88, 125, Size2DSyntax.MM, MediaSizeName.ISO_B7);
+
/**
* Specifies the ISO B8 size, 62 mm by 88 mm.
*/
public static final MediaSize
B8 = new MediaSize(62, 88, Size2DSyntax.MM, MediaSizeName.ISO_B8);
+
/**
* Specifies the ISO B9 size, 44 mm by 62 mm.
*/
public static final MediaSize
B9 = new MediaSize(44, 62, Size2DSyntax.MM, MediaSizeName.ISO_B9);
+
/**
* Specifies the ISO B10 size, 31 mm by 44 mm.
*/
public static final MediaSize
B10 = new MediaSize(31, 44, Size2DSyntax.MM, MediaSizeName.ISO_B10);
+
/**
* Specifies the ISO C3 size, 324 mm by 458 mm.
*/
public static final MediaSize
C3 = new MediaSize(324, 458, Size2DSyntax.MM, MediaSizeName.ISO_C3);
+
/**
* Specifies the ISO C4 size, 229 mm by 324 mm.
*/
public static final MediaSize
C4 = new MediaSize(229, 324, Size2DSyntax.MM, MediaSizeName.ISO_C4);
+
/**
* Specifies the ISO C5 size, 162 mm by 229 mm.
*/
public static final MediaSize
C5 = new MediaSize(162, 229, Size2DSyntax.MM, MediaSizeName.ISO_C5);
+
/**
* Specifies the ISO C6 size, 114 mm by 162 mm.
*/
public static final MediaSize
C6 = new MediaSize(114, 162, Size2DSyntax.MM, MediaSizeName.ISO_C6);
+
/**
* Specifies the ISO Designated Long size, 110 mm by 220 mm.
*/
@@ -434,8 +449,8 @@
}
/**
- * Class MediaSize.JIS includes {@link MediaSize MediaSize} values for JIS
- * (Japanese) media. *
+ * Class {@code MediaSize.JIS} includes {@link MediaSize MediaSize} values
+ * for JIS (Japanese) media.
*/
public static final class JIS {
@@ -444,152 +459,188 @@
*/
public static final MediaSize
B0 = new MediaSize(1030, 1456, Size2DSyntax.MM, MediaSizeName.JIS_B0);
+
/**
* Specifies the JIS B1 size, 728 mm by 1030 mm.
*/
public static final MediaSize
B1 = new MediaSize(728, 1030, Size2DSyntax.MM, MediaSizeName.JIS_B1);
+
/**
* Specifies the JIS B2 size, 515 mm by 728 mm.
*/
public static final MediaSize
B2 = new MediaSize(515, 728, Size2DSyntax.MM, MediaSizeName.JIS_B2);
+
/**
* Specifies the JIS B3 size, 364 mm by 515 mm.
*/
public static final MediaSize
B3 = new MediaSize(364, 515, Size2DSyntax.MM, MediaSizeName.JIS_B3);
+
/**
* Specifies the JIS B4 size, 257 mm by 364 mm.
*/
public static final MediaSize
B4 = new MediaSize(257, 364, Size2DSyntax.MM, MediaSizeName.JIS_B4);
+
/**
* Specifies the JIS B5 size, 182 mm by 257 mm.
*/
public static final MediaSize
B5 = new MediaSize(182, 257, Size2DSyntax.MM, MediaSizeName.JIS_B5);
+
/**
* Specifies the JIS B6 size, 128 mm by 182 mm.
*/
public static final MediaSize
B6 = new MediaSize(128, 182, Size2DSyntax.MM, MediaSizeName.JIS_B6);
+
/**
* Specifies the JIS B7 size, 91 mm by 128 mm.
*/
public static final MediaSize
B7 = new MediaSize(91, 128, Size2DSyntax.MM, MediaSizeName.JIS_B7);
+
/**
* Specifies the JIS B8 size, 64 mm by 91 mm.
*/
public static final MediaSize
B8 = new MediaSize(64, 91, Size2DSyntax.MM, MediaSizeName.JIS_B8);
+
/**
* Specifies the JIS B9 size, 45 mm by 64 mm.
*/
public static final MediaSize
B9 = new MediaSize(45, 64, Size2DSyntax.MM, MediaSizeName.JIS_B9);
+
/**
* Specifies the JIS B10 size, 32 mm by 45 mm.
*/
public static final MediaSize
B10 = new MediaSize(32, 45, Size2DSyntax.MM, MediaSizeName.JIS_B10);
+
/**
* Specifies the JIS Chou ("long") #1 envelope size, 142 mm by 332 mm.
*/
public static final MediaSize CHOU_1 = new MediaSize(142, 332, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #2 envelope size, 119 mm by 277 mm.
*/
public static final MediaSize CHOU_2 = new MediaSize(119, 277, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #3 envelope size, 120 mm by 235 mm.
*/
public static final MediaSize CHOU_3 = new MediaSize(120, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #4 envelope size, 90 mm by 205 mm.
*/
public static final MediaSize CHOU_4 = new MediaSize(90, 205, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #30 envelope size, 92 mm by 235 mm.
*/
public static final MediaSize CHOU_30 = new MediaSize(92, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #40 envelope size, 90 mm by 225 mm.
*/
public static final MediaSize CHOU_40 = new MediaSize(90, 225, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #0 envelope size, 287 mm by 382 mm.
*/
public static final MediaSize KAKU_0 = new MediaSize(287, 382, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #1 envelope size, 270 mm by 382 mm.
*/
public static final MediaSize KAKU_1 = new MediaSize(270, 382, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #2 envelope size, 240 mm by 332 mm.
*/
public static final MediaSize KAKU_2 = new MediaSize(240, 332, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #3 envelope size, 216 mm by 277 mm.
*/
public static final MediaSize KAKU_3 = new MediaSize(216, 277, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #4 envelope size, 197 mm by 267 mm.
*/
public static final MediaSize KAKU_4 = new MediaSize(197, 267, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #5 envelope size, 190 mm by 240 mm.
*/
public static final MediaSize KAKU_5 = new MediaSize(190, 240, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #6 envelope size, 162 mm by 229 mm.
*/
public static final MediaSize KAKU_6 = new MediaSize(162, 229, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #7 envelope size, 142 mm by 205 mm.
*/
public static final MediaSize KAKU_7 = new MediaSize(142, 205, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #8 envelope size, 119 mm by 197 mm.
*/
public static final MediaSize KAKU_8 = new MediaSize(119, 197, Size2DSyntax.MM);
+
/**
- * Specifies the JIS Kaku ("square") #20 envelope size, 229 mm by 324 mm.
+ * Specifies the JIS Kaku ("square") #20 envelope size, 229 mm by 324
+ * mm.
*/
public static final MediaSize KAKU_20 = new MediaSize(229, 324, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") A4 envelope size, 228 mm by 312 mm.
*/
public static final MediaSize KAKU_A4 = new MediaSize(228, 312, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #1 envelope size, 120 mm by 176 mm.
*/
public static final MediaSize YOU_1 = new MediaSize(120, 176, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #2 envelope size, 114 mm by 162 mm.
*/
public static final MediaSize YOU_2 = new MediaSize(114, 162, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #3 envelope size, 98 mm by 148 mm.
*/
public static final MediaSize YOU_3 = new MediaSize(98, 148, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #4 envelope size, 105 mm by 235 mm.
*/
public static final MediaSize YOU_4 = new MediaSize(105, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #5 envelope size, 95 mm by 217 mm.
*/
public static final MediaSize YOU_5 = new MediaSize(95, 217, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #6 envelope size, 98 mm by 190 mm.
*/
public static final MediaSize YOU_6 = new MediaSize(98, 190, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #7 envelope size, 92 mm by 165 mm.
*/
public static final MediaSize YOU_7 = new MediaSize(92, 165, Size2DSyntax.MM);
+
/**
* Hide all constructors.
*/
@@ -598,8 +649,8 @@
}
/**
- * Class MediaSize.NA includes {@link MediaSize MediaSize} values for North
- * American media.
+ * Class {@code MediaSize.NA} includes {@link MediaSize MediaSize} values
+ * for North American media.
*/
public static final class NA {
@@ -609,59 +660,67 @@
public static final MediaSize
LETTER = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LETTER);
+
/**
* Specifies the North American legal size, 8.5 inches by 14 inches.
*/
public static final MediaSize
LEGAL = new MediaSize(8.5f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LEGAL);
+
/**
* Specifies the North American 5 inch by 7 inch paper.
*/
public static final MediaSize
NA_5X7 = new MediaSize(5, 7, Size2DSyntax.INCH,
MediaSizeName.NA_5X7);
+
/**
* Specifies the North American 8 inch by 10 inch paper.
*/
public static final MediaSize
NA_8X10 = new MediaSize(8, 10, Size2DSyntax.INCH,
MediaSizeName.NA_8X10);
+
/**
- * Specifies the North American Number 9 business envelope size,
- * 3.875 inches by 8.875 inches.
+ * Specifies the North American Number 9 business envelope size, 3.875
+ * inches by 8.875 inches.
*/
public static final MediaSize
NA_NUMBER_9_ENVELOPE =
new MediaSize(3.875f, 8.875f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_9_ENVELOPE);
+
/**
- * Specifies the North American Number 10 business envelope size,
- * 4.125 inches by 9.5 inches.
+ * Specifies the North American Number 10 business envelope size, 4.125
+ * inches by 9.5 inches.
*/
public static final MediaSize
NA_NUMBER_10_ENVELOPE =
new MediaSize(4.125f, 9.5f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_10_ENVELOPE);
+
/**
- * Specifies the North American Number 11 business envelope size,
- * 4.5 inches by 10.375 inches.
+ * Specifies the North American Number 11 business envelope size, 4.5
+ * inches by 10.375 inches.
*/
public static final MediaSize
NA_NUMBER_11_ENVELOPE =
new MediaSize(4.5f, 10.375f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_11_ENVELOPE);
+
/**
- * Specifies the North American Number 12 business envelope size,
- * 4.75 inches by 11 inches.
+ * Specifies the North American Number 12 business envelope size, 4.75
+ * inches by 11 inches.
*/
public static final MediaSize
NA_NUMBER_12_ENVELOPE =
new MediaSize(4.75f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_12_ENVELOPE);
+
/**
- * Specifies the North American Number 14 business envelope size,
- * 5 inches by 11.5 inches.
+ * Specifies the North American Number 14 business envelope size, 5
+ * inches by 11.5 inches.
*/
public static final MediaSize
NA_NUMBER_14_ENVELOPE =
@@ -674,42 +733,49 @@
public static final MediaSize
NA_6X9_ENVELOPE = new MediaSize(6.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_6X9_ENVELOPE);
+
/**
* Specifies the North American 7 inch by 9 inch envelope size.
*/
public static final MediaSize
NA_7X9_ENVELOPE = new MediaSize(7.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_7X9_ENVELOPE);
+
/**
* Specifies the North American 9 inch by 11 inch envelope size.
*/
public static final MediaSize
NA_9x11_ENVELOPE = new MediaSize(9.0f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X11_ENVELOPE);
+
/**
* Specifies the North American 9 inch by 12 inch envelope size.
*/
public static final MediaSize
NA_9x12_ENVELOPE = new MediaSize(9.0f, 12.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X12_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 13 inch envelope size.
*/
public static final MediaSize
NA_10x13_ENVELOPE = new MediaSize(10.0f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X13_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 14 inch envelope size.
*/
public static final MediaSize
NA_10x14_ENVELOPE = new MediaSize(10.0f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X14_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 15 inch envelope size.
*/
public static final MediaSize
NA_10X15_ENVELOPE = new MediaSize(10.0f, 15.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X15_ENVELOPE);
+
/**
* Hide all constructors.
*/
@@ -718,8 +784,8 @@
}
/**
- * Class MediaSize.Engineering includes {@link MediaSize MediaSize} values
- * for engineering media.
+ * Class {@code MediaSize.Engineering} includes {@link MediaSize MediaSize}
+ * values for engineering media.
*/
public static final class Engineering {
@@ -729,30 +795,35 @@
public static final MediaSize
A = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.A);
+
/**
* Specifies the engineering B size, 11 inch by 17 inch.
*/
public static final MediaSize
B = new MediaSize(11.0f, 17.0f, Size2DSyntax.INCH,
MediaSizeName.B);
+
/**
* Specifies the engineering C size, 17 inch by 22 inch.
*/
public static final MediaSize
C = new MediaSize(17.0f, 22.0f, Size2DSyntax.INCH,
MediaSizeName.C);
+
/**
* Specifies the engineering D size, 22 inch by 34 inch.
*/
public static final MediaSize
D = new MediaSize(22.0f, 34.0f, Size2DSyntax.INCH,
MediaSizeName.D);
+
/**
* Specifies the engineering E size, 34 inch by 44 inch.
*/
public static final MediaSize
E = new MediaSize(34.0f, 44.0f, Size2DSyntax.INCH,
MediaSizeName.E);
+
/**
* Hide all constructors.
*/
@@ -761,16 +832,18 @@
}
/**
- * Class MediaSize.Other includes {@link MediaSize MediaSize} values for
- * miscellaneous media.
+ * Class {@code MediaSize.Other} includes {@link MediaSize MediaSize} values
+ * for miscellaneous media.
*/
public static final class Other {
+
/**
* Specifies the executive size, 7.25 inches by 10.5 inches.
*/
public static final MediaSize
EXECUTIVE = new MediaSize(7.25f, 10.5f, Size2DSyntax.INCH,
MediaSizeName.EXECUTIVE);
+
/**
* Specifies the ledger size, 11 inches by 17 inches.
*/
@@ -780,6 +853,7 @@
/**
* Specifies the tabloid size, 11 inches by 17 inches.
+ *
* @since 1.5
*/
public static final MediaSize
@@ -792,48 +866,56 @@
public static final MediaSize
INVOICE = new MediaSize(5.5f, 8.5f, Size2DSyntax.INCH,
MediaSizeName.INVOICE);
+
/**
* Specifies the folio size, 8.5 inches by 13 inches.
*/
public static final MediaSize
FOLIO = new MediaSize(8.5f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.FOLIO);
+
/**
* Specifies the quarto size, 8.5 inches by 10.83 inches.
*/
public static final MediaSize
QUARTO = new MediaSize(8.5f, 10.83f, Size2DSyntax.INCH,
MediaSizeName.QUARTO);
+
/**
* Specifies the Italy envelope size, 110 mm by 230 mm.
*/
public static final MediaSize
ITALY_ENVELOPE = new MediaSize(110, 230, Size2DSyntax.MM,
MediaSizeName.ITALY_ENVELOPE);
+
/**
* Specifies the Monarch envelope size, 3.87 inch by 7.5 inch.
*/
public static final MediaSize
MONARCH_ENVELOPE = new MediaSize(3.87f, 7.5f, Size2DSyntax.INCH,
MediaSizeName.MONARCH_ENVELOPE);
+
/**
* Specifies the Personal envelope size, 3.625 inch by 6.5 inch.
*/
public static final MediaSize
PERSONAL_ENVELOPE = new MediaSize(3.625f, 6.5f, Size2DSyntax.INCH,
MediaSizeName.PERSONAL_ENVELOPE);
+
/**
* Specifies the Japanese postcard size, 100 mm by 148 mm.
*/
public static final MediaSize
JAPANESE_POSTCARD = new MediaSize(100, 148, Size2DSyntax.MM,
MediaSizeName.JAPANESE_POSTCARD);
+
/**
* Specifies the Japanese Double postcard size, 148 mm by 200 mm.
*/
public static final MediaSize
JAPANESE_DOUBLE_POSTCARD = new MediaSize(148, 200, Size2DSyntax.MM,
MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
+
/**
* Hide all constructors.
*/
@@ -841,8 +923,9 @@
}
}
- /* force loading of all the subclasses so that the instances
- * are created and inserted into the hashmap.
+ /*
+ * force loading of all the subclasses so that the instances are created and
+ * inserted into the hashmap.
*/
static {
MediaSize ISOA4 = ISO.A4;
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSizeName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSizeName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,161 +22,192 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
-
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class MediaSizeName is a subclass of Media.
- * <P>
- * This attribute can be used instead of specifying MediaName or MediaTray.
+ * Class {@code MediaSizeName} is a subclass of {@code Media}.
+ * <p>
+ * This attribute can be used instead of specifying {@code MediaName} or
+ * {@code MediaTray}.
* <p>
- * Class MediaSizeName currently declares a few standard media
- * name values.
- * <P>
- * <B>IPP Compatibility:</B> MediaSizeName is a representation class for
- * values of the IPP "media" attribute which names media sizes.
- * The names of the media sizes correspond to those in the IPP 1.1 RFC
- * <a HREF="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>
- *
+ * Class {@code MediaSizeName} currently declares a few standard media name
+ * values.
+ * <p>
+ * <b>IPP Compatibility:</b> {@code MediaSizeName} is a representation class for
+ * values of the IPP "media" attribute which names media sizes. The names of the
+ * media sizes correspond to those in the IPP 1.1 RFC
+ * <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>
*/
public class MediaSizeName extends Media {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2778798329756942747L;
/**
* A0 size.
*/
public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
+
/**
* A1 size.
*/
public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
+
/**
* A2 size.
*/
public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
+
/**
* A3 size.
*/
public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
+
/**
* A4 size.
*/
public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
+
/**
* A5 size.
*/
public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
+
/**
* A6 size.
*/
public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
+
/**
* A7 size.
*/
public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
+
/**
* A8 size.
*/
public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
+
/**
* A9 size.
*/
public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
+
/**
* A10 size.
*/
public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
- /**
+ /**
* ISO B0 size.
*/
public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
+
/**
* ISO B1 size.
*/
public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
+
/**
* ISO B2 size.
*/
public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
+
/**
* ISO B3 size.
*/
public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
+
/**
* ISO B4 size.
*/
public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
+
/**
* ISO B5 size.
*/
public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
+
/**
* ISO B6 size.
*/
public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
+
/**
* ISO B7 size.
*/
public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
+
/**
* ISO B8 size.
*/
public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
+
/**
* ISO B9 size.
*/
public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
+
/**
* ISO B10 size.
*/
public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
- /**
+ /**
* JIS B0 size.
*/
public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
+
/**
* JIS B1 size.
*/
public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
+
/**
* JIS B2 size.
*/
public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
+
/**
* JIS B3 size.
*/
public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
+
/**
* JIS B4 size.
*/
public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
+
/**
* JIS B5 size.
*/
public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
+
/**
* JIS B6 size.
*/
public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
+
/**
* JIS B7 size.
*/
public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
+
/**
* JIS B8 size.
*/
public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
+
/**
* JIS B9 size.
*/
public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
+
/**
* JIS B10 size.
*/
@@ -186,198 +217,216 @@
* ISO C0 size.
*/
public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
+
/**
* ISO C1 size.
*/
public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
+
/**
* ISO C2 size.
*/
public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
+
/**
* ISO C3 size.
*/
public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
+
/**
* ISO C4 size.
*/
public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
+
/**
* ISO C5 size.
*/
public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
+
/**
- * letter size.
+ * letter size.
*/
public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
+
/**
- * letter size.
+ * letter size.
*/
public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
/**
- * legal size .
+ * legal size.
*/
public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
/**
- * executive size .
+ * executive size.
*/
public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
/**
- * ledger size .
+ * ledger size.
*/
public static final MediaSizeName LEDGER = new MediaSizeName(43);
/**
- * tabloid size .
+ * tabloid size.
*/
public static final MediaSizeName TABLOID = new MediaSizeName(44);
/**
- * invoice size .
+ * invoice size.
*/
public static final MediaSizeName INVOICE = new MediaSizeName(45);
/**
- * folio size .
+ * folio size.
*/
public static final MediaSizeName FOLIO = new MediaSizeName(46);
/**
- * quarto size .
+ * quarto size.
*/
public static final MediaSizeName QUARTO = new MediaSizeName(47);
/**
- * Japanese Postcard size.
+ * Japanese Postcard size.
*/
public static final MediaSizeName
JAPANESE_POSTCARD = new MediaSizeName(48);
- /**
- * Japanese Double Postcard size.
+
+ /**
+ * Japanese Double Postcard size.
*/
public static final MediaSizeName
JAPANESE_DOUBLE_POSTCARD = new MediaSizeName(49);
/**
- * A size .
+ * A size.
*/
public static final MediaSizeName A = new MediaSizeName(50);
/**
- * B size .
+ * B size.
*/
public static final MediaSizeName B = new MediaSizeName(51);
/**
- * C size .
+ * C size.
*/
public static final MediaSizeName C = new MediaSizeName(52);
/**
- * D size .
+ * D size.
*/
public static final MediaSizeName D = new MediaSizeName(53);
/**
- * E size .
+ * E size.
*/
public static final MediaSizeName E = new MediaSizeName(54);
/**
- * ISO designated long size .
+ * ISO designated long size.
*/
public static final MediaSizeName
ISO_DESIGNATED_LONG = new MediaSizeName(55);
/**
- * Italy envelope size .
+ * Italy envelope size.
*/
public static final MediaSizeName
ITALY_ENVELOPE = new MediaSizeName(56); // DESIGNATED_LONG?
/**
- * monarch envelope size .
+ * monarch envelope size.
*/
public static final MediaSizeName
MONARCH_ENVELOPE = new MediaSizeName(57);
+
/**
- * personal envelope size .
+ * personal envelope size.
*/
public static final MediaSizeName
PERSONAL_ENVELOPE = new MediaSizeName(58);
+
/**
- * number 9 envelope size .
+ * number 9 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_9_ENVELOPE = new MediaSizeName(59);
+
/**
- * number 10 envelope size .
+ * number 10 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_10_ENVELOPE = new MediaSizeName(60);
+
/**
- * number 11 envelope size .
+ * number 11 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_11_ENVELOPE = new MediaSizeName(61);
+
/**
- * number 12 envelope size .
+ * number 12 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_12_ENVELOPE = new MediaSizeName(62);
+
/**
- * number 14 envelope size .
+ * number 14 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_14_ENVELOPE = new MediaSizeName(63);
- /**
- * 6x9 North American envelope size.
+
+ /**
+ * 6x9 North American envelope size.
*/
public static final MediaSizeName
NA_6X9_ENVELOPE = new MediaSizeName(64);
- /**
- * 7x9 North American envelope size.
+
+ /**
+ * 7x9 North American envelope size.
*/
public static final MediaSizeName
NA_7X9_ENVELOPE = new MediaSizeName(65);
- /**
- * 9x11 North American envelope size.
+
+ /**
+ * 9x11 North American envelope size.
*/
public static final MediaSizeName
NA_9X11_ENVELOPE = new MediaSizeName(66);
+
/**
- * 9x12 North American envelope size.
+ * 9x12 North American envelope size.
*/
public static final MediaSizeName
NA_9X12_ENVELOPE = new MediaSizeName(67);
/**
- * 10x13 North American envelope size .
+ * 10x13 North American envelope size.
*/
public static final MediaSizeName
NA_10X13_ENVELOPE = new MediaSizeName(68);
/**
- * 10x14North American envelope size .
+ * 10x14North American envelope size.
*/
public static final MediaSizeName
NA_10X14_ENVELOPE = new MediaSizeName(69);
/**
- * 10x15 North American envelope size.
+ * 10x15 North American envelope size.
*/
public static final MediaSizeName
NA_10X15_ENVELOPE = new MediaSizeName(70);
/**
- * 5x7 North American paper.
+ * 5x7 North American paper.
*/
public static final MediaSizeName
NA_5X7 = new MediaSizeName(71);
/**
- * 8x10 North American paper.
+ * 8x10 North American paper.
*/
public static final MediaSizeName
NA_8X10 = new MediaSizeName(72);
@@ -386,12 +435,15 @@
* Construct a new media size enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaSizeName(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaSizeName}.
+ */
private static final String[] myStringTable = {
"iso-a0",
"iso-a1",
@@ -468,6 +520,9 @@
"na-8x10",
};
+ /**
+ * The enumeration value table for class {@code MediaSizeName}.
+ */
private static final MediaSizeName[] myEnumValueTable = {
ISO_A0,
ISO_A1,
@@ -544,9 +599,8 @@
NA_8X10,
};
-
/**
- * Returns the string table for class MediaSizeName.
+ * Returns the string table for class {@code MediaSizeName}.
*/
protected String[] getStringTable()
{
@@ -554,11 +608,9 @@
}
/**
- * Returns the enumeration value table for class MediaSizeName.
+ * Returns the enumeration value table for class {@code MediaSizeName}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,29 +22,30 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
-
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-
/**
- * Class MediaTray is a subclass of Media.
- * Class MediaTray is a printing attribute class, an enumeration, that
- * specifies the media tray or bin for the job.
- * This attribute can be used instead of specifying MediaSize or MediaName.
+ * Class {@code MediaTray} is a subclass of {@code Media}. Class
+ * {@code MediaTray} is a printing attribute class, an enumeration, that
+ * specifies the media tray or bin for the job. This attribute can be used
+ * instead of specifying {@code MediaSize} or {@code MediaName}.
* <p>
- * Class MediaTray declares keywords for standard media kind values.
- * Implementation- or site-defined names for a media kind attribute may also
- * be created by defining a subclass of class MediaTray.
- * <P>
- * <B>IPP Compatibility:</B> MediaTray is a representation class for
+ * Class {@code MediaTray} declares keywords for standard media kind values.
+ * Implementation- or site-defined names for a media kind attribute may also be
+ * created by defining a subclass of class {@code MediaTray}.
+ * <p>
+ * <b>IPP Compatibility:</b> {@code MediaTray} is a representation class for
* values of the IPP "media" attribute which name paper trays.
*/
public class MediaTray extends Media implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -982503611095214703L;
/**
@@ -91,12 +92,15 @@
* Construct a new media tray enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaTray(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaTray}.
+ */
private static final String[] myStringTable ={
"top",
"middle",
@@ -108,6 +112,9 @@
"side"
};
+ /**
+ * The enumeration value table for class {@code MediaTray}.
+ */
private static final MediaTray[] myEnumValueTable = {
TOP,
MIDDLE,
@@ -120,7 +127,7 @@
};
/**
- * Returns the string table for class MediaTray.
+ * Returns the string table for class {@code MediaTray}.
*/
protected String[] getStringTable()
{
@@ -128,11 +135,9 @@
}
/**
- * Returns the enumeration value table for class MediaTray.
+ * Returns the enumeration value table for class {@code MediaTray}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java Thu Aug 31 15:47:34 2017 -0700
@@ -22,178 +22,162 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class MultipleDocumentHandling is a printing attribute class, an enumeration,
- * that controls finishing operations and the placement of one or more
- * print-stream pages into impressions and onto media sheets. When the value of
- * the {@link Copies Copies} attribute exceeds 1, MultipleDocumentHandling also
- * controls the order in which the copies that result from processing the
- * documents are produced. This attribute is relevant only for a multidoc print
- * job consisting of two or more individual docs.
- * <P>
- * Briefly, MultipleDocumentHandling determines the relationship between the
- * multiple input (electronic) documents fed into a multidoc print job and the
- * output (physical) document or documents produced by the multidoc print job.
+ * Class {@code MultipleDocumentHandling} is a printing attribute class, an
+ * enumeration, that controls finishing operations and the placement of one or
+ * more print-stream pages into impressions and onto media sheets. When the
+ * value of the {@link Copies Copies} attribute exceeds 1,
+ * {@code MultipleDocumentHandling} also controls the order in which the copies
+ * that result from processing the documents are produced. This attribute is
+ * relevant only for a multidoc print job consisting of two or more individual
+ * docs.
+ * <p>
+ * Briefly, {@code MultipleDocumentHandling} determines the relationship between
+ * the multiple input (electronic) documents fed into a multidoc print job and
+ * the output (physical) document or documents produced by the multidoc print
+ * job.
* There are two possibilities:
- * <UL>
- * <LI>
- * The multiple input documents are combined into a single output document.
- * Finishing operations ({@link Finishings Finishings}),
- * are performed on this single output
- * document. The {@link Copies Copies} attribute tells how many copies of this
- * single output document to produce. The MultipleDocumentHandling values
- * SINGLE_DOCUMENT and SINGLE_DOCUMENT_NEW_SHEET specify two variations of
- * this possibility.
- *
- * <LI>
- * The multiple input documents remain separate output documents. Finishing
- * operations ({@link Finishings Finishings}),
- * are performed on each output document
- * separately. The {@link Copies Copies} attribute tells how many copies of each
- * separate output document to produce. The MultipleDocumentHandling values
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and SEPARATE_DOCUMENTS_COLLATED_COPIES
- * specify two variations of this possibility.
- * </UL>
- * <P>
- * In the detailed explanations below, if "{@code a}" represents an
- * instance of document data, then the result of processing the data in
- * document "{@code a}" is a sequence of media sheets represented by
- * "{@code a(*)}".
- * <P>
- * The standard MultipleDocumentHandling values are:
- * <UL>
- * <LI>
- * <a id="sdfi"></a>{@link #SINGLE_DOCUMENT
- * <B>SINGLE_DOCUMENT</B>}. If a print job has multiple
- * documents -- say, the document data is called {@code a} and
- * {@code b} -- then the result of processing all the document data
- * ({@code a} and then {@code b}) must be treated as a single sequence
- * of media sheets for finishing operations; that is, finishing would be
- * performed on the concatenation of the sequences {@code a(*),b(*)}. The
- * printer must not force the data in each document instance to be formatted
- * onto a new print-stream page, nor to start a new impression on a new media
- * sheet. If more than one copy is made, the ordering of the sets of media
- * sheets resulting from processing the document data must be
- * {@code a(*),b(*),a(*),b(*),...}, and the printer object must force
- * each copy ({@code a(*),b(*)}) to start on a new media sheet.
- *
- * <LI>
- * <a id="sducfi"></a>{@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
- * <B>SEPARATE_DOCUMENTS_UNCOLLATED_COPIES</B>}. If a print job
- * has multiple documents -- say, the document data is called {@code a} and
- * {@code b} -- then the result of processing the data in each document
- * instance must be treated as a single sequence of media sheets for finishing
- * operations; that is, the sets {@code a(*)} and {@code b(*)} would
- * each be finished separately. The printer must force each copy of the result
- * of processing the data in a single document to start on a new media sheet.
- * If more than one copy is made, the ordering of the sets of media sheets
- * resulting from processing the document data must be
- * {@code a(*),a(*),...,b(*),b(*)...}.
- *
- * <LI>
- * <a id="sdccfi"></a>{@link #SEPARATE_DOCUMENTS_COLLATED_COPIES
- * <B>SEPARATE_DOCUMENTS_COLLATED_COPIES</B>}. If a print job
- * has multiple documents -- say, the document data is called {@code a} and
- * {@code b} -- then the result of processing the data in each document
- * instance must be treated as a single sequence of media sheets for finishing
- * operations; that is, the sets {@code a(*)} and {@code b(*)} would
- * each be finished separately. The printer must force each copy of the result
- * of processing the data in a single document to start on a new media sheet.
- * If more than one copy is made, the ordering of the sets of media sheets
- * resulting from processing the document data must be
- * {@code a(*),b(*),a(*),b(*),...}.
- *
- * <LI>
- * <a id="sdnsfi"></a>{@link #SINGLE_DOCUMENT_NEW_SHEET
- * <B>SINGLE_DOCUMENT_NEW_SHEET</B>}. Same as SINGLE_DOCUMENT,
- * except that the printer must ensure that the first impression of each
- * document instance in the job is placed on a new media sheet. This value
- * allows multiple documents to be stapled together with a single staple where
- * each document starts on a new sheet.
- * </UL>
- * <P>
- * SINGLE_DOCUMENT is the same as SEPARATE_DOCUMENTS_COLLATED_COPIES with
- * respect to ordering of print-stream pages, but not media sheet generation,
- * since SINGLE_DOCUMENT will put the first page of the next document on the
- * back side of a sheet if an odd number of pages have been produced so far
- * for the job, while SEPARATE_DOCUMENTS_COLLATED_COPIES always forces the
+ * <ul>
+ * <li>The multiple input documents are combined into a single output
+ * document. Finishing operations ({@link Finishings Finishings}), are
+ * performed on this single output document. The {@link Copies Copies}
+ * attribute tells how many copies of this single output document to produce.
+ * The {@code MultipleDocumentHandling} values {@code SINGLE_DOCUMENT} and
+ * {@code SINGLE_DOCUMENT_NEW_SHEET} specify two variations of this
+ * possibility.
+ * <li>The multiple input documents remain separate output documents.
+ * Finishing operations ({@link Finishings Finishings}), are performed on each
+ * output document separately. The {@link Copies Copies} attribute tells how
+ * many copies of each separate output document to produce. The
+ * {@code MultipleDocumentHandling} values
+ * {@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} and
+ * {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} specify two variations of this
+ * possibility.
+ * </ul>
+ * In the detailed explanations below, if "{@code a}" represents an instance of
+ * document data, then the result of processing the data in document "{@code a}"
+ * is a sequence of media sheets represented by "{@code a(*)}".
+ * <p>
+ * The standard {@code MultipleDocumentHandling} values are:
+ * <ul>
+ * <li><a id="sdfi"></a>{@link #SINGLE_DOCUMENT <b>SINGLE_DOCUMENT</b>}. If a
+ * print job has multiple documents -- say, the document data is called
+ * {@code a} and {@code b} -- then the result of processing all the document
+ * data ({@code a} and then {@code b}) must be treated as a single sequence of
+ * media sheets for finishing operations; that is, finishing would be
+ * performed on the concatenation of the sequences {@code a(*),b(*)}. The
+ * printer must not force the data in each document instance to be formatted
+ * onto a new print-stream page, nor to start a new impression on a new media
+ * sheet. If more than one copy is made, the ordering of the sets of media
+ * sheets resulting from processing the document data must be
+ * {@code a(*),b(*),a(*),b(*),...}, and the printer object must force each
+ * copy ({@code a(*),b(*)}) to start on a new media sheet.
+ * <li><a id="sducfi"></a>{@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
+ * <b>SEPARATE_DOCUMENTS_UNCOLLATED_COPIES</b>}. If a print job has multiple
+ * documents -- say, the document data is called {@code a} and {@code b} --
+ * then the result of processing the data in each document instance must be
+ * treated as a single sequence of media sheets for finishing operations; that
+ * is, the sets {@code a(*)} and {@code b(*)} would each be finished
+ * separately. The printer must force each copy of the result of processing
+ * the data in a single document to start on a new media sheet. If more than
+ * one copy is made, the ordering of the sets of media sheets resulting from
+ * processing the document data must be {@code a(*),a(*),...,b(*),b(*)...}.
+ * <li><a id="sdccfi"></a>{@link #SEPARATE_DOCUMENTS_COLLATED_COPIES
+ * <b>SEPARATE_DOCUMENTS_COLLATED_COPIES</b>}. If a print job has multiple
+ * documents -- say, the document data is called {@code a} and {@code b} --
+ * then the result of processing the data in each document instance must be
+ * treated as a single sequence of media sheets for finishing operations; that
+ * is, the sets {@code a(*)} and {@code b(*)} would each be finished
+ * separately. The printer must force each copy of the result of processing
+ * the data in a single document to start on a new media sheet. If more than
+ * one copy is made, the ordering of the sets of media sheets resulting from
+ * processing the document data must be {@code a(*),b(*),a(*),b(*),...}.
+ * <li><a id="sdnsfi"></a>{@link #SINGLE_DOCUMENT_NEW_SHEET
+ * <b>SINGLE_DOCUMENT_NEW_SHEET</b>}. Same as SINGLE_DOCUMENT, except that the
+ * printer must ensure that the first impression of each document instance in
+ * the job is placed on a new media sheet. This value allows multiple
+ * documents to be stapled together with a single staple where each document
+ * starts on a new sheet.
+ * </ul>
+ * <p>
+ * {@code SINGLE_DOCUMENT} is the same as
+ * {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} with respect to ordering of
+ * print-stream pages, but not media sheet generation, since
+ * {@code SINGLE_DOCUMENT} will put the first page of the next document on the
+ * back side of a sheet if an odd number of pages have been produced so far for
+ * the job, while {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} always forces the
* next document or document copy on to a new sheet.
- * <P>
+ * <p>
* In addition, if a {@link Finishings Finishings} attribute of
* {@link Finishings#STAPLE STAPLE} is specified, then:
- * <UL>
- * <LI>
- * With SINGLE_DOCUMENT, documents {@code a} and {@code b} are
- * stapled together as a single document with no regard to new sheets.
- *
- * <LI>
- * With SINGLE_DOCUMENT_NEW_SHEET, documents {@code a} and {@code b}
- * are stapled together as a single document, but document {@code b}
- * starts on a new sheet.
+ * <ul>
+ * <li>With {@code SINGLE_DOCUMENT}, documents {@code a} and {@code b} are
+ * stapled together as a single document with no regard to new sheets.
+ * <li>With {@code SINGLE_DOCUMENT_NEW_SHEET}, documents {@code a} and
+ * {@code b} are stapled together as a single document, but document {@code b}
+ * starts on a new sheet.
+ * <li>With {@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} and
+ * {@code SEPARATE_DOCUMENTS_COLLATED_COPIES}, documents {@code a} and
+ * {@code b} are stapled separately.
+ * </ul>
+ * <i>Note:</i> None of these values provide means to produce uncollated sheets
+ * within a document, i.e., where multiple copies of sheet <i>n</i> are produced
+ * before sheet <i>n</i>+1 of the same document. To specify that, see the
+ * {@link SheetCollate SheetCollate} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * <LI>
- * With SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and
- * SEPARATE_DOCUMENTS_COLLATED_COPIES, documents {@code a} and
- * {@code b} are stapled separately.
- * </UL>
- * <P>
- * <I>Note:</I> None of these values provide means to produce uncollated
- * sheets within a document, i.e., where multiple copies of sheet <I>n</I>
- * are produced before sheet <I>n</I>+1 of the same document.
- * To specify that, see the {@link SheetCollate SheetCollate} attribute.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- *
- * @see Copies
- * @see Finishings
- * @see NumberUp
- * @see PageRanges
- * @see SheetCollate
- * @see Sides
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
+ * @see Copies
+ * @see Finishings
+ * @see NumberUp
+ * @see PageRanges
+ * @see SheetCollate
+ * @see Sides
*/
public class MultipleDocumentHandling extends EnumSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8098326460746413466L;
-
/**
- * Single document -- see above for <A HREF="#sdfi">further
- * information</A>.
+ * Single document -- see above for <a href="#sdfi">further information</a>.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT = new MultipleDocumentHandling (0);
/**
* Separate documents uncollated copies -- see above for
- * <A HREF="#sducfi">further information</A>.
+ * <a href="#sducfi">further information</a>.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling (1);
/**
* Separate documents collated copies -- see above for
- * <A HREF="#sdccfi">further information</A>.
+ * <a href="#sdccfi">further information</a>.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling (2);
/**
- * Single document new sheet -- see above for
- * <A HREF="#sdnsfi">further information</A>.
+ * Single document new sheet -- see above for <a href="#sdnsfi">further
+ * information</a>.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling (3);
@@ -203,12 +187,15 @@
* Construct a new multiple document handling enumeration value with the
* given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MultipleDocumentHandling(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MultipleDocumentHandling}.
+ */
private static final String[] myStringTable = {
"single-document",
"separate-documents-uncollated-copies",
@@ -216,6 +203,9 @@
"single-document-new-sheet"
};
+ /**
+ * The enumeration value table for class {@code MultipleDocumentHandling}.
+ */
private static final MultipleDocumentHandling[] myEnumValueTable = {
SINGLE_DOCUMENT,
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
@@ -224,14 +214,15 @@
};
/**
- * Returns the string table for class MultipleDocumentHandling.
+ * Returns the string table for class {@code MultipleDocumentHandling}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class MultipleDocumentHandling.
+ * Returns the enumeration value table for class
+ * {@code MultipleDocumentHandling}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -240,12 +231,13 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class MultipleDocumentHandling and any vendor-defined subclasses,
- * the category is class MultipleDocumentHandling itself.
+ * <p>
+ * For class {@code MultipleDocumentHandling} and any vendor-defined
+ * subclasses, the category is class {@code MultipleDocumentHandling}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return MultipleDocumentHandling.class;
@@ -254,14 +246,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class MultipleDocumentHandling and any vendor-defined subclasses,
- * the category name is {@code "multiple-document-handling"}.
+ * <p>
+ * For class {@code MultipleDocumentHandling} and any vendor-defined
+ * subclasses, the category name is {@code "multiple-document-handling"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "multiple-document-handling";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,31 +30,30 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberOfDocuments is an integer valued printing attribute that
+ * Class {@code NumberOfDocuments} is an integer valued printing attribute that
* indicates the number of individual docs the printer has accepted for this
* job, regardless of whether the docs' print data has reached the printer or
* not.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberOfDocuments extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7891881310684461097L;
-
/**
* Construct a new number of documents attribute with the given integer
* value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public NumberOfDocuments(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -61,22 +61,18 @@
/**
* Returns whether this number of documents attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class NumberOfDocuments.
- * <LI>
- * This number of documents attribute's value and {@code object}'s
- * value are equal.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code NumberOfDocuments}.
+ * <li>This number of documents attribute's value and {@code object}'s
+ * value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number of
- * documents attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number of
+ * documents attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -86,12 +82,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class NumberOfDocuments, the
- * category is class NumberOfDocuments itself.
+ * <p>
+ * For class {@code NumberOfDocuments}, the category is class
+ * {@code NumberOfDocuments} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return NumberOfDocuments.class;
@@ -100,14 +96,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class NumberOfDocuments, the
- * category name is {@code "number-of-documents"}.
+ * <p>
+ * For class {@code NumberOfDocuments}, the category name is
+ * {@code "number-of-documents"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-of-documents";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,30 +30,30 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberOfInterveningJobs is an integer valued printing attribute that
- * indicates the number of jobs that are ahead of this job in the relative
- * chronological order of expected time to complete (i.e., the current
- * scheduled order).
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * Class {@code NumberOfInterveningJobs} is an integer valued printing attribute
+ * that indicates the number of jobs that are ahead of this job in the relative
+ * chronological order of expected time to complete (i.e., the current scheduled
+ * order).
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberOfInterveningJobs extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2568141124844982746L;
/**
* Construct a new number of intervening jobs attribute with the given
* integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public NumberOfInterveningJobs(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -62,20 +63,17 @@
* Returns whether this number of intervening jobs attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class NumberOfInterveningJobs.
- * <LI>
- * This number of intervening jobs attribute's value and
- * {@code object}'s value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code NumberOfInterveningJobs}.
+ * <li>This number of intervening jobs attribute's value and
+ * {@code object}'s value are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number of
- * intervening jobs attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number of
+ * intervening jobs attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -85,12 +83,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class NumberOfInterveningJobs, the
- * category is class NumberOfInterveningJobs itself.
+ * <p>
+ * For class {@code NumberOfInterveningJobs}, the category is class
+ * {@code NumberOfInterveningJobs} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return NumberOfInterveningJobs.class;
@@ -99,14 +97,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class NumberOfInterveningJobs, the
- * category name is {@code "number-of-intervening-jobs"}.
+ * <p>
+ * For class {@code NumberOfInterveningJobs}, the category name is
+ * {@code "number-of-intervening-jobs"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-of-intervening-jobs";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,120 +22,107 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberUp is an integer valued printing attribute class that specifies
- * the number of print-stream pages to impose upon a single side of an
- * instance of a selected medium. That is, if the NumberUp value is <I>n,</I>
- * the printer must place <I>n</I> print-stream pages on a single side of
- * an instance of the
- * selected medium. To accomplish this, the printer may add some sort of
- * translation, scaling, or rotation. This attribute primarily controls the
- * translation, scaling and rotation of print-stream pages.
- * <P>
- * The effect of a NumberUp attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same number up
- * values specified or whether different docs have different number up values
- * specified, and on the (perhaps defaulted) value of the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} attribute.
- * <UL>
- * <LI>
- * If all the docs have the same number up value <I>n</I> specified, then any
- * value of {@link MultipleDocumentHandling MultipleDocumentHandling} makes
- * sense, and the printer's processing depends on the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} value:
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be combined together into one
- * output document. Each media impression will consist of <I>n</I>m
- * print-stream pages from the output document.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
- * into one output document. Each media impression will consist of <I>n</I>
- * print-stream pages from the output document. However, the first impression of
- * each input doc will always start on a new media sheet; this means the last
- * impression of an input doc may have fewer than <I>n</I> print-stream pages
- * on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
- * Each media impression will consist of <I>n</I> print-stream pages from the
- * input doc. Since the input docs are separate, the first impression of each
- * input doc will always start on a new media sheet; this means the last
- * impression of an input doc may have fewer than <I>n</I> print-stream pages on
- * it.
+ * Class {@code NumberUp} is an integer valued printing attribute class that
+ * specifies the number of print-stream pages to impose upon a single side of an
+ * instance of a selected medium. That is, if the NumberUp value is <i>n,</i>
+ * the printer must place <i>n</i> print-stream pages on a single side of an
+ * instance of the selected medium. To accomplish this, the printer may add some
+ * sort of translation, scaling, or rotation. This attribute primarily controls
+ * the translation, scaling and rotation of print-stream pages.
+ * <p>
+ * The effect of a {@code NumberUp} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same number
+ * up values specified or whether different docs have different number up values
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ * <ul>
+ * <li>If all the docs have the same number up value <i>n</i> specified, then
+ * any value of {@link MultipleDocumentHandling MultipleDocumentHandling}
+ * makes sense, and the printer's processing depends on the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} value:
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be combined
+ * together into one output document. Each media impression will consist of
+ * <i>n</i>m print-stream pages from the output document.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be
+ * combined together into one output document. Each media impression will
+ * consist of <i>n</i> print-stream pages from the output document. However,
+ * the first impression of each input doc will always start on a new media
+ * sheet; this means the last impression of an input doc may have fewer than
+ * <i>n</i> print-stream pages on it.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- The input docs will
+ * remain separate. Each media impression will consist of <i>n</i>
+ * print-stream pages from the input doc. Since the input docs are separate,
+ * the first impression of each input doc will always start on a new media
+ * sheet; this means the last impression of an input doc may have fewer than
+ * <i>n</i> print-stream pages on it.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- The input docs will
+ * remain separate. Each media impression will consist of <i>n</i>
+ * print-stream pages from the input doc. Since the input docs are separate,
+ * the first impression of each input doc will always start on a new media
+ * sheet; this means the last impression of an input doc may have fewer than
+ * <i>n</i> print-stream pages on it.
+ * </ul>
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be combined
+ * together into one output document. Each media impression will consist of
+ * <i>n<sub>i</sub></i> print-stream pages from the output document, where
+ * <i>i</i> is the number of the input doc corresponding to that point in
+ * the output document. When the next input doc has a different number up
+ * value from the previous input doc, the first print-stream page of the
+ * next input doc goes at the start of the next media impression, possibly
+ * leaving fewer than the full number of print-stream pages on the previous
+ * media impression.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be
+ * combined together into one output document. Each media impression will
+ * consist of <i>n</i> print-stream pages from the output document. However,
+ * the first impression of each input doc will always start on a new media
+ * sheet; this means the last impression of an input doc may have fewer than
+ * <i>n</i> print-stream pages on it.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- The input docs will
+ * remain separate. For input doc <i>i,</i> each media impression will
+ * consist of <i>n<sub>i</sub></i> print-stream pages from the input doc.
+ * Since the input docs are separate, the first impression of each input doc
+ * will always start on a new media sheet; this means the last impression of
+ * an input doc may have fewer than <i>n<sub>i</sub></i> print-stream pages
+ * on it.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- The input docs will
+ * remain separate. For input doc <i>i,</i> each media impression will
+ * consist of <i>n<sub>i</sub></i> print-stream pages from the input doc.
+ * Since the input docs are separate, the first impression of each input doc
+ * will always start on a new media sheet; this means the last impression of
+ * an input doc may have fewer than <i>n<sub>i</sub></i> print-stream pages
+ * on it.
+ * </ul>
+ * </ul>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
- * Each media impression will consist of <I>n</I> print-stream pages from the
- * input doc. Since the input docs are separate, the first impression of each
- * input doc will always start on a new media sheet; this means the last
- * impression of an input doc may have fewer than <I>n</I> print-stream pages
- * on it.
- * </UL>
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be combined together into one
- * output document. Each media impression will consist of <I>n<SUB>i</SUB></I>
- * print-stream pages from the output document, where <I>i</I> is the number of
- * the input doc corresponding to that point in the output document. When the
- * next input doc has a different number up value from the previous input doc,
- * the first print-stream page of the next input doc goes at the start of the
- * next media impression, possibly leaving fewer than the full number of
- * print-stream pages on the previous media impression.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
- * into one output document. Each media impression will consist of <I>n</I>
- * print-stream pages from the output document. However, the first impression of
- * each input doc will always start on a new media sheet; this means the last
- * impression of an input doc may have fewer than <I>n</I> print-stream pages
- * on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
- * For input doc <I>i,</I> each media impression will consist of
- * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
- * docs are separate, the first impression of each input doc will always start
- * on a new media sheet; this means the last impression of an input doc may have
- * fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
- * For input doc <I>i,</I> each media impression will consist of
- * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
- * docs are separate, the first impression of each input doc will always start
- * on a new media sheet; this means the last impression of an input doc may
- * have fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
- * </UL>
- * </UL>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberUp extends IntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3040436486786527811L;
-
/**
* Construct a new number up attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 1.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value < 1}
*/
public NumberUp(int value) {
super (value, 1, Integer.MAX_VALUE);
@@ -144,20 +131,16 @@
/**
* Returns whether this number up attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class NumberUp.
- * <LI>
- * This number up attribute's value and {@code object}'s value are
- * equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code NumberUp}.
+ * <li>This number up attribute's value and {@code object}'s value are
+ * equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number up
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number up
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof NumberUp);
@@ -166,11 +149,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class NumberUp, the category is class NumberUp itself.
+ * <p>
+ * For class {@code NumberUp}, the category is class {@code NumberUp}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return NumberUp.class;
@@ -179,13 +163,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class NumberUp, the category name is {@code "number-up"}.
+ * <p>
+ * For class {@code NumberUp}, the category name is {@code "number-up"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-up";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,41 +30,39 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class NumberUpSupported is a printing attribute class, a set of integers,
- * that gives the supported values for a {@link NumberUp NumberUp} attribute.
- * <P>
- * <B>IPP Compatibility:</B> The NumberUpSupported attribute's canonical array
+ * Class {@code NumberUpSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a {@link NumberUp NumberUp}
+ * attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The NumberUpSupported attribute's canonical array
* form gives the lower and upper bound for each range of number-up to be
- * included in an IPP "number-up-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * included in an IPP "number-up-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberUpSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
- private static final long serialVersionUID = -1041573395759141805L;
-
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
+ private static final long serialVersionUID = -1041573395759141805L;
/**
- * Construct a new number up supported attribute with the given members.
- * The supported values for NumberUp are specified in "array form;" see
- * class
- * {@link javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax}
- * for an explanation of array form.
- *
- * @param members Set members in array form.
+ * Construct a new number up supported attribute with the given members. The
+ * supported values for NumberUp are specified in "array form;" see class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for
+ * an explanation of array form.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if any element of
- * {@code members} is not a length-one or length-two array. Also
- * thrown if {@code members} is a zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in array form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if any element of {@code members} is not
+ * a length-one or length-two array. Also if {@code members} is a
+ * zero-length array or if any member of the set is less than 1.
*/
public NumberUpSupported(int[][] members) {
super (members);
@@ -86,13 +85,10 @@
/**
* Construct a new number up supported attribute containing a single
- * integer. That is, only the one value of NumberUp is supported.
- *
- * @param member Set member.
+ * integer. That is, only the one value of {@code NumberUp} is supported.
*
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than
- * 1.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member < 1}
*/
public NumberUpSupported(int member) {
super (member);
@@ -103,16 +99,14 @@
/**
* Construct a new number up supported attribute containing a single range
- * of integers. That is, only those values of NumberUp in the one range are
- * supported.
+ * of integers. That is, only those values of {@code NumberUp} in the one
+ * range are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 1.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than 1
*/
public NumberUpSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -126,22 +120,18 @@
/**
* Returns whether this number up supported attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class NumberUpSupported.
- * <LI>
- * This number up supported attribute's members and {@code object}'s
- * members are the same.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code NumberUpSupported}.
+ * <li>This number up supported attribute's members and {@code object}'s
+ * members are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number up
- * supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number up
+ * supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -151,12 +141,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class NumberUpSupported, the
- * category is class NumberUpSupported itself.
+ * <p>
+ * For class {@code NumberUpSupported}, the category is class
+ * {@code NumberUpSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return NumberUpSupported.class;
@@ -165,14 +155,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class NumberUpSupported, the
- * category name is {@code "number-up-supported"}.
+ * <p>
+ * For class {@code NumberUpSupported}, the category name is
+ * {@code "number-up-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-up-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class OrientationRequested is a printing attribute class, an enumeration,
- * that indicates the desired orientation for printed print-stream pages; it
- * does not describe the orientation of the client-supplied print-stream
- * pages.
- * <P>
- * For some document formats (such as {@code "application/postscript"}),
- * the desired orientation of the print-stream pages is specified within the
- * document data. This information is generated by a device driver prior to
- * the submission of the print job. Other document formats (such as
- * {@code "text/plain"}) do not include the notion of desired orientation
- * within the document data. In the latter case it is possible for the printer
- * to bind the desired orientation to the document data after it has been
- * submitted. It is expected that a printer would only support the
- * OrientationRequested attribute for some document formats (e.g.,
+ * Class {@code OrientationRequested} is a printing attribute class, an
+ * enumeration, that indicates the desired orientation for printed print-stream
+ * pages; it does not describe the orientation of the client-supplied
+ * print-stream pages.
+ * <p>
+ * For some document formats (such as {@code "application/postscript"}), the
+ * desired orientation of the print-stream pages is specified within the
+ * document data. This information is generated by a device driver prior to the
+ * submission of the print job. Other document formats (such as
+ * {@code "text/plain"}) do not include the notion of desired orientation within
+ * the document data. In the latter case it is possible for the printer to bind
+ * the desired orientation to the document data after it has been submitted. It
+ * is expected that a printer would only support the
+ * {@code OrientationRequested} attribute for some document formats (e.g.,
* {@code "text/plain"} or {@code "text/html"}) but not others (e.g.
- * {@code "application/postscript"}). This is no different from any other
- * job template attribute, since a print job can always impose constraints
- * among the values of different job template attributes.
- * However, a special mention
- * is made here since it is very likely that a printer will support the
- * OrientationRequested attribute for only a subset of the supported document
- * formats.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * {@code "application/postscript"}). This is no different from any other job
+ * template attribute, since a print job can always impose constraints among the
+ * values of different job template attributes. However, a special mention is
+ * made here since it is very likely that a printer will support the
+ * {@code OrientationRequested} attribute for only a subset of the supported
+ * document formats.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class OrientationRequested extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4447437289862822276L;
/**
@@ -73,11 +76,10 @@
PORTRAIT = new OrientationRequested(3);
/**
- * The content will be imaged across the long edge of the medium.
- * Landscape is defined to be a rotation of the print-stream page to be
- * imaged by +90 degrees with respect to the medium
- * (i.e. anti-clockwise) from the
- * portrait orientation. <I>Note:</I> The +90 direction was chosen because
+ * The content will be imaged across the long edge of the medium. Landscape
+ * is defined to be a rotation of the print-stream page to be imaged by +90
+ * degrees with respect to the medium (i.e. anti-clockwise) from the
+ * portrait orientation. <i>Note:</i> The +90 direction was chosen because
* simple finishing on the long edge is the same edge whether portrait or
* landscape.
*/
@@ -85,13 +87,13 @@
LANDSCAPE = new OrientationRequested(4);
/**
- * The content will be imaged across the long edge of the medium, but in
- * the opposite manner from landscape. Reverse-landscape is defined to be
- * a rotation of the print-stream page to be imaged by -90 degrees with
+ * The content will be imaged across the long edge of the medium, but in the
+ * opposite manner from landscape. Reverse-landscape is defined to be a
+ * rotation of the print-stream page to be imaged by -90 degrees with
* respect to the medium (i.e. clockwise) from the portrait orientation.
- * <I>Note:</I> The REVERSE_LANDSCAPE value was added because some
- * applications rotate landscape -90 degrees from portrait, rather than
- * +90 degrees.
+ * <i>Note:</i> The REVERSE_LANDSCAPE value was added because some
+ * applications rotate landscape -90 degrees from portrait, rather than +90
+ * degrees.
*/
public static final OrientationRequested
REVERSE_LANDSCAPE = new OrientationRequested(5);
@@ -100,14 +102,14 @@
* The content will be imaged across the short edge of the medium, but in
* the opposite manner from portrait. Reverse-portrait is defined to be a
* rotation of the print-stream page to be imaged by 180 degrees with
- * respect to the medium from the portrait orientation. <I>Note:</I> The
- * REVERSE_PORTRAIT value was added for use with the {@link
- * Finishings Finishings} attribute in cases where the
- * opposite edge is desired for finishing a portrait document on simple
- * finishing devices that have only one finishing position. Thus a
- * {@code "text/plain"} portrait document can be stapled "on the
- * right" by a simple finishing device as is common use with some
- * Middle Eastern languages such as Hebrew.
+ * respect to the medium from the portrait orientation. <i>Note:</i> The
+ * REVERSE_PORTRAIT value was added for use with the
+ * {@link Finishings Finishings} attribute in cases where the opposite edge
+ * is desired for finishing a portrait document on simple finishing devices
+ * that have only one finishing position. Thus a {@code "text/plain"}
+ * portrait document can be stapled "on the right" by a simple finishing
+ * device as is common use with some Middle Eastern languages such as
+ * Hebrew.
*/
public static final OrientationRequested
REVERSE_PORTRAIT = new OrientationRequested(6);
@@ -116,12 +118,15 @@
* Construct a new orientation requested enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected OrientationRequested(int value) {
super(value);
}
+ /**
+ * The string table for class {@code OrientationRequested}.
+ */
private static final String[] myStringTable = {
"portrait",
"landscape",
@@ -129,6 +134,9 @@
"reverse-portrait"
};
+ /**
+ * The enumeration value table for class {@code OrientationRequested}.
+ */
private static final OrientationRequested[] myEnumValueTable = {
PORTRAIT,
LANDSCAPE,
@@ -137,21 +145,23 @@
};
/**
- * Returns the string table for class OrientationRequested.
+ * Returns the string table for class {@code OrientationRequested}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class OrientationRequested.
+ * Returns the enumeration value table for class
+ * {@code OrientationRequested}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
- * Returns the lowest integer value used by class OrientationRequested.
+ * Returns the lowest integer value used by class
+ * {@code OrientationRequested}.
*/
protected int getOffset() {
return 3;
@@ -160,12 +170,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class OrientationRequested, the
- * category is class OrientationRequested itself.
+ * <p>
+ * For class {@code OrientationRequested}, the category is class
+ * {@code OrientationRequested} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return OrientationRequested.class;
@@ -174,14 +184,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class OrientationRequested, the
- * category name is {@code "orientation-requested"}.
+ * <p>
+ * For class {@code OrientationRequested}, the category name is
+ * {@code "orientation-requested"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "orientation-requested";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,46 +22,48 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class OutputDeviceAssigned is a printing attribute class, a text attribute,
- * that identifies the output device to which the service has assigned this
- * job. If an output device implements an embedded Print Service instance, the
- * printer need not set this attribute. If a print server implements a
- * Print Service instance, the value may be empty (zero- length string) or not
- * returned until the service assigns an output device to the job. This
- * attribute is particularly useful when a single service supports multiple
- * devices (so called "fan-out").
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code OutputDeviceAssigned} is a printing attribute class, a text
+ * attribute, that identifies the output device to which the service has
+ * assigned this job. If an output device implements an embedded Print Service
+ * instance, the printer need not set this attribute. If a print server
+ * implements a Print Service instance, the value may be empty (zero- length
+ * string) or not returned until the service assigns an output device to the
+ * job. This attribute is particularly useful when a single service supports
+ * multiple devices (so called "fan-out").
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class OutputDeviceAssigned extends TextSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5486733778854271081L;
/**
* Constructs a new output device assigned attribute with the given device
* name and locale.
*
- * @param deviceName Device name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code deviceName} is null.
+ * @param deviceName device name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code deviceName} is {@code null}
*/
public OutputDeviceAssigned(String deviceName, Locale locale) {
@@ -74,23 +76,19 @@
* Returns whether this output device assigned attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class OutputDeviceAssigned.
- * <LI>
- * This output device assigned attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This output device assigned attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code OutputDeviceAssigned}.
+ * <li>This output device assigned attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This output device assigned attribute's locale and {@code object}'s
+ * locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this output
- * device assigned attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this output
+ * device assigned attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -100,12 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class OutputDeviceAssigned, the
- * category is class OutputDeviceAssigned itself.
+ * <p>
+ * For class {@code OutputDeviceAssigned}, the category is class
+ * {@code OutputDeviceAssigned} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return OutputDeviceAssigned.class;
@@ -114,14 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class OutputDeviceAssigned, the
- * category name is {@code "output-device-assigned"}.
+ * <p>
+ * For class {@code OutputDeviceAssigned}, the category name is
+ * {@code "output-device-assigned"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "output-device-assigned";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,27 +30,29 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PDLOverrideSupported is a printing attribute class, an enumeration,
- * that expresses the printer's ability to attempt to override processing
- * instructions embedded in documents' print data with processing instructions
- * specified as attributes outside the print data.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PDLOverrideSupported} is a printing attribute class, an
+ * enumeration, that expresses the printer's ability to attempt to override
+ * processing instructions embedded in documents' print data with processing
+ * instructions specified as attributes outside the print data.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class PDLOverrideSupported extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4393264467928463934L;
/**
* The printer makes no attempt to make the external job attribute values
- * take precedence over embedded instructions in the documents' print
- * data.
+ * take precedence over embedded instructions in the documents' print data.
*/
public static final PDLOverrideSupported
NOT_ATTEMPTED = new PDLOverrideSupported(0);
@@ -62,36 +65,42 @@
public static final PDLOverrideSupported
ATTEMPTED = new PDLOverrideSupported(1);
-
/**
* Construct a new PDL override supported enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PDLOverrideSupported(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PDLOverrideSupported}.
+ */
private static final String[] myStringTable = {
"not-attempted",
"attempted"
};
+ /**
+ * The enumeration value table for class {@code PDLOverrideSupported}.
+ */
private static final PDLOverrideSupported[] myEnumValueTable = {
NOT_ATTEMPTED,
ATTEMPTED
};
/**
- * Returns the string table for class PDLOverrideSupported.
+ * Returns the string table for class {@code PDLOverrideSupported}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PDLOverrideSupported.
+ * Returns the enumeration value table for class
+ * {@code PDLOverrideSupported}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -100,12 +109,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PDLOverrideSupported and any vendor-defined subclasses, the
- * category is class PDLOverrideSupported itself.
+ * <p>
+ * For class {@code PDLOverrideSupported} and any vendor-defined subclasses,
+ * the category is class {@code PDLOverrideSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PDLOverrideSupported.class;
@@ -114,14 +123,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PDLOverrideSupported and any vendor-defined subclasses, the
- * category name is {@code "pdl-override-supported"}.
+ * <p>
+ * For class {@code PDLOverrideSupported} and any vendor-defined subclasses,
+ * the category name is {@code "pdl-override-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pdl-override-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,106 +26,93 @@
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PageRanges is a printing attribute class, a set of integers, that
- * identifies the range(s) of print-stream pages that the Printer object uses
- * for each copy of each document which are to be printed. Nothing is printed
- * for any pages identified that do not exist in the document(s). The attribute
- * is associated with <I>print-stream</I> pages, not application-numbered pages
- * (for example, the page numbers found in the headers and or footers for
- * certain word processing applications).
- * <P>
+ * Class {@code PageRanges} is a printing attribute class, a set of integers,
+ * that identifies the range(s) of print-stream pages that the Printer object
+ * uses for each copy of each document which are to be printed. Nothing is
+ * printed for any pages identified that do not exist in the document(s). The
+ * attribute is associated with <i>print-stream</i> pages, not
+ * application-numbered pages (for example, the page numbers found in the
+ * headers and or footers for certain word processing applications).
+ * <p>
* In most cases, the exact pages to be printed will be generated by a device
* driver and this attribute would not be required. However, when printing an
* archived document which has already been formatted, the end user may elect to
* print just a subset of the pages contained in the document. In this case, if
- * a page range of <code>"<I>n</I>-<I>m</I>"</code> is specified, the first page
- * to be printed will be page <I>n.</I> All subsequent pages of the document
- * will be printed through and including page <I>m.</I>
- * <P>
- * If a PageRanges attribute is not specified for a print job, all pages of
- * the document will be printed. In other words, the default value for the
- * PageRanges attribute is always {@code {{1, Integer.MAX_VALUE}}}.
- * <P>
- * The effect of a PageRanges attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same page ranges
- * specified or whether different docs have different page ranges specified, and
- * on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute.
- * <UL>
- * <LI>
- * If all the docs have the same page ranges specified, then any value of {@link
- * MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
- * printer's processing depends on the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} value:
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be combined together into one
- * output document. The specified page ranges of that output document will be
- * printed.
+ * a page range of <code>"<i>n</i>-<i>m</i>"</code> is specified, the first page
+ * to be printed will be page <i>n.</i> All subsequent pages of the document
+ * will be printed through and including page <i>m.</i>
+ * <p>
+ * If a {@code PageRanges} attribute is not specified for a print job, all pages
+ * of the document will be printed. In other words, the default value for the
+ * {@code PageRanges} attribute is always {@code {{1, Integer.MAX_VALUE}}}.
+ * <p>
+ * The effect of a {@code PageRanges} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same page
+ * ranges specified or whether different docs have different page ranges
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ * <ul>
+ * <li>If all the docs have the same page ranges specified, then any value of
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} makes sense, and
+ * the printer's processing depends on the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} value:
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be combined
+ * together into one output document. The specified page ranges of that
+ * output document will be printed.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be
+ * combined together into one output document, and the first impression of
+ * each input doc will always start on a new media sheet. The specified page
+ * ranges of that output document will be printed.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- For each separate
+ * input doc, the specified page ranges will be printed.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- For each separate input
+ * doc, the specified page ranges will be printed.
+ * </ul>
+ * <ul>
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- For each separate
+ * input doc, its own specified page ranges will be printed.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- For each separate input
+ * doc, its own specified page ranges will be printed.
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>IPP Compatibility:</b> The PageRanges attribute's canonical array form
+ * gives the lower and upper bound for each range of pages to be included in and
+ * IPP "page-ranges" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
- * into one output document, and the first impression of each input doc will
- * always start on a new media sheet. The specified page ranges of that output
- * document will be printed.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- For each separate input doc, the
- * specified page ranges will be printed.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- For each separate input doc, the
- * specified page ranges will be printed.
- * </UL>
- * <UL>
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- For each separate input doc, its own
- * specified page ranges will be printed..
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- For each separate input doc, its own
- * specified page ranges will be printed..
- * </UL>
- * </UL>
- * <P>
- * <B>IPP Compatibility:</B> The PageRanges attribute's canonical array form
- * gives the lower and upper bound for each range of pages to be included in
- * and IPP "page-ranges" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public final class PageRanges extends SetOfIntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8639895197656148392L;
-
/**
- * Construct a new page ranges attribute with the given members. The
- * members are specified in "array form;" see class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of array form.
- *
- * @param members Set members in array form.
+ * Construct a new page ranges attribute with the given members. The members
+ * are specified in "array form;" see class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of array
+ * form.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if any element of
- * {@code members} is not a length-one or length-two array. Also
- * thrown if {@code members} is a zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in array form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if any element of {@code members} is not
+ * a length-one or length-two array. Also if {@code members} is a
+ * zero-length array or if any member of the set is less than 1.
*/
public PageRanges(int[][] members) {
super (members);
@@ -134,24 +121,18 @@
}
myPageRanges();
}
+
/**
- * Construct a new page ranges attribute with the given members in
- * string form.
- * See class {@link javax.print.attribute.SetOfIntegerSyntax
- * SetOfIntegerSyntax}
- * for explanation of the syntax.
- *
- * @param members Set members in string form.
+ * Construct a new page ranges attribute with the given members in string
+ * form. See class {@link SetOfIntegerSyntax SetOfIntegerSyntax} for
+ * explanation of the syntax.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code members} does not
- * obey the proper syntax. Also
- * thrown if the constructed set-of-integer is a
- * zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in string form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if {@code members} does not obey the
+ * proper syntax. Also if the constructed set-of-integer is a
+ * zero-length array or if any member of the set is less than 1.
*/
public PageRanges(String members) {
super(members);
@@ -161,6 +142,9 @@
myPageRanges();
}
+ /**
+ * Validates the page ranges.
+ */
private void myPageRanges() {
int[][] myMembers = getMembers();
int n = myMembers.length;
@@ -179,11 +163,8 @@
* Construct a new page ranges attribute containing a single integer. That
* is, only the one page is to be printed.
*
- * @param member Set member.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than
- * 1.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member < 1}
*/
public PageRanges(int member) {
super (member);
@@ -196,13 +177,11 @@
* Construct a new page ranges attribute containing a single range of
* integers. That is, only those pages in the one range are to be printed.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 1.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than 1
*/
public PageRanges(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -214,23 +193,18 @@
}
/**
- * Returns whether this page ranges attribute is equivalent to the passed
- * in object. To be equivalent, all of the following conditions must be
- * true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PageRanges.
- * <LI>
- * This page ranges attribute's members and {@code object}'s members
- * are the same.
- * </OL>
+ * Returns whether this page ranges attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PageRanges}.
+ * <li>This page ranges attribute's members and {@code object}'s members
+ * are the same.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this page ranges
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this page ranges
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PageRanges);
@@ -239,11 +213,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PageRanges, the category is class PageRanges itself.
+ * <p>
+ * For class {@code PageRanges}, the category is class
+ * {@code PageRanges} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PageRanges.class;
@@ -252,13 +227,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PageRanges, the category name is {@code "page-ranges"}.
+ * <p>
+ * For class {@code PageRanges}, the category name is {@code "page-ranges"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "page-ranges";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,32 +30,31 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PagesPerMinute is an integer valued printing attribute that indicates
- * the nominal number of pages per minute to the nearest whole number which may
- * be generated by this printer (e.g., simplex, black-and-white). This attribute
- * is informative, not a service guarantee. Generally, it is the value used in
- * the marketing literature to describe the device. A value of 0 indicates a
- * device that takes more than two minutes to process a page.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * Class {@code PagesPerMinute} is an integer valued printing attribute that
+ * indicates the nominal number of pages per minute to the nearest whole number
+ * which may be generated by this printer (e.g., simplex, black-and-white). This
+ * attribute is informative, not a service guarantee. Generally, it is the value
+ * used in the marketing literature to describe the device. A value of 0
+ * indicates a device that takes more than two minutes to process a page.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PagesPerMinute extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6366403993072862015L;
/**
- * Construct a new pages per minute attribute with the given integer
- * value.
+ * Construct a new pages per minute attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public PagesPerMinute(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -62,22 +62,18 @@
/**
* Returns whether this pages per minute attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PagesPerMinute.
- * <LI>
- * This pages per minute attribute's value and {@code object}'s
- * value are equal.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PagesPerMinute}.
+ * <li>This pages per minute attribute's value and {@code object}'s value
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this pages per
- * minute attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this pages per
+ * minute attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -87,11 +83,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PagesPerMinute, the category is class PagesPerMinute itself.
+ * <p>
+ * For class {@code PagesPerMinute}, the category is class
+ * {@code PagesPerMinute} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PagesPerMinute.class;
@@ -100,14 +97,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PagesPerMinute, the
- * category name is {@code "pages-per-minute"}.
+ * <p>
+ * For class {@code PagesPerMinute}, the category name is
+ * {@code "pages-per-minute"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pages-per-minute";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,43 +30,44 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PagesPerMinuteColor is an integer valued printing attribute that
- * indicates the nominal number of pages per minute to the nearest whole number
- * which may be generated by this printer when printing color (e.g., simplex,
- * color). For purposes of this attribute, "color" means the same as for the
- * {@link ColorSupported ColorSupported} attribute, namely, the device is
- * capable of any type of color printing at all, including highlight color as
+ * Class {@code PagesPerMinuteColor} is an integer valued printing attribute
+ * that indicates the nominal number of pages per minute to the nearest whole
+ * number which may be generated by this printer when printing color (e.g.,
+ * simplex, color). For purposes of this attribute, "color" means the same as
+ * for the {@link ColorSupported ColorSupported} attribute, namely, the device
+ * is capable of any type of color printing at all, including highlight color as
* well as full process color. This attribute is informative, not a service
* guarantee. Generally, it is the value used in the marketing literature to
* describe the color capabilities of this device. A value of 0 indicates a
* device that takes more than two minutes to process a page. If a color device
* has several color modes, it may use the pages-per- minute value for this
* attribute that corresponds to the mode that produces the highest number.
- * <P>
- * A black and white only printer must not include the PagesPerMinuteColor
- * attribute in its attribute set or service registration. If this attribute is
- * present, then the {@link ColorSupported ColorSupported} printer description
- * attribute must also be present and have a value of SUPPORTED.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * <p>
+ * A black and white only printer must not include the
+ * {@code PagesPerMinuteColor} attribute in its attribute set or service
+ * registration. If this attribute is present, then the
+ * {@link ColorSupported ColorSupported} printer description attribute must also
+ * be present and have a value of {@code SUPPORTED}.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PagesPerMinuteColor extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
static final long serialVersionUID = 1684993151687470944L;
/**
* Construct a new pages per minute color attribute with the given integer
* value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public PagesPerMinuteColor(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -75,20 +77,16 @@
* Returns whether this pages per minute color attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PagesPerMinuteColor.
- * <LI>
- * This pages per minute attribute's value and {@code object}'s
- * value are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PagesPerMinuteColor}.
+ * <li>This pages per minute attribute's value and {@code object}'s value
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this pages per
- * minute color attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this pages per
+ * minute color attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -98,12 +96,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PagesPerMinuteColor, the
- * category is class PagesPerMinuteColor itself.
+ * <p>
+ * For class {@code PagesPerMinuteColor}, the category is class
+ * {@code PagesPerMinuteColor} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PagesPerMinuteColor.class;
@@ -112,14 +110,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PagesPerMinuteColor, the
- * category name is {@code "pages-per-minute-color"}.
+ * <p>
+ * For class {@code PagesPerMinuteColor}, the category name is
+ * {@code "pages-per-minute-color"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pages-per-minute-color";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -30,81 +31,84 @@
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class PresentationDirection is a printing attribute class, an enumeration,
- * that is used in conjunction with the {@link NumberUp NumberUp} attribute to
- * indicate the layout of multiple print-stream pages to impose upon a
- * single side of an instance of a selected medium.
- * This is useful to mirror the text layout conventions of different scripts.
- * For example, English is "toright-tobottom", Hebrew is "toleft-tobottom"
- * and Japanese is usually "tobottom-toleft".
- * <P>
- * <B>IPP Compatibility:</B> This attribute is not an IPP 1.1
- * attribute; it is an attribute in the Production Printing Extension
- * (<a href="ftp://ftp.pwg.org/pub/pwg/standards/pwg5100.3.pdf">PDF</a>)
- * of IPP 1.1. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PresentationDirection} is a printing attribute class, an
+ * enumeration, that is used in conjunction with the {@link NumberUp NumberUp}
+ * attribute to indicate the layout of multiple print-stream pages to impose
+ * upon a single side of an instance of a selected medium. This is useful to
+ * mirror the text layout conventions of different scripts. For example, English
+ * is "toright-tobottom", Hebrew is "toleft-tobottom" and Japanese is usually
+ * "tobottom-toleft".
+ * <p>
+ * <b>IPP Compatibility:</b> This attribute is not an IPP 1.1 attribute; it is
+ * an attribute in the Production Printing Extension
+ * (<a href="ftp://ftp.pwg.org/pub/pwg/standards/pwg5100.3.pdf">PDF</a>) of IPP
+ * 1.1. The category name returned by {@code getName()} is the IPP attribute
+ * name. The enumeration's integer value is the IPP enum value. The
+ * {@code toString()} method returns the IPP string representation of the
+ * attribute value.
*
- * @author Phil Race.
+ * @author Phil Race
*/
public final class PresentationDirection extends EnumSyntax
implements PrintJobAttribute, PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8294728067230931780L;
/**
- * Pages are laid out in columns starting at the top left,
- * proceeding towards the bottom {@literal &} right.
+ * Pages are laid out in columns starting at the top left, proceeding
+ * towards the bottom {@literal &} right.
*/
public static final PresentationDirection TOBOTTOM_TORIGHT =
new PresentationDirection(0);
/**
- * Pages are laid out in columns starting at the top right,
- * proceeding towards the bottom {@literal &} left.
+ * Pages are laid out in columns starting at the top right, proceeding
+ * towards the bottom {@literal &} left.
*/
public static final PresentationDirection TOBOTTOM_TOLEFT =
new PresentationDirection(1);
/**
- * Pages are laid out in columns starting at the bottom left,
- * proceeding towards the top {@literal &} right.
+ * Pages are laid out in columns starting at the bottom left, proceeding
+ * towards the top {@literal &} right.
*/
public static final PresentationDirection TOTOP_TORIGHT =
new PresentationDirection(2);
/**
- * Pages are laid out in columns starting at the bottom right,
- * proceeding towards the top {@literal &} left.
+ * Pages are laid out in columns starting at the bottom right, proceeding
+ * towards the top {@literal &} left.
*/
public static final PresentationDirection TOTOP_TOLEFT =
new PresentationDirection(3);
/**
- * Pages are laid out in rows starting at the top left,
- * proceeding towards the right {@literal &} bottom.
+ * Pages are laid out in rows starting at the top left, proceeding towards
+ * the right {@literal &} bottom.
*/
public static final PresentationDirection TORIGHT_TOBOTTOM =
new PresentationDirection(4);
/**
- * Pages are laid out in rows starting at the bottom left,
- * proceeding towards the right {@literal &} top.
+ * Pages are laid out in rows starting at the bottom left, proceeding
+ * towards the right {@literal &} top.
*/
public static final PresentationDirection TORIGHT_TOTOP =
new PresentationDirection(5);
/**
- * Pages are laid out in rows starting at the top right,
- * proceeding towards the left {@literal &} bottom.
+ * Pages are laid out in rows starting at the top right, proceeding towards
+ * the left {@literal &} bottom.
*/
public static final PresentationDirection TOLEFT_TOBOTTOM =
new PresentationDirection(6);
/**
- * Pages are laid out in rows starting at the bottom right,
- * proceeding towards the left {@literal &} top.
+ * Pages are laid out in rows starting at the bottom right, proceeding
+ * towards the left {@literal &} top.
*/
public static final PresentationDirection TOLEFT_TOTOP =
new PresentationDirection(7);
@@ -113,12 +117,15 @@
* Construct a new presentation direction enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
private PresentationDirection(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PresentationDirection}.
+ */
private static final String[] myStringTable = {
"tobottom-toright",
"tobottom-toleft",
@@ -130,6 +137,9 @@
"toleft-totop",
};
+ /**
+ * The enumeration value table for class {@code PresentationDirection}.
+ */
private static final PresentationDirection[] myEnumValueTable = {
TOBOTTOM_TORIGHT,
TOBOTTOM_TOLEFT,
@@ -142,14 +152,15 @@
};
/**
- * Returns the string table for class PresentationDirection.
+ * Returns the string table for class {@code PresentationDirection}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PresentationDirection.
+ * Returns the enumeration value table for class
+ * {@code PresentationDirection}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -158,12 +169,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PresentationDirection
- * the category is class PresentationDirection itself.
+ * <p>
+ * For class {@code PresentationDirection} the category is class
+ * {@code PresentationDirection} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PresentationDirection.class;
@@ -172,14 +183,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PresentationDirection
- * the category name is {@code "presentation-direction"}.
+ * <p>
+ * For class {@code PresentationDirection} the category name is
+ * {@code "presentation-direction"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "presentation-direction";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,30 +22,35 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PrintQuality is a printing attribute class, an enumeration,
+ * Class {@code PrintQuality} is a printing attribute class, an enumeration,
* that specifies the print quality that the printer uses for the job.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public class PrintQuality extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3072341285225858365L;
+
/**
* Lowest quality available on the printer.
*/
@@ -65,18 +70,24 @@
* Construct a new print quality enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrintQuality(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrintQuality}.
+ */
private static final String[] myStringTable = {
"draft",
"normal",
"high"
};
+ /**
+ * The enumeration value table for class {@code PrintQuality}.
+ */
private static final PrintQuality[] myEnumValueTable = {
DRAFT,
NORMAL,
@@ -84,21 +95,21 @@
};
/**
- * Returns the string table for class PrintQuality.
+ * Returns the string table for class {@code PrintQuality}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PrintQuality.
+ * Returns the enumeration value table for class {@code PrintQuality}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
- * Returns the lowest integer value used by class PrintQuality.
+ * Returns the lowest integer value used by class {@code PrintQuality}.
*/
protected int getOffset() {
return 3;
@@ -107,12 +118,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrintQuality and any vendor-defined subclasses, the category is
- * class PrintQuality itself.
+ * <p>
+ * For class {@code PrintQuality} and any vendor-defined subclasses, the
+ * category is class {@code PrintQuality} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrintQuality.class;
@@ -121,14 +132,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrintQuality and any vendor-defined subclasses, the category
- * name is {@code "print-quality"}.
+ * <p>
+ * For class {@code PrintQuality} and any vendor-defined subclasses, the
+ * category name is {@code "print-quality"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "print-quality";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,45 +22,47 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterInfo is a printing attribute class, a text attribute, that
- * provides descriptive information about a printer. This could include things
- * like: {@code "This printer can be used for printing color transparencies for
- * HR presentations"}, or {@code "Out of courtesy for others, please
- * print only small (1-5 page) jobs at this printer"}, or even
+ * Class {@code PrinterInfo} is a printing attribute class, a text attribute,
+ * that provides descriptive information about a printer. This could include
+ * things like: {@code "This printer can be used for printing color
+ * transparencies for HR presentations"}, or {@code "Out of courtesy for others,
+ * please print only small (1-5 page) jobs at this printer"}, or even
* {@code "This printer is going away on July 1, 1997, please find a new
* printer"}.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
- * locale gives the IPP natural language. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
+ * locale gives the IPP natural language. The category name returned by {@code
+ * getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterInfo extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7765280618777599727L;
/**
- * Constructs a new printer info attribute with the given information
- * string and locale.
+ * Constructs a new printer info attribute with the given information string
+ * and locale.
*
- * @param info Printer information string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code info} is null.
+ * @param info printer information string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code info} is {@code null}
*/
public PrinterInfo(String info, Locale locale) {
super (info, locale);
@@ -70,23 +72,18 @@
* Returns whether this printer info attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterInfo.
- * <LI>
- * This printer info attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This printer info attribute's locale and {@code object}'s
- * locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterInfo}.
+ * <li>This printer info attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This printer info attribute's locale and {@code object}'s locale
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * info attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer info
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterInfo);
@@ -95,11 +92,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterInfo, the category is class PrinterInfo itself.
+ * <p>
+ * For class {@code PrinterInfo}, the category is class
+ * {@code PrinterInfo} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterInfo.class;
@@ -108,13 +106,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterInfo, the category name is {@code "printer-info"}.
+ * <p>
+ * For class {@code PrinterInfo}, the category name is
+ * {@code "printer-info"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-info";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,26 +30,30 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterIsAcceptingJobs is a printing attribute class, an enumeration,
- * that indicates whether the printer is currently able to accept jobs. This
- * value is independent of the {@link PrinterState PrinterState} and {@link
- * PrinterStateReasons PrinterStateReasons} attributes because its value does
- * not affect the current job; rather it affects future jobs. If the value is
- * NOT_ACCEPTING_JOBS, the printer will reject jobs even when the {@link
- * PrinterState PrinterState} is IDLE. If value is ACCEPTING_JOBS, the Printer
- * will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
- * <P>
- * <B>IPP Compatibility:</B> The IPP boolean value is "true" for ACCEPTING_JOBS
- * and "false" for NOT_ACCEPTING_JOBS. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PrinterIsAcceptingJobs} is a printing attribute class, an
+ * enumeration, that indicates whether the printer is currently able to accept
+ * jobs. This value is independent of the {@link PrinterState PrinterState} and
+ * {@link PrinterStateReasons PrinterStateReasons} attributes because its value
+ * does not affect the current job; rather it affects future jobs. If the value
+ * is {@code NOT_ACCEPTING_JOBS}, the printer will reject jobs even when the
+ * {@link PrinterState PrinterState} is {@code IDLE}. If value is
+ * {@code ACCEPTING_JOBS}, the Printer will accept jobs even when the
+ * {@link PrinterState PrinterState} is {@code STOPPED}.
+ * <p>
+ * <b>IPP Compatibility:</b> The IPP boolean value is "true" for
+ * {@code ACCEPTING_JOBS} and "false" for {@code NOT_ACCEPTING_JOBS}. The
+ * category name returned by {@code getName()} is the IPP attribute name. The
+ * enumeration's integer value is the IPP enum value. The {@code toString()}
+ * method returns the IPP string representation of the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterIsAcceptingJobs extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -5052010680537678061L;
/**
@@ -67,31 +72,38 @@
* Construct a new printer is accepting jobs enumeration value with the
* given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterIsAcceptingJobs(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterIsAcceptingJobs}.
+ */
private static final String[] myStringTable = {
"not-accepting-jobs",
"accepting-jobs"
};
+ /**
+ * The enumeration value table for class {@code PrinterIsAcceptingJobs}.
+ */
private static final PrinterIsAcceptingJobs[] myEnumValueTable = {
NOT_ACCEPTING_JOBS,
ACCEPTING_JOBS
};
/**
- * Returns the string table for class PrinterIsAcceptingJobs.
+ * Returns the string table for class {@code PrinterIsAcceptingJobs}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PrinterIsAcceptingJobs.
+ * Returns the enumeration value table for class
+ * {@code PrinterIsAcceptingJobs}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -100,12 +112,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterIsAcceptingJobs, the
- * category is class PrinterIsAcceptingJobs itself.
+ * <p>
+ * For class {@code PrinterIsAcceptingJobs}, the category is class
+ * {@code PrinterIsAcceptingJobs} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterIsAcceptingJobs.class;
@@ -114,14 +126,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterIsAcceptingJobs, the
- * category name is {@code "printer-is-accepting-jobs"}.
+ * <p>
+ * For class {@code PrinterIsAcceptingJobs}, the category name is
+ * {@code "printer-is-accepting-jobs"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-is-accepting-jobs";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,41 +22,43 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterLocation is a printing attribute class, a text attribute, that
- * identifies the location of the device. This could include things like:
- * {@code "in Room 123A, second floor of building XYZ"}.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code PrinterLocation} is a printing attribute class, a text
+ * attribute, that identifies the location of the device. This could include
+ * things like: {@code "in Room 123A, second floor of building XYZ"}.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterLocation extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1598610039865566337L;
/**
* Constructs a new printer location attribute with the given location and
* locale.
*
- * @param location Printer location.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code location} is null.
+ * @param location printer location
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code location} is {@code null}
*/
public PrinterLocation(String location, Locale locale) {
super (location, locale);
@@ -64,25 +66,20 @@
/**
* Returns whether this printer location attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterLocation.
- * <LI>
- * This printer location attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This printer location attribute's locale and {@code object}'s
- * locale are equal.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterLocation}.
+ * <li>This printer location attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This printer location attribute's locale and {@code object}'s
+ * locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * location attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * location attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterLocation);
@@ -91,12 +88,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterLocation, the
- * category is class PrinterLocation itself.
+ * <p>
+ * For class {@code PrinterLocation}, the category is class
+ * {@code PrinterLocation} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterLocation.class;
@@ -105,14 +102,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterLocation, the
- * category name is {@code "printer-location"}.
+ * <p>
+ * For class {@code PrinterLocation}, the category name is
+ * {@code "printer-location"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-location";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,39 +22,42 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
+
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMakeAndModel is a printing attribute class, a text attribute,
- * that the make and model of the printer.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code PrinterMakeAndModel} is a printing attribute class, a text
+ * attribute, that the make and model of the printer.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMakeAndModel extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4580461489499351411L;
/**
- * Constructs a new printer make and model attribute with the given make
- * and model string and locale.
+ * Constructs a new printer make and model attribute with the given make and
+ * model string and locale.
*
- * @param makeAndModel Printer make and model string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code makeAndModel} is null.
+ * @param makeAndModel printer make and model string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code makeAndModel} is {@code null}
*/
public PrinterMakeAndModel(String makeAndModel, Locale locale) {
super (makeAndModel, locale);
@@ -64,23 +67,18 @@
* Returns whether this printer make and model attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterMakeAndModel.
- * <LI>
- * This printer make and model attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This printer make and model attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterMakeAndModel}.
+ * <li>This printer make and model attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This printer make and model attribute's locale and {@code object}'s
+ * locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * make and model attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer make
+ * and model attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -90,12 +88,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterMakeAndModel, the
- * category is class PrinterMakeAndModel itself.
+ * <p>
+ * For class {@code PrinterMakeAndModel}, the category is class
+ * {@code PrinterMakeAndModel} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMakeAndModel.class;
@@ -104,14 +102,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterMakeAndModel, the
- * category name is {@code "printer-make-and-model"}.
+ * <p>
+ * For class {@code PrinterMakeAndModel}, the category name is
+ * {@code "printer-make-and-model"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-make-and-model";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,54 +22,54 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMessageFromOperator is a printing attribute class, a text
- * attribute, that provides a message from an operator, system administrator,
- * or "intelligent" process to indicate to the end user information about or
- * status of the printer, such as why it is unavailable or when it is
- * expected to be available.
- * <P>
- * A Print Service's attribute set includes zero instances or one instance of
- * a
- * PrinterMessageFromOperator attribute, not more than one instance. A new
- * PrinterMessageFromOperator attribute replaces an existing
- * PrinterMessageFromOperator attribute, if any. In other words,
- * PrinterMessageFromOperator is not intended to be a history log.
- * If it wishes, the client can detect changes to a Print Service's
- * PrinterMessageFromOperator
- * attribute and maintain the client's own history log of the
- * PrinterMessageFromOperator attribute values.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code PrinterMessageFromOperator} is a printing attribute class, a
+ * text attribute, that provides a message from an operator, system
+ * administrator, or "intelligent" process to indicate to the end user
+ * information about or status of the printer, such as why it is unavailable or
+ * when it is expected to be available.
+ * <p>
+ * A Print Service's attribute set includes zero instances or one instance of a
+ * {@code PrinterMessageFromOperator} attribute, not more than one instance. A
+ * new {@code PrinterMessageFromOperator} attribute replaces an existing
+ * {@code PrinterMessageFromOperator} attribute, if any. In other words,
+ * {@code PrinterMessageFromOperator} is not intended to be a history log. If it
+ * wishes, the client can detect changes to a Print Service's
+ * {@code PrinterMessageFromOperator} attribute and maintain the client's own
+ * history log of the {@code PrinterMessageFromOperator} attribute values.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMessageFromOperator extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
static final long serialVersionUID = -4486871203218629318L;
/**
- * Constructs a new printer message from operator attribute with the
- * given message and locale.
+ * Constructs a new printer message from operator attribute with the given
+ * message and locale.
*
- * @param message Message.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code message} is null.
+ * @param message the message
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code message} is {@code null}
*/
public PrinterMessageFromOperator(String message, Locale locale) {
super (message, locale);
@@ -79,24 +79,19 @@
* Returns whether this printer message from operator attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class
- * PrinterMessageFromOperator.
- * <LI>
- * This printer message from operator attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This printer message from operator attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code PrinterMessageFromOperator}.
+ * <li>This printer message from operator attribute's underlying string
+ * and {@code object}'s underlying string are equal.
+ * <li>This printer message from operator attribute's locale and
+ * {@code object}'s locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * message from operator attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * message from operator attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -106,12 +101,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterMessageFromOperator,
- * the category is class PrinterMessageFromOperator itself.
+ * <p>
+ * For class {@code PrinterMessageFromOperator}, the category is class
+ * {@code PrinterMessageFromOperator} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMessageFromOperator.class;
@@ -120,14 +115,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterMessageFromOperator,
- * the category name is {@code "printer-message-from-operator"}.
+ * <p>
+ * For class {@code PrinterMessageFromOperator}, the category name is
+ * {@code "printer-message-from-operator"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-message-from-operator";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMoreInfo is a printing attribute class, a URI, that is used to
- * obtain more information about this specific printer. For example, this
- * could be an HTTP type URI referencing an HTML page accessible to a web
- * browser. The information obtained from this URI is intended for end user
- * consumption. Features outside the scope of the Print Service API can be
- * accessed from this URI.
- * The information is intended to be specific to this printer instance and
- * site specific services (e.g. job pricing, services offered, end user
- * assistance).
- * <P>
- * In contrast, the {@link PrinterMoreInfoManufacturer
- * PrinterMoreInfoManufacturer} attribute is used to find out more information
- * about this general kind of printer rather than this specific printer.
- * <P>
- * <B>IPP Compatibility:</B> The string form returned by
- * {@code toString()} gives the IPP uri value.
- * The category name returned by {@code getName()}
+ * Class {@code PrinterMoreInfo} is a printing attribute class, a {@code URI},
+ * that is used to obtain more information about this specific printer. For
+ * example, this could be an HTTP type {@code URI} referencing an HTML page
+ * accessible to a web browser. The information obtained from this {@code URI}
+ * is intended for end user consumption. Features outside the scope of the Print
+ * Service API can be accessed from this {@code URI}. The information is
+ * intended to be specific to this printer instance and site specific services
+ * (e.g. job pricing, services offered, end user assistance).
+ * <p>
+ * In contrast, the
+ * {@link PrinterMoreInfoManufacturer PrinterMoreInfoManufacturer} attribute is
+ * used to find out more information about this general kind of printer rather
+ * than this specific printer.
+ * <p>
+ * <b>IPP Compatibility:</b> The string form returned by {@code toString()}
+ * gives the IPP uri value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMoreInfo extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4555850007675338574L;
/**
- * Constructs a new printer more info attribute with the specified URI.
+ * Constructs a new printer more info attribute with the specified
+ * {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterMoreInfo(URI uri) {
super (uri);
@@ -71,22 +73,18 @@
/**
* Returns whether this printer more info attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterMoreInfo.
- * <LI>
- * This printer more info attribute's URI and {@code object}'s URI
- * are equal.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterMoreInfo}.
+ * <li>This printer more info attribute's {@code URI} and {@code object}'s
+ * {@code URI} are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * more info attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer more
+ * info attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -96,11 +94,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterMoreInfo, the category is class PrinterMoreInfo itself.
+ * <p>
+ * For class {@code PrinterMoreInfo}, the category is class
+ * {@code PrinterMoreInfo} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMoreInfo.class;
@@ -109,14 +108,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterMoreInfo, the
- * category name is {@code "printer-more-info"}.
+ * <p>
+ * For class {@code PrinterMoreInfo}, the category name is
+ * {@code "printer-more-info"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-more-info";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,49 +22,49 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMoreInfoManufacturer is a printing attribute class, a URI,
- * that is used to obtain more information about this type of device.
- * The information obtained from this URI is intended for end user
- * consumption. Features outside the scope of the Print Service API
- * can be accessed from this URI (e.g.,
- * latest firmware, upgrades, service proxies, optional features available,
- * details on color support). The information is intended to be germane to
- * this kind of printer without regard to site specific modifications or
- * services.
- * <P>
- * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
- * to find out more information about this specific printer rather than this
+ * Class {@code PrinterMoreInfoManufacturer} is a printing attribute class, a
+ * {@code URI}, that is used to obtain more information about this type of
+ * device. The information obtained from this {@code URI} is intended for end
+ * user consumption. Features outside the scope of the Print Service API can be
+ * accessed from this {@code URI} (e.g., latest firmware, upgrades, service
+ * proxies, optional features available, details on color support). The
+ * information is intended to be germane to this kind of printer without regard
+ * to site specific modifications or services.
+ * <p>
+ * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used to
+ * find out more information about this specific printer rather than this
* general kind of printer.
- * <P>
- * <B>IPP Compatibility:</B> The string form returned by
- * {@code toString()} gives the IPP uri value.
- * The category name returned by {@code getName()}
+ * <p>
+ * <b>IPP Compatibility:</b> The string form returned by {@code toString()}
+ * gives the IPP uri value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMoreInfoManufacturer extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3323271346485076608L;
/**
* Constructs a new printer more info manufacturer attribute with the
- * specified URI.
+ * specified {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterMoreInfoManufacturer(URI uri) {
super (uri);
@@ -74,21 +74,17 @@
* Returns whether this printer more info manufacturer attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class
- * PrinterMoreInfoManufacturer.
- * <LI>
- * This printer more info manufacturer attribute's URI and
- * {@code object}'s URI are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class
+ * {@code PrinterMoreInfoManufacturer}.
+ * <li>This printer more info manufacturer attribute's {@code URI} and
+ * {@code object}'s {@code URI} are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * more info manufacturer attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer more
+ * info manufacturer attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -98,12 +94,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterMoreInfoManufacturer, the category is
- * class PrinterMoreInfoManufacturer itself.
+ * <p>
+ * For class {@code PrinterMoreInfoManufacturer}, the category is class
+ * {@code PrinterMoreInfoManufacturer} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMoreInfoManufacturer.class;
@@ -112,14 +108,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterMoreInfoManufacturer, the category name is
+ * <p>
+ * For class {@code PrinterMoreInfoManufacturer}, the category name is
* {@code "printer-more-info-manufacturer"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-more-info-manufacturer";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,43 +22,45 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterName is a printing attribute class, a text attribute, that
- * specifies the name of a printer. It is a name that is more end-user friendly
- * than a URI. An administrator determines a printer's name and sets this
- * attribute to that name. This name may be the last part of the printer's URI
- * or it may be unrelated. In non-US-English locales, a name may contain
- * characters that are not allowed in a URI.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code PrinterName} is a printing attribute class, a text attribute,
+ * that specifies the name of a printer. It is a name that is more end-user
+ * friendly than a {@code URI}. An administrator determines a printer's name and
+ * sets this attribute to that name. This name may be the last part of the
+ * printer's {@code URI} or it may be unrelated. In non-US-English locales, a
+ * name may contain characters that are not allowed in a {@code URI}.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterName extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 299740639137803127L;
/**
* Constructs a new printer name attribute with the given name and locale.
*
- * @param printerName Printer name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code printerName} is null.
+ * @param printerName printer name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code printerName} is {@code null}
*/
public PrinterName(String printerName, Locale locale) {
super (printerName, locale);
@@ -68,23 +70,18 @@
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterName.
- * <LI>
- * This printer name attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This printer name attribute's locale and {@code object}'s locale
- * are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterName}.
+ * <li>This printer name attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This printer name attribute's locale and {@code object}'s locale
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer name
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterName);
@@ -93,12 +90,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterName, the category is
- * class PrinterName itself.
+ * <p>
+ * For class {@code PrinterName}, the category is class
+ * {@code PrinterName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterName.class;
@@ -107,14 +104,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterName, the category
- * name is {@code "printer-name"}.
+ * <p>
+ * For class {@code PrinterName}, the category name is
+ * {@code "printer-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-name";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,71 +22,66 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.ResolutionSyntax;
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PrinterResolution is a printing attribute class that specifies an
- * exact resolution supported by a printer or to be used for a print job.
+ * Class {@code PrinterResolution} is a printing attribute class that specifies
+ * an exact resolution supported by a printer or to be used for a print job.
* This attribute assumes that printers have a small set of device resolutions
* at which they can operate rather than a continuum.
* <p>
- * PrinterResolution is used in multiple ways:
- * <OL TYPE=1>
- * <LI>
- * When a client searches looking for a printer that supports the client's
- * desired resolution exactly (no more, no less), the client specifies
- * an instance of class PrinterResolution indicating the exact resolution the
- * client wants. Only printers supporting that exact resolution will match the
- * search.
+ * {@code PrinterResolution} is used in multiple ways:
+ * <ol type=1>
+ * <li>When a client searches looking for a printer that supports the client's
+ * desired resolution exactly (no more, no less), the client specifies an
+ * instance of class {@code PrinterResolution} indicating the exact resolution
+ * the client wants. Only printers supporting that exact resolution will match
+ * the search.
+ * <li>When a client needs to print a job using the client's desired
+ * resolution exactly (no more, no less), the client specifies an instance of
+ * class {@code PrinterResolution} as an attribute of the Print Job. This will
+ * fail if the Print Job doesn't support that exact resolution, and
+ * {@code Fidelity} is set to true.
+ * </ol>
+ * If a client wants to locate a printer supporting a resolution greater than
+ * some required minimum, then it may be necessary to exclude this attribute
+ * from a lookup request and to directly query the set of supported resolutions,
+ * and specify the one that most closely meets the client's requirements. In
+ * some cases this may be more simply achieved by specifying a
+ * {@code PrintQuality} attribute which often controls resolution.
+ * <p>
+ * <b>IPP Compatibility:</b> The information needed to construct an IPP
+ * {@code "printer-resolution"} attribute can be obtained by calling methods on
+ * the PrinterResolution object. The category name returned by {@code getName()}
+ * gives the IPP attribute name.
*
- * <LI>
- * When a client needs to print a job using the client's desired resolution
- * exactly (no more, no less), the client specifies an instance of class
- * PrinterResolution as an attribute of the Print Job. This will fail if the
- * Print Job doesn't support that exact resolution, and Fidelity is set to
- * true.
- * </OL>
- * If a client wants to locate a printer supporting a resolution
- * greater than some required minimum, then it may be necessary to exclude
- * this attribute from a lookup request and to directly query the set of
- * supported resolutions, and specify the one that most closely meets
- * the client's requirements.
- * In some cases this may be more simply achieved by specifying a
- * PrintQuality attribute which often controls resolution.
- * <P>
- * <B>IPP Compatibility:</B> The information needed to construct an IPP
- * {@code "printer-resolution"} attribute can be obtained by calling
- * methods on the PrinterResolution object. The category name returned by
- * {@code getName()} gives the IPP attribute name.
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public final class PrinterResolution extends ResolutionSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 13090306561090558L;
/**
* Construct a new printer resolution attribute from the given items.
*
- * @param crossFeedResolution
- * Cross feed direction resolution.
- * @param feedResolution
- * Feed direction resolution.
- * @param units
- * Unit conversion factor, e.g. {@code ResolutionSyntax.DPI}
- * or {@code ResolutionSyntax.DPCM}.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
- * {@code feedResolution < 1} or {@code units < 1}.
+ * @param crossFeedResolution cross feed direction resolution
+ * @param feedResolution feed direction resolution
+ * @param units unit conversion factor, e.g. {@code ResolutionSyntax.DPI}
+ * or {@code ResolutionSyntax.DPCM}
+ * @throws IllegalArgumentException if {@code crossFeedResolution < 1} or
+ * {@code feedResolution < 1} or {@code units < 1}
*/
public PrinterResolution(int crossFeedResolution, int feedResolution,
int units) {
@@ -95,25 +90,20 @@
/**
* Returns whether this printer resolution attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterResolution.
- * <LI>
- * This attribute's cross feed direction resolution is equal to
- * {@code object}'s cross feed direction resolution.
- * <LI>
- * This attribute's feed direction resolution is equal to
- * {@code object}'s feed direction resolution.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterResolution}.
+ * <li>This attribute's cross feed direction resolution is equal to
+ * {@code object}'s cross feed direction resolution.
+ * <li>This attribute's feed direction resolution is equal to
+ * {@code object}'s feed direction resolution.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * resolution attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * resolution attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -123,27 +113,27 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterResolution, the category is class PrinterResolution itself.
+ * <p>
+ * For class {@code PrinterResolution}, the category is class
+ * {@code PrinterResolution} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterResolution.class;
- }
+ }
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterResolution, the
- * category name is {@code "printer-resolution"}.
+ * <p>
+ * For class {@code PrinterResolution}, the category name is
+ * {@code "printer-resolution"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-resolution";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,25 +30,28 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterState is a printing attribute class, an enumeration, that
- * identifies the current state of a printer. Class PrinterState defines
- * standard printer state values. A Print Service implementation only needs
- * to report those printer states which are appropriate for the particular
+ * Class {@code PrinterState} is a printing attribute class, an enumeration,
+ * that identifies the current state of a printer. Class {@code PrinterState}
+ * defines standard printer state values. A Print Service implementation only
+ * needs to report those printer states which are appropriate for the particular
* implementation; it does not have to report every defined printer state. The
* {@link PrinterStateReasons PrinterStateReasons} attribute augments the
- * PrinterState attribute to give more detailed information about the printer
- * in given printer state.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * {@code PrinterState} attribute to give more detailed information about the
+ * printer in given printer state.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterState extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -649578618346507718L;
/**
@@ -61,8 +65,7 @@
public static final PrinterState IDLE = new PrinterState(3);
/**
- * Indicates that jobs are processing;
- * new jobs will wait before processing.
+ * Indicates that jobs are processing; new jobs will wait before processing.
*/
public static final PrinterState PROCESSING = new PrinterState(4);
@@ -75,12 +78,15 @@
* Construct a new printer state enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterState(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterState}.
+ */
private static final String[] myStringTable = {
"unknown",
null,
@@ -90,6 +96,9 @@
"stopped"
};
+ /**
+ * The enumeration value table for class {@code PrinterState}.
+ */
private static final PrinterState[] myEnumValueTable = {
UNKNOWN,
null,
@@ -100,14 +109,14 @@
};
/**
- * Returns the string table for class PrinterState.
+ * Returns the string table for class {@code PrinterState}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PrinterState.
+ * Returns the enumeration value table for class {@code PrinterState}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -116,11 +125,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterState, the category is class PrinterState itself.
+ * <p>
+ * For class {@code PrinterState}, the category is class
+ * {@code PrinterState} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterState.class;
@@ -129,13 +139,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterState, the category name is {@code "printer-state"}.
+ * <p>
+ * For class {@code PrinterState}, the category name is
+ * {@code "printer-state"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,50 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class PrinterStateReason is a printing attribute class, an enumeration,
- * that provides additional information about the printer's current state,
- * i.e., information that augments the value of the printer's
- * {@link PrinterState PrinterState} attribute.
- * Class PrinterStateReason defines standard printer
- * state reason values. A Print Service implementation only needs to report
- * those printer state reasons which are appropriate for the particular
- * implementation; it does not have to report every defined printer state
- * reason.
- * <P>
- * Instances of PrinterStateReason do not appear in a Print Service's
- * attribute set directly.
- * Rather, a {@link PrinterStateReasons PrinterStateReasons}
- * attribute appears in the Print Service's attribute set. The {@link
- * PrinterStateReasons PrinterStateReasons} attribute contains zero, one, or
- * more than one PrinterStateReason objects which pertain to the
- * Print Service's status, and each PrinterStateReason object is
- * associated with a {@link Severity Severity} level of REPORT (least severe),
- * WARNING, or ERROR (most severe). The printer adds a PrinterStateReason
- * object to the Print Service's
+ * Class {@code PrinterStateReason} is a printing attribute class, an
+ * enumeration, that provides additional information about the printer's current
+ * state, i.e., information that augments the value of the printer's
+ * {@link PrinterState PrinterState} attribute. Class PrinterStateReason defines
+ * standard printer state reason values. A Print Service implementation only
+ * needs to report those printer state reasons which are appropriate for the
+ * particular implementation; it does not have to report every defined printer
+ * state reason.
+ * <p>
+ * Instances of {@code PrinterStateReason} do not appear in a Print Service's
+ * attribute set directly. Rather, a
+ * {@link PrinterStateReasons PrinterStateReasons} attribute appears in the
+ * Print Service's attribute set. The
+ * {@link PrinterStateReasons PrinterStateReasons} attribute contains zero, one,
+ * or more than one {@code PrinterStateReason} objects which pertain to the
+ * Print Service's status, and each PrinterStateReason object is associated with
+ * a {@link Severity Severity} level of {@code REPORT} (least severe),
+ * {@code WARNING}, or {@code ERROR} (most severe). The printer adds a
+ * {@code PrinterStateReason} object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
- * corresponding condition becomes true of the printer, and the printer
- * removes the PrinterStateReason object again when the corresponding
- * condition becomes false, regardless of whether the Print Service's overall
+ * corresponding condition becomes true of the printer, and the printer removes
+ * the {@code PrinterStateReason} object again when the corresponding condition
+ * becomes false, regardless of whether the Print Service's overall
* {@link PrinterState PrinterState} also changed.
- * <P>
- * <B>IPP Compatibility:</B>
- * The string values returned by each individual {@link PrinterStateReason} and
- * associated {@link Severity} object's {@code toString()}
- * methods, concatenated together with a hyphen ({@code "-"}) in
- * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * <p>
+ * <b>IPP Compatibility:</b> The string values returned by each individual
+ * {@link PrinterStateReason} and associated {@link Severity} object's
+ * {@code toString()} methods, concatenated together with a hyphen ({@code "-"})
+ * in between, gives the IPP keyword value for a {@link PrinterStateReasons}.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class PrinterStateReason extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1623720656201472593L;
/**
@@ -87,51 +88,48 @@
/**
* Someone has paused the printer, but the device(s) are taking an
- * appreciable time to stop. Later, when all output has stopped,
- * the {@link PrinterState PrinterState} becomes STOPPED,
- * and the PAUSED value replaces
- * the MOVING_TO_PAUSED value in the {@link PrinterStateReasons
- * PrinterStateReasons} attribute. This value must be supported if the
- * printer can be paused and the implementation takes significant time to
- * pause a device in certain circumstances.
+ * appreciable time to stop. Later, when all output has stopped, the
+ * {@link PrinterState PrinterState} becomes {@code STOPPED}, and the
+ * {@code PAUSED} value replaces the {@code MOVING_TO_PAUSED} value in the
+ * {@link PrinterStateReasons PrinterStateReasons} attribute. This value
+ * must be supported if the printer can be paused and the implementation
+ * takes significant time to pause a device in certain circumstances.
*/
public static final PrinterStateReason
MOVING_TO_PAUSED = new PrinterStateReason(3);
/**
- * Someone has paused the printer and the printer's {@link PrinterState
- * PrinterState} is STOPPED. In this state, a printer must not produce
- * printed output, but it must perform other operations requested by a
- * client. If a printer had been printing a job when the printer was
- * paused,
- * the Printer must resume printing that job when the printer is no longer
- * paused and leave no evidence in the printed output of such a pause.
- * This value must be supported if the printer can be paused.
+ * Someone has paused the printer and the printer's
+ * {@link PrinterState PrinterState} is {@code STOPPED}. In this state, a
+ * printer must not produce printed output, but it must perform other
+ * operations requested by a client. If a printer had been printing a job
+ * when the printer was paused, the {@code Printer} must resume printing
+ * that job when the printer is no longer paused and leave no evidence in
+ * the printed output of such a pause. This value must be supported if the
+ * printer can be paused.
*/
public static final PrinterStateReason
PAUSED = new PrinterStateReason(4);
/**
- * Someone has removed a printer from service, and the device may be
- * powered down or physically removed.
- * In this state, a printer must not produce
- * printed output, and unless the printer is realized by a print server
- * that is still active, the printer must perform no other operations
- * requested by a client.
- * If a printer had been printing a job when it was shut down,
+ * Someone has removed a printer from service, and the device may be powered
+ * down or physically removed. In this state, a printer must not produce
+ * printed output, and unless the printer is realized by a print server that
+ * is still active, the printer must perform no other operations requested
+ * by a client. If a printer had been printing a job when it was shut down,
* the printer need not resume printing that job when the printer is no
* longer shut down. If the printer resumes printing such a job, it may
* leave evidence in the printed output of such a shutdown, e.g. the part
* printed before the shutdown may be printed a second time after the
* shutdown.
- */
+ */
public static final PrinterStateReason
SHUTDOWN = new PrinterStateReason(5);
/**
* The printer has scheduled a job on the output device and is in the
- * process of connecting to a shared network output device (and might not
- * be able to actually start printing the job for an arbitrarily long time
+ * process of connecting to a shared network output device (and might not be
+ * able to actually start printing the job for an arbitrarily long time
* depending on the usage of the output device by other servers on the
* network).
*/
@@ -146,14 +144,13 @@
TIMED_OUT = new PrinterStateReason(7);
/**
- * The printer is in the process of stopping the device and will be
- * stopped in a while.
- * When the device is stopped, the printer will change the
- * {@link PrinterState PrinterState} to STOPPED. The STOPPING reason is
- * never an error, even for a printer with a single output device. When an
- * output device ceases accepting jobs, the printer's {@link
- * PrinterStateReasons PrinterStateReasons} will have this reason while
- * the output device completes printing.
+ * The printer is in the process of stopping the device and will be stopped
+ * in a while. When the device is stopped, the printer will change the
+ * {@link PrinterState PrinterState} to {@code STOPPED}. The
+ * {@code STOPPING} reason is never an error, even for a printer with a
+ * single output device. When an output device ceases accepting jobs, the
+ * printer's {@link PrinterStateReasons PrinterStateReasons} will have this
+ * reason while the output device completes printing.
*/
public static final PrinterStateReason
STOPPING = new PrinterStateReason(8);
@@ -161,10 +158,9 @@
/**
* When a printer controls more than one output device, this reason
* indicates that one or more output devices are stopped. If the reason's
- * severity is a report, fewer than half of the output devices are
- * stopped.
- * If the reason's severity is a warning, half or more but fewer than
- * all of the output devices are stopped.
+ * severity is a report, fewer than half of the output devices are stopped.
+ * If the reason's severity is a warning, half or more but fewer than all of
+ * the output devices are stopped.
*/
public static final PrinterStateReason
STOPPED_PARTLY = new PrinterStateReason(9);
@@ -182,12 +178,10 @@
TONER_EMPTY = new PrinterStateReason(11);
/**
- * The limit of persistent storage allocated for spooling has been
- * reached.
+ * The limit of persistent storage allocated for spooling has been reached.
* The printer is temporarily unable to accept more jobs. The printer will
- * remove this reason when it is able to accept more jobs.
- * This value should be used by a non-spooling printer that only
- * accepts one or a small number
+ * remove this reason when it is able to accept more jobs. This value should
+ * be used by a non-spooling printer that only accepts one or a small number
* jobs at a time or a spooling printer that has filled the spool space.
*/
public static final PrinterStateReason
@@ -236,8 +230,7 @@
OUTPUT_TRAY_MISSING = new PrinterStateReason(19);
/**
- * One or more output areas are almost full
- * (e.g. tray, stacker, collator).
+ * One or more output areas are almost full (e.g. tray, stacker, collator).
*/
public static final PrinterStateReason
OUTPUT_AREA_ALMOST_FULL = new PrinterStateReason(20);
@@ -317,15 +310,18 @@
INTERPRETER_RESOURCE_UNAVAILABLE = new PrinterStateReason(32);
/**
- * Construct a new printer state reason enumeration value with
- * the given integer value.
+ * Construct a new printer state reason enumeration value with the given
+ * integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterStateReason(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterStateReason}.
+ */
private static final String[] myStringTable = {
"other",
"media-needed",
@@ -362,6 +358,9 @@
"interpreter-resource-unavailable"
};
+ /**
+ * The enumeration value table for class {@code PrinterStateReason}.
+ */
private static final PrinterStateReason[] myEnumValueTable = {
OTHER,
MEDIA_NEEDED,
@@ -399,29 +398,28 @@
};
/**
- * Returns the string table for class PrinterStateReason.
+ * Returns the string table for class {@code PrinterStateReason}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PrinterStateReason.
+ * Returns the enumeration value table for class {@code PrinterStateReason}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterStateReason and any vendor-defined subclasses, the
- * category is class PrinterStateReason itself.
+ * <p>
+ * For class {@code PrinterStateReason} and any vendor-defined subclasses,
+ * the category is class {@code PrinterStateReason} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterStateReason.class;
@@ -430,14 +428,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterStateReason and any vendor-defined subclasses, the
- * category name is {@code "printer-state-reason"}.
+ * <p>
+ * For class {@code PrinterStateReason} and any vendor-defined subclasses,
+ * the category name is {@code "printer-state-reason"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state-reason";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,69 +22,72 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.AbstractSet;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.HashMap;
import java.util.Set;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterStateReasons is a printing attribute class, a set of
- * enumeration values, that provides additional information about the
- * printer's current state, i.e., information that augments the value of the
- * printer's {@link PrinterState PrinterState} attribute.
- * <P>
- * Instances of {@link PrinterStateReason PrinterStateReason} do not appear in
- * a Print Service's attribute set directly. Rather, a PrinterStateReasons
+ * Class {@code PrinterStateReasons} is a printing attribute class, a set of
+ * enumeration values, that provides additional information about the printer's
+ * current state, i.e., information that augments the value of the printer's
+ * {@link PrinterState PrinterState} attribute.
+ * <p>
+ * Instances of {@link PrinterStateReason PrinterStateReason} do not appear in a
+ * Print Service's attribute set directly. Rather, a {@code PrinterStateReasons}
* attribute appears in the Print Service's attribute set. The
- * PrinterStateReasons attribute contains zero, one, or more than one {@link
- * PrinterStateReason PrinterStateReason} objects which pertain to the Print
- * Service's status, and each {@link PrinterStateReason PrinterStateReason}
- * object is associated with a {@link Severity Severity} level of REPORT
- * (least severe), WARNING, or ERROR (most severe). The printer adds a {@link
- * PrinterStateReason PrinterStateReason} object to the Print Service's
- * PrinterStateReasons attribute when the corresponding condition becomes true
- * of the printer, and the printer removes the {@link PrinterStateReason
- * PrinterStateReason} object again when the corresponding condition becomes
- * false, regardless of whether the Print Service's overall
- * {@link PrinterState PrinterState} also changed.
- * <P>
- * Class PrinterStateReasons inherits its implementation from class {@link
- * java.util.HashMap java.util.HashMap}. Each entry in the map consists of a
+ * {@code PrinterStateReasons} attribute contains zero, one, or more than one
+ * {@link PrinterStateReason PrinterStateReason} objects which pertain to the
+ * Print Service's status, and each
+ * {@link PrinterStateReason PrinterStateReason} object is associated with a
+ * {@link Severity Severity} level of {@code REPORT} (least severe),
+ * {@code WARNING}, or {@code ERROR} (most severe). The printer adds a
+ * {@link PrinterStateReason PrinterStateReason} object to the Print Service's
+ * {@code PrinterStateReasons} attribute when the corresponding condition
+ * becomes true of the printer, and the printer removes the
+ * {@link PrinterStateReason PrinterStateReason} object again when the
+ * corresponding condition becomes false, regardless of whether the Print
+ * Service's overall {@link PrinterState PrinterState} also changed.
+ * <p>
+ * Class PrinterStateReasons inherits its implementation from class
+ * {@link HashMap java.util.HashMap}. Each entry in the map consists of a
* {@link PrinterStateReason PrinterStateReason} object (key) mapping to a
* {@link Severity Severity} object (value):
- * <P>
+ * <p>
* Unlike most printing attributes which are immutable once constructed, class
- * PrinterStateReasons is designed to be mutable; you can add {@link
- * PrinterStateReason PrinterStateReason} objects to an existing
- * PrinterStateReasons object and remove them again. However, like class
- * {@link java.util.HashMap java.util.HashMap}, class PrinterStateReasons is
- * not multiple thread safe. If a PrinterStateReasons object will be used by
+ * {@code PrinterStateReasons} is designed to be mutable; you can add
+ * {@link PrinterStateReason PrinterStateReason} objects to an existing
+ * {@code PrinterStateReasons} object and remove them again. However, like class
+ * {@link HashMap java.util.HashMap}, class {@code PrinterStateReasons} is not
+ * multiple thread safe. If a {@code PrinterStateReasons} object will be used by
* multiple threads, be sure to synchronize its operations (e.g., using a
* synchronized map view obtained from class {@link java.util.Collections
* java.util.Collections}).
- * <P>
- * <B>IPP Compatibility:</B> The string values returned by each individual
+ * <p>
+ * <b>IPP Compatibility:</b> The string values returned by each individual
* {@link PrinterStateReason PrinterStateReason} object's and the associated
- * {@link Severity Severity} object's {@code toString()} methods,
- * concatenated
- * together with a hyphen ({@code "-"}) in between, gives the IPP keyword
- * value. The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * {@link Severity Severity} object's {@code toString()} methods, concatenated
+ * together with a hyphen ({@code "-"}) in between, gives the IPP keyword value.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterStateReasons
extends HashMap<PrinterStateReason,Severity>
implements PrintServiceAttribute
{
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3731791085163619457L;
/**
@@ -96,13 +99,11 @@
}
/**
- * super a new, empty printer state reasons attribute; the underlying
+ * Construct a new, empty printer state reasons attribute; the underlying
* hash map has the given initial capacity and the default load factor.
*
- * @param initialCapacity Initial capacity.
- *
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
+ * @param initialCapacity initial capacity
+ * @throws IllegalArgumentException if the initial capacity is negative
*/
public PrinterStateReasons(int initialCapacity) {
super (initialCapacity);
@@ -112,11 +113,9 @@
* Construct a new, empty printer state reasons attribute; the underlying
* hash map has the given initial capacity and load factor.
*
- * @param initialCapacity Initial capacity.
- * @param loadFactor Load factor.
- *
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
+ * @param initialCapacity initial capacity
+ * @param loadFactor load factor
+ * @throws IllegalArgumentException if the initial capacity is negative
*/
public PrinterStateReasons(int initialCapacity, float loadFactor) {
super (initialCapacity, loadFactor);
@@ -127,19 +126,15 @@
* {@link PrinterStateReason PrinterStateReason}-to-{@link Severity
* Severity} mappings as the given map. The underlying hash map's initial
* capacity and load factor are as specified in the superclass constructor
- * {@link java.util.HashMap#HashMap(java.util.Map)
- * HashMap(Map)}.
- *
- * @param map Map to copy.
+ * {@link HashMap#HashMap(Map) HashMap(Map)}.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code map} is null or if any
- * key or value in {@code map} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if any key in {@code map} is not
- * an instance of class {@link PrinterStateReason PrinterStateReason} or
- * if any value in {@code map} is not an instance of class
- * {@link Severity Severity}.
+ * @param map map to copy
+ * @throws NullPointerException if {@code map} is {@code null} or if any key
+ * or value in {@code map} is {@code null}
+ * @throws ClassCastException if any key in {@code map} is not an instance
+ * of class {@link PrinterStateReason PrinterStateReason} or if any
+ * value in {@code map} is not an instance of class
+ * {@link Severity Severity}
*/
public PrinterStateReasons(Map<PrinterStateReason,Severity> map) {
this();
@@ -149,27 +144,23 @@
/**
* Adds the given printer state reason to this printer state reasons
- * attribute, associating it with the given severity level. If this
- * printer state reasons attribute previously contained a mapping for the
- * given printer state reason, the old value is replaced.
- *
- * @param reason Printer state reason. This must be an instance of
- * class {@link PrinterStateReason PrinterStateReason}.
- * @param severity Severity of the printer state reason. This must be
- * an instance of class {@link Severity Severity}.
+ * attribute, associating it with the given severity level. If this printer
+ * state reasons attribute previously contained a mapping for the given
+ * printer state reason, the old value is replaced.
*
- * @return Previous severity associated with the given printer state
- * reason, or {@code null} if the given printer state reason was
- * not present.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if {@code reason} is null or
- * {@code severity} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if {@code reason} is not an
- * instance of class {@link PrinterStateReason PrinterStateReason} or if
- * {@code severity} is not an instance of class {@link Severity
- * Severity}.
+ * @param reason printer state reason. This must be an instance of class
+ * {@link PrinterStateReason PrinterStateReason}
+ * @param severity severity of the printer state reason. This must be an
+ * instance of class {@link Severity Severity}
+ * @return previous severity associated with the given printer state reason,
+ * or {@code null} if the given printer state reason was not
+ * present
+ * @throws NullPointerException if {@code reason} is {@code null} or
+ * {@code severity} is {@code null}
+ * @throws ClassCastException if {@code reason} is not an instance of class
+ * {@link PrinterStateReason PrinterStateReason} or if
+ * {@code severity} is not an instance of class
+ * {@link Severity Severity}
* @since 1.5
*/
public Severity put(PrinterStateReason reason, Severity severity) {
@@ -185,12 +176,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterStateReasons, the
- * category is class PrinterStateReasons itself.
+ * <p>
+ * For class {@code PrinterStateReasons}, the category is class
+ * {@code PrinterStateReasons} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterStateReasons.class;
@@ -199,11 +190,11 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterStateReasons, the
- * category name is {@code "printer-state-reasons"}.
+ * <p>
+ * For class {@code PrinterStateReasons}, the category name is
+ * {@code "printer-state-reasons"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state-reasons";
@@ -211,24 +202,21 @@
/**
* Obtain an unmodifiable set view of the individual printer state reason
- * attributes at the given severity level in this PrinterStateReasons
- * attribute. Each element in the set view is a {@link PrinterStateReason
- * PrinterStateReason} object. The only elements in the set view are the
- * {@link PrinterStateReason PrinterStateReason} objects that map to the
- * given severity value. The set view is backed by this
- * PrinterStateReasons attribute, so changes to this PrinterStateReasons
- * attribute are reflected in the set view.
- * The set view does not support element insertion or
- * removal. The set view's iterator does not support element removal.
+ * attributes at the given severity level in this
+ * {@code PrinterStateReasons} attribute. Each element in the set view is a
+ * {@link PrinterStateReason PrinterStateReason} object. The only elements
+ * in the set view are the {@link PrinterStateReason PrinterStateReason}
+ * objects that map to the given severity value. The set view is backed by
+ * this {@code PrinterStateReasons} attribute, so changes to this
+ * {@code PrinterStateReasons} attribute are reflected in the set view. The
+ * set view does not support element insertion or removal. The set view's
+ * iterator does not support element removal.
*
- * @param severity Severity level.
- *
- * @return Set view of the individual {@link PrinterStateReason
- * PrinterStateReason} attributes at the given {@link Severity
- * Severity} level.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code severity} is null.
+ * @param severity severity level
+ * @return set view of the individual
+ * {@link PrinterStateReason PrinterStateReason} attributes at the
+ * given {@link Severity Severity} level
+ * @throws NullPointerException if {@code severity} is {@code null}
*/
public Set<PrinterStateReason> printerStateReasonSet(Severity severity) {
if (severity == null) {
@@ -305,5 +293,4 @@
throw new UnsupportedOperationException();
}
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,41 +22,41 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.net.URI;
-import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterURI is a printing attribute class, a URI, that specifies the
- * globally unique name of a printer. If it has such a name, an administrator
- * determines a printer's URI and sets this attribute to that name.
- * <P>
- * <B>IPP Compatibility:</B> This implements the
- * IPP printer-uri attribute. The string form returned by
- * {@code toString()} gives the IPP printer-uri value.
- * The category name returned by {@code getName()}
- * gives the IPP attribute name.
+ * Class {@code PrinterURI} is a printing attribute class, a {@code URI}, that
+ * specifies the globally unique name of a printer. If it has such a name, an
+ * administrator determines a printer's {@code URI} and sets this attribute to
+ * that name.
+ * <p>
+ * <b>IPP Compatibility:</b> This implements the IPP printer-uri attribute. The
+ * string form returned by {@code toString()} gives the IPP printer-uri value.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Robert Herriot
+ * @author Robert Herriot
*/
-
public final class PrinterURI extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7923912792485606497L;
/**
- * Constructs a new PrinterURI attribute with the specified URI.
+ * Constructs a new {@code PrinterURI} attribute with the specified
+ * {@code URI}.
*
- * @param uri URI of the printer
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI} of the printer
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterURI(URI uri) {
super (uri);
@@ -66,34 +66,30 @@
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class PrinterURI.
- * <LI>
- * This PrinterURI attribute's underlying URI and
- * {@code object}'s underlying URI are equal.
- * </OL>
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code PrinterURI}.
+ * <li>This {@code PrinterURI} attribute's underlying {@code URI} and
+ * {@code object}'s underlying {@code URI} are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this PrinterURI
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * {@code PrinterURI} attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterURI);
}
- /**
+ /**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class PrinterURI and any vendor-defined subclasses, the category is
- * class PrinterURI itself.
+ * <p>
+ * For class {@code PrinterURI} and any vendor-defined subclasses, the
+ * category is class {@code PrinterURI} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return PrinterURI.class;
@@ -102,14 +98,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class PrinterURI and any vendor-defined subclasses, the category
- * name is {@code "printer-uri"}.
+ * <p>
+ * For class {@code PrinterURI} and any vendor-defined subclasses, the
+ * category name is {@code "printer-uri"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-uri";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,29 +30,29 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class QueuedJobCount is an integer valued printing attribute that indicates
- * the number of jobs in the printer whose {@link JobState JobState} is either
- * PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED.
- * <P>
- * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * Class {@code QueuedJobCount} is an integer valued printing attribute that
+ * indicates the number of jobs in the printer whose {@link JobState JobState}
+ * is either {@code PENDING}, {@code PENDING_HELD}, {@code PROCESSING}, or
+ * {@code PROCESSING_STOPPED}.
+ * <p>
+ * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class QueuedJobCount extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7499723077864047742L;
/**
- * Construct a new queued job count attribute with the given integer
- * value.
+ * Construct a new queued job count attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public QueuedJobCount(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -59,22 +60,18 @@
/**
* Returns whether this queued job count attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * mus be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class QueuedJobCount.
- * <LI>
- * This queued job count attribute's value and {@code object}'s
- * value are equal.
- * </OL>
+ * passed in object. To be equivalent, all of the following conditions mus
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code QueuedJobCount}.
+ * <li>This queued job count attribute's value and {@code object}'s value
+ * are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this queued job
- * count attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this queued job
+ * count attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -84,11 +81,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class QueuedJobCount, the category is class QueuedJobCount itself.
+ * <p>
+ * For class {@code QueuedJobCount}, the category is class
+ * {@code QueuedJobCount} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return QueuedJobCount.class;
@@ -97,14 +95,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class QueuedJobCount, the
- * category name is {@code "queued-job-count"}.
+ * <p>
+ * For class {@code QueuedJobCount}, the category name is
+ * {@code "queued-job-count"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "queued-job-count";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,45 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class ReferenceUriSchemesSupported is a printing attribute class
- * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
- * that a printer can use to retrieve print data stored at a URI location.
- * If a printer supports doc flavors with a print data representation class of
+ * Class {@code ReferenceUriSchemesSupported} is a printing attribute class an
+ * enumeration, that indicates a "URI scheme," such as "http:" or "ftp:", that a
+ * printer can use to retrieve print data stored at a {@code URI} location. If a
+ * printer supports doc flavors with a print data representation class of
* {@code "java.net.URL"}, the printer uses instances of class
- * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
- * The acceptable URI schemes are included as service attributes in the
- * lookup service; this lets clients search the
- * for printers that can get print data using a certain URI scheme. The
- * acceptable URI schemes can also be queried using the capability methods in
- * interface {@code PrintService}. However,
- * ReferenceUriSchemesSupported attributes are used solely for determining
- * acceptable URI schemes, they are never included in a doc's,
- * print request's, print job's, or print service's attribute set.
- * <P>
+ * {@code ReferenceUriSchemesSupported} to advertise the {@code URI} schemes it
+ * can accept. The acceptable {@code URI} schemes are included as service
+ * attributes in the lookup service; this lets clients search the for printers
+ * that can get print data using a certain {@code URI} scheme. The acceptable
+ * {@code URI} schemes can also be queried using the capability methods in
+ * interface {@code PrintService}. However, {@code ReferenceUriSchemesSupported}
+ * attributes are used solely for determining acceptable {@code URI} schemes,
+ * they are never included in a doc's, print request's, print job's, or print
+ * service's attribute set.
+ * <p>
* The Internet Assigned Numbers Authority maintains the
- * <A HREF="http://www.iana.org/assignments/uri-schemes.html">official
- * list of URI schemes</A>.
+ * <a href="http://www.iana.org/assignments/uri-schemes.html">official list of
+ * URI schemes</a>.
* <p>
- * Class ReferenceUriSchemesSupported defines enumeration values for widely
- * used URI schemes. A printer that supports additional URI schemes
- * can define them in a subclass of class ReferenceUriSchemesSupported.
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code ReferenceUriSchemesSupported} defines enumeration values for
+ * widely used {@code URI} schemes. A printer that supports additional
+ * {@code URI} schemes can define them in a subclass of class
+ * {@code ReferenceUriSchemesSupported}.
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class ReferenceUriSchemesSupported
extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8989076942813442805L;
/**
@@ -105,15 +110,18 @@
public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
/**
- * Construct a new reference URI scheme enumeration value with the given
- * integer value.
+ * Construct a new reference {@code URI} scheme enumeration value with the
+ * given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected ReferenceUriSchemesSupported(int value) {
super (value);
}
+ /**
+ * The string table for class {@code ReferenceUriSchemesSupported}.
+ */
private static final String[] myStringTable = {
"ftp",
"http",
@@ -125,6 +133,10 @@
"file",
};
+ /**
+ * The enumeration value table for class
+ * {@code ReferenceUriSchemesSupported}.
+ */
private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
FTP,
HTTP,
@@ -137,7 +149,7 @@
};
/**
- * Returns the string table for class ReferenceUriSchemesSupported.
+ * Returns the string table for class {@code ReferenceUriSchemesSupported}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
@@ -145,7 +157,7 @@
/**
* Returns the enumeration value table for class
- * ReferenceUriSchemesSupported.
+ * {@code ReferenceUriSchemesSupported}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -154,12 +166,13 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class ReferenceUriSchemesSupported and any vendor-defined
- * subclasses, the category is class ReferenceUriSchemesSupported itself.
+ * <p>
+ * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
+ * subclasses, the category is class {@code ReferenceUriSchemesSupported}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return ReferenceUriSchemesSupported.class;
@@ -168,15 +181,14 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class ReferenceUriSchemesSupported and any vendor-defined
+ * <p>
+ * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
* subclasses, the category name is
* {@code "reference-uri-schemes-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "reference-uri-schemes-supported";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,77 +22,73 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintRequestAttribute;
/**
- * Class RequestingUserName is a printing attribute class, a text attribute,
- * that specifies the name of the end user that submitted the print job. A
- * requesting user name is an arbitrary string defined by the client. The
- * printer does not put the client-specified RequestingUserName attribute into
- * the Print Job's attribute set; rather, the printer puts in a {@link
- * JobOriginatingUserName JobOriginatingUserName} attribute.
- * This means that services which support specifying a username with this
- * attribute should also report a JobOriginatingUserName in the job's
- * attribute set. Note that many print services may have a way to independently
- * authenticate the user name, and so may state support for a
- * requesting user name, but in practice will then report the user name
- * authenticated by the service rather than that specified via this
- * attribute.
- * <P>
- * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
+ * Class {@code RequestingUserName} is a printing attribute class, a text
+ * attribute, that specifies the name of the end user that submitted the print
+ * job. A requesting user name is an arbitrary string defined by the client. The
+ * printer does not put the client-specified {@code RequestingUserName}
+ * attribute into the Print Job's attribute set; rather, the printer puts in a
+ * {@link JobOriginatingUserName JobOriginatingUserName} attribute. This means
+ * that services which support specifying a username with this attribute should
+ * also report a {@code JobOriginatingUserName} in the job's attribute set. Note
+ * that many print services may have a way to independently authenticate the
+ * user name, and so may state support for a requesting user name, but in
+ * practice will then report the user name authenticated by the service rather
+ * than that specified via this attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class RequestingUserName extends TextSyntax
implements PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2683049894310331454L;
/**
- * Constructs a new requesting user name attribute with the given user
- * name and locale.
+ * Constructs a new requesting user name attribute with the given user name
+ * and locale.
*
- * @param userName User name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code userName} is null.
+ * @param userName user name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code userName} is {@code null}
*/
public RequestingUserName(String userName, Locale locale) {
super (userName, locale);
}
/**
- * Returns whether this requesting user name attribute is equivalent to
- * the passed in object. To be equivalent, all of the following
- * conditions must be true:
- * <OL TYPE=1>
- * <LI>
- * {@code object} is not null.
- * <LI>
- * {@code object} is an instance of class RequestingUserName.
- * <LI>
- * This requesting user name attribute's underlying string and
- * {@code object}'s underlying string are equal.
- * <LI>
- * This requesting user name attribute's locale and
- * {@code object}'s locale are equal.
- * </OL>
+ * Returns whether this requesting user name attribute is equivalent to the
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ * <ol type=1>
+ * <li>{@code object} is not {@code null}.
+ * <li>{@code object} is an instance of class {@code RequestingUserName}.
+ * <li>This requesting user name attribute's underlying string and
+ * {@code object}'s underlying string are equal.
+ * <li>This requesting user name attribute's locale and {@code object}'s
+ * locale are equal.
+ * </ol>
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this requesting
- * user name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this requesting
+ * user name attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -102,12 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class RequestingUserName, the
- * category is class RequestingUserName itself.
+ * <p>
+ * For class {@code RequestingUserName}, the category is class
+ * {@code RequestingUserName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return RequestingUserName.class;
@@ -116,14 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class RequestingUserName, the
- * category name is {@code "requesting-user-name"}.
+ * <p>
+ * For class {@code RequestingUserName}, the category name is
+ * {@code "requesting-user-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "requesting-user-name";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,54 +22,53 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class Severity is a printing attribute class, an enumeration, that denotes
- * the severity of a {@link PrinterStateReason PrinterStateReason} attribute.
- * <P>
- * Instances of Severity do not appear in a Print Service's attribute set
- * directly. Rather, a {@link PrinterStateReasons PrinterStateReasons}
+ * Class {@code Severity} is a printing attribute class, an enumeration, that
+ * denotes the severity of a {@link PrinterStateReason PrinterStateReason}
+ * attribute.
+ * <p>
+ * Instances of {@code Severity} do not appear in a Print Service's attribute
+ * set directly. Rather, a {@link PrinterStateReasons PrinterStateReasons}
* attribute appears in the Print Service's attribute set.
- * The {@link PrinterStateReasons
- * PrinterStateReasons} attribute contains zero, one, or more than one {@link
- * PrinterStateReason PrinterStateReason} objects which pertain to the Print
- * Service's status, and each {@link PrinterStateReason PrinterStateReason}
- * object is associated with a Severity level of REPORT (least severe),
- * WARNING, or ERROR (most severe).
- * The printer adds a {@link PrinterStateReason
- * PrinterStateReason} object to the Print Service's
+ * The {@link PrinterStateReasons PrinterStateReasons} attribute contains zero,
+ * one, or more than one {@link PrinterStateReason PrinterStateReason} objects
+ * which pertain to the Print Service's status, and each
+ * {@link PrinterStateReason PrinterStateReason} object is associated with a
+ * Severity level of {@code REPORT} (least severe), {@code WARNING}, or
+ * {@code ERROR} (most severe). The printer adds a
+ * {@link PrinterStateReason PrinterStateReason} object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
- * corresponding condition becomes true
- * of the printer, and the printer removes the {@link PrinterStateReason
- * PrinterStateReason} object again when the corresponding condition becomes
- * false, regardless of whether the Print Service's overall
- * {@link PrinterState PrinterState} also changed.
- * <P>
- * <B>IPP Compatibility:</B>
- * {@code Severity.toString()} returns either "error", "warning", or
- * "report". The string values returned by
- * each individual {@link PrinterStateReason} and
- * associated {@link Severity} object's {@code toString()}
- * methods, concatenated together with a hyphen ({@code "-"}) in
- * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * corresponding condition becomes true of the printer, and the printer removes
+ * the {@link PrinterStateReason PrinterStateReason} object again when the
+ * corresponding condition becomes false, regardless of whether the Print
+ * Service's overall {@link PrinterState PrinterState} also changed.
+ * <p>
+ * <b>IPP Compatibility:</b> {@code Severity.toString()} returns either "error",
+ * "warning", or "report". The string values returned by each individual
+ * {@link PrinterStateReason} and associated {@link Severity} object's
+ * {@code toString()} methods, concatenated together with a hyphen ({@code "-"})
+ * in between, gives the IPP keyword value for a {@link PrinterStateReasons}.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class Severity extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8781881462717925380L;
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
- * "report" (least severe). An implementation may choose to omit some or
- * all reports.
- * Some reports specify finer granularity about the printer state;
+ * "report" (least severe). An implementation may choose to omit some or all
+ * reports. Some reports specify finer granularity about the printer state;
* others serve as a precursor to a warning. A report must contain nothing
* that could affect the printed output.
*/
@@ -78,36 +77,41 @@
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
* "warning." An implementation may choose to omit some or all warnings.
- * Warnings serve as a precursor to an error. A warning must contain
- * nothing that prevents a job from completing, though in some cases the
- * output may be of lower quality.
+ * Warnings serve as a precursor to an error. A warning must contain nothing
+ * that prevents a job from completing, though in some cases the output may
+ * be of lower quality.
*/
public static final Severity WARNING = new Severity (1);
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is an
- * "error" (most severe). An implementation must include all errors.
- * If this attribute contains one or more errors, the printer's
- * {@link PrinterState PrinterState} must be STOPPED.
+ * "error" (most severe). An implementation must include all errors. If this
+ * attribute contains one or more errors, the printer's
+ * {@link PrinterState PrinterState} must be {@code STOPPED}.
*/
public static final Severity ERROR = new Severity (2);
/**
- * Construct a new severity enumeration value with the given integer
- * value.
+ * Construct a new severity enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Severity(int value) {
super (value);
}
+ /**
+ * The string table for class {@code Severity}.
+ */
private static final String[] myStringTable = {
"report",
"warning",
"error"
};
+ /**
+ * The enumeration value table for class {@code Severity}.
+ */
private static final Severity[] myEnumValueTable = {
REPORT,
WARNING,
@@ -115,28 +119,28 @@
};
/**
- * Returns the string table for class Severity.
+ * Returns the string table for class {@code Severity}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Severity.
+ * Returns the enumeration value table for class {@code Severity}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Severity, the category is class Severity itself.
+ * <p>
+ * For class {@code Severity}, the category is class
+ * {@code Severity} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Severity.class;
@@ -145,13 +149,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Severit, the category name is {@code "severity"}.
+ * <p>
+ * For class {@code Severity}, the category name is {@code "severity"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "severity";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,146 +22,134 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class SheetCollate is a printing attribute class, an enumeration, that
- * specifies whether or not the media sheets of each copy of each printed
+ * Class {@code SheetCollate} is a printing attribute class, an enumeration,
+ * that specifies whether or not the media sheets of each copy of each printed
* document in a job are to be in sequence, when multiple copies of the document
- * are specified by the {@link Copies Copies} attribute. When SheetCollate is
- * COLLATED, each copy of each document is printed with the print-stream sheets
- * in sequence. When SheetCollate is UNCOLLATED, each print-stream sheet is
- * printed a number of times equal to the value of the {@link Copies Copies}
- * attribute in succession. For example, suppose a document produces two media
- * sheets as output, {@link Copies Copies} is 6, and SheetCollate is UNCOLLATED;
- * in this case six copies of the first media sheet are printed followed by
- * six copies of the second media sheet.
- * <P>
+ * are specified by the {@link Copies Copies} attribute. When
+ * {@code SheetCollate} is {@code COLLATED}, each copy of each document is
+ * printed with the print-stream sheets in sequence. When {@code SheetCollate}
+ * is {@code UNCOLLATED}, each print-stream sheet is printed a number of times
+ * equal to the value of the {@link Copies Copies} attribute in succession. For
+ * example, suppose a document produces two media sheets as output,
+ * {@link Copies Copies} is 6, and {@code SheetCollate} is UNCOLLATED; in this
+ * case six copies of the first media sheet are printed followed by six copies
+ * of the second media sheet.
+ * <p>
* Whether the effect of sheet collation is achieved by placing copies of a
* document in multiple output bins or in the same output bin with
- * implementation defined document separation is implementation dependent.
- * Also whether it is achieved by making multiple passes over the job or by
- * using an output sorter is implementation dependent.
- * <P>
- * If a printer does not support the SheetCollate attribute (meaning the client
- * cannot specify any particular sheet collation), the printer must behave as
- * though SheetCollate were always set to COLLATED.
- * <P>
- * The SheetCollate attribute interacts with the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute. The {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute describes the collation of entire
- * documents, and the SheetCollate attribute describes the semantics of
- * collating individual pages within a document.
- * <P>
- * The effect of a SheetCollate attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same sheet
- * collation specified or whether different docs have different sheet
- * collations specified, and on the (perhaps defaulted) value of the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} attribute.
- * <UL>
- * <LI>
- * If all the docs have the same sheet collation specified, then the following
- * combinations of SheetCollate and {@link MultipleDocumentHandling
- * MultipleDocumentHandling} are permitted, and the printer reports an error
- * when the job is submitted if any other combination is specified:
- * <UL>
- * <LI>
- * SheetCollate = COLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
- * combined into one output document. Multiple copies of the output document
- * will be produced with pages in collated order, i.e. pages 1, 2, 3, . . .,
- * 1, 2, 3, . . .
- *
- * <LI>
- * SheetCollate = COLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
- * will be combined into one output document, and the first impression of each
- * input doc will always start on a new media sheet. Multiple copies of the
- * output document will be produced with pages in collated order, i.e. pages
- * 1, 2, 3, . . ., 1, 2, 3, . . .
- *
- * <LI>
- * SheetCollate = COLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
- * input doc will remain a separate output document. Multiple copies of each
- * output document (call them A, B, . . .) will be produced with each document's
- * pages in collated order, but the documents themselves in uncollated order,
- * i.e. pages A1, A2, A3, . . ., A1, A2, A3, . . ., B1, B2, B3, . . ., B1, B2,
- * B3, . . .
+ * implementation defined document separation is implementation dependent. Also
+ * whether it is achieved by making multiple passes over the job or by using an
+ * output sorter is implementation dependent.
+ * <p>
+ * If a printer does not support the {@code SheetCollate} attribute (meaning the
+ * client cannot specify any particular sheet collation), the printer must
+ * behave as though {@code SheetCollate} were always set to {@code COLLATED}.
+ * <p>
+ * The {@code SheetCollate} attribute interacts with the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute. The
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute describes
+ * the collation of entire documents, and the {@code SheetCollate} attribute
+ * describes the semantics of collating individual pages within a document.
+ * <p>
+ * The effect of a {@code SheetCollate} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same sheet
+ * collation specified or whether different docs have different sheet collations
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ * <ul>
+ * <li>If all the docs have the same sheet collation specified, then the
+ * following combinations of {@code SheetCollate} and
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} are permitted,
+ * and the printer reports an error when the job is submitted if any other
+ * combination is specified:
+ * <ul>
+ * <li>SheetCollate = COLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
+ * combined into one output document. Multiple copies of the output document
+ * will be produced with pages in collated order, i.e. pages 1, 2, 3, . . .,
+ * 1, 2, 3, . . .
+ * <li>SheetCollate = COLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input
+ * docs will be combined into one output document, and the first impression
+ * of each input doc will always start on a new media sheet. Multiple copies
+ * of the output document will be produced with pages in collated order,
+ * i.e. pages 1, 2, 3, . . ., 1, 2, 3, . . .
+ * <li>SheetCollate = COLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
+ * input doc will remain a separate output document. Multiple copies of each
+ * output document (call them A, B, . . .) will be produced with each
+ * document's pages in collated order, but the documents themselves in
+ * uncollated order, i.e. pages A1, A2, A3, . . ., A1, A2, A3, . . ., B1,
+ * B2, B3, . . ., B1, B2, B3, . . .
+ * <li>SheetCollate = COLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each
+ * input doc will remain a separate output document. Multiple copies of each
+ * output document (call them A, B, . . .) will be produced with each
+ * document's pages in collated order, with the documents themselves also in
+ * collated order, i.e. pages A1, A2, A3, . . ., B1, B2, B3, . . ., A1, A2,
+ * A3, . . ., B1, B2, B3, . . .
+ * <li>SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
+ * combined into one output document. Multiple copies of the output document
+ * will be produced with pages in uncollated order, i.e. pages 1, 1, . . .,
+ * 2, 2, . . ., 3, 3, . . .
+ * <li>SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input
+ * docs will be combined into one output document, and the first impression
+ * of each input doc will always start on a new media sheet. Multiple copies
+ * of the output document will be produced with pages in uncollated order,
+ * i.e. pages 1, 1, . . ., 2, 2, . . ., 3, 3, . . .
+ * <li>SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
+ * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
+ * input doc will remain a separate output document. Multiple copies of each
+ * output document (call them A, B, . . .) will be produced with each
+ * document's pages in uncollated order, with the documents themselves also
+ * in uncollated order, i.e. pages A1, A1, . . ., A2, A2, . . ., A3, A3, . .
+ * ., B1, B1, . . ., B2, B2, . . ., B3, B3, . . .
+ * </ul>
+ * <li>If different docs have different sheet collations specified, then only
+ * one value of {@link MultipleDocumentHandling MultipleDocumentHandling} is
+ * permitted, and the printer reports an error when the job is submitted if
+ * any other value is specified:
+ * <ul>
+ * <li>{@link MultipleDocumentHandling MultipleDocumentHandling} =
+ * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will remain a
+ * separate output document. Multiple copies of each output document (call
+ * them A, B, . . .) will be produced with each document's pages in collated
+ * or uncollated order as the corresponding input doc's SheetCollate
+ * attribute specifies, and with the documents themselves in uncollated
+ * order. If document A had SheetCollate = UNCOLLATED and document B had
+ * SheetCollate = COLLATED, the following pages would be produced: A1, A1, .
+ * . ., A2, A2, . . ., A3, A3, . . ., B1, B2, B3, . . ., B1, B2, B3, . . .
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>IPP Compatibility:</b> SheetCollate is not an IPP attribute at present.
*
- * <LI>
- * SheetCollate = COLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input
- * doc will remain a separate output document. Multiple copies of each output
- * document (call them A, B, . . .) will be produced with each document's pages
- * in collated order, with the documents themselves also in collated order, i.e.
- * pages A1, A2, A3, . . ., B1, B2, B3, . . ., A1, A2, A3, . . ., B1, B2, B3,
- * . . .
- *
- * <LI>
- * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
- * combined into one output document. Multiple copies of the output document
- * will be produced with pages in uncollated order, i.e. pages 1, 1, . . .,
- * 2, 2, . . ., 3, 3, . . .
- *
- * <LI>
- * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
- * will be combined into one output document, and the first impression of each
- * input doc will always start on a new media sheet. Multiple copies of the
- * output document will be produced with pages in uncollated order, i.e. pages
- * 1, 1, . . ., 2, 2, . . ., 3, 3, . . .
- *
- * <LI>
- * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
- * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
- * input doc will remain a separate output document. Multiple copies of each
- * output document (call them A, B, . . .) will be produced with each document's
- * pages in uncollated order, with the documents themselves also in uncollated
- * order, i.e. pages A1, A1, . . ., A2, A2, . . ., A3, A3, . . ., B1, B1, . . .,
- * B2, B2, . . ., B3, B3, . . .
- * </UL>
- *
- * <LI>
- * If different docs have different sheet collations specified, then only one
- * value of {@link MultipleDocumentHandling MultipleDocumentHandling} is
- * permitted, and the printer reports an error when the job is submitted if any
- * other value is specified:
- * <UL>
- * <LI>
- * {@link MultipleDocumentHandling MultipleDocumentHandling} =
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will remain a separate
- * output document. Multiple copies of each output document (call them A, B,
- * . . .) will be produced with each document's pages in collated or uncollated
- * order as the corresponding input doc's SheetCollate attribute specifies, and
- * with the documents themselves in uncollated order. If document A had
- * SheetCollate = UNCOLLATED and document B had SheetCollate = COLLATED, the
- * following pages would be produced: A1, A1, . . ., A2, A2, . . ., A3, A3,
- * . . ., B1, B2, B3, . . ., B1, B2, B3, . . .
- * </UL>
- * </UL>
- * <P>
- * <B>IPP Compatibility:</B> SheetCollate is not an IPP attribute at present.
- *
- * @see MultipleDocumentHandling
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
+ * @see MultipleDocumentHandling
*/
public final class SheetCollate extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7080587914259873003L;
/**
- * Sheets within a document appear in uncollated order when multiple
- * copies are printed.
+ * Sheets within a document appear in uncollated order when multiple copies
+ * are printed.
*/
public static final SheetCollate UNCOLLATED = new SheetCollate(0);
@@ -175,31 +163,37 @@
* Construct a new sheet collate enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected SheetCollate(int value) {
super (value);
}
+ /**
+ * The string table for class {@code SheetCollate}.
+ */
private static final String[] myStringTable = {
"uncollated",
"collated"
};
+ /**
+ * The enumeration value table for class {@code SheetCollate}.
+ */
private static final SheetCollate[] myEnumValueTable = {
UNCOLLATED,
COLLATED
};
/**
- * Returns the string table for class SheetCollate.
+ * Returns the string table for class {@code SheetCollate}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class SheetCollate.
+ * Returns the enumeration value table for class {@code SheetCollate}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -208,11 +202,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class SheetCollate, the category is class SheetCollate itself.
+ * <p>
+ * For class {@code SheetCollate}, the category is class
+ * {@code SheetCollate} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return SheetCollate.class;
@@ -221,13 +216,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class SheetCollate, the category name is {@code "sheet-collate"}.
+ * <p>
+ * For class {@code SheetCollate}, the category name is
+ * {@code "sheet-collate"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "sheet-collate";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,104 +22,96 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Sides is a printing attribute class, an enumeration, that specifies
- * how print-stream pages are to be imposed upon the sides of an instance of a
- * selected medium, i.e., an impression.
- * <P>
- * The effect of a Sides attribute on a multidoc print job (a job with multiple
- * documents) depends on whether all the docs have the same sides values
- * specified or whether different docs have different sides values specified,
- * and on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute.
- * <UL>
- * <LI>
- * If all the docs have the same sides value <I>n</I> specified, then any value
- * of {@link MultipleDocumentHandling MultipleDocumentHandling} makes sense,
- * and the printer's processing depends on the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} value:
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be combined together into one
- * output document. Each media sheet will consist of <I>n</I> impressions from
- * the output document.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
- * into one output document. Each media sheet will consist of <I>n</I>
- * impressions from the output document. However, the first impression of each
- * input doc will always start on a new media sheet; this means the last media
- * sheet of an input doc may have only one impression on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
- * Each media sheet will consist of <I>n</I> impressions from the input doc.
- * Since the input docs are separate, the first impression of each input doc
- * will always start on a new media sheet; this means the last media sheet of
- * an input doc may have only one impression on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
- * Each media sheet will consist of <I>n</I> impressions from the input doc.
- * Since the input docs are separate, the first impression of each input doc
- * will always start on a new media sheet; this means the last media sheet of
- * an input doc may have only one impression on it.
- * </UL>
+ * Class {@code Sides} is a printing attribute class, an enumeration, that
+ * specifies how print-stream pages are to be imposed upon the sides of an
+ * instance of a selected medium, i.e., an impression.
+ * <p>
+ * The effect of a {@code Sides} attribute on a multidoc print job (a job with
+ * multiple documents) depends on whether all the docs have the same sides
+ * values specified or whether different docs have different sides values
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ * <ul>
+ * <li>If all the docs have the same sides value <i>n</i> specified, then any
+ * value of {@link MultipleDocumentHandling MultipleDocumentHandling} makes
+ * sense, and the printer's processing depends on the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} value:
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be combined
+ * together into one output document. Each media sheet will consist of
+ * <i>n</i> impressions from the output document.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be
+ * combined together into one output document. Each media sheet will consist
+ * of <i>n</i> impressions from the output document. However, the first
+ * impression of each input doc will always start on a new media sheet; this
+ * means the last media sheet of an input doc may have only one impression
+ * on it.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- The input docs will
+ * remain separate. Each media sheet will consist of <i>n</i> impressions
+ * from the input doc. Since the input docs are separate, the first
+ * impression of each input doc will always start on a new media sheet; this
+ * means the last media sheet of an input doc may have only one impression
+ * on it.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- The input docs will
+ * remain separate. Each media sheet will consist of <i>n</i> impressions
+ * from the input doc. Since the input docs are separate, the first
+ * impression of each input doc will always start on a new media sheet; this
+ * means the last media sheet of an input doc may have only one impression
+ * on it.
+ * </ul>
+ * <ul>
+ * <li>{@code SINGLE_DOCUMENT} -- All the input docs will be combined
+ * together into one output document. Each media sheet will consist of
+ * <i>n<sub>i</sub></i> impressions from the output document, where <i>i</i>
+ * is the number of the input doc corresponding to that point in the output
+ * document. When the next input doc has a different sides value from the
+ * previous input doc, the first print-stream page of the next input doc
+ * goes at the start of the next media sheet, possibly leaving only one
+ * impression on the previous media sheet.
+ * <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be
+ * combined together into one output document. Each media sheet will consist
+ * of <i>n</i> impressions from the output document. However, the first
+ * impression of each input doc will always start on a new media sheet; this
+ * means the last impression of an input doc may have only one impression on
+ * it.
+ * <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- The input docs will
+ * remain separate. For input doc <i>i,</i> each media sheet will consist of
+ * <i>n<sub>i</sub></i> impressions from the input doc. Since the input docs
+ * are separate, the first impression of each input doc will always start on
+ * a new media sheet; this means the last media sheet of an input doc may
+ * have only one impression on it.
+ * <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- The input docs will
+ * remain separate. For input doc <i>i,</i> each media sheet will consist of
+ * <i>n<sub>i</sub></i> impressions from the input doc. Since the input docs
+ * are separate, the first impression of each input doc will always start on
+ * a new media sheet; this means the last media sheet of an input doc may
+ * have only one impression on it.
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * <UL>
- * <LI>
- * SINGLE_DOCUMENT -- All the input docs will be combined together into one
- * output document. Each media sheet will consist of <I>n<SUB>i</SUB></I>
- * impressions from the output document, where <I>i</I> is the number of the
- * input doc corresponding to that point in the output document. When the next
- * input doc has a different sides value from the previous input doc, the first
- * print-stream page of the next input doc goes at the start of the next media
- * sheet, possibly leaving only one impression on the previous media sheet.
- *
- * <LI>
- * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
- * into one output document. Each media sheet will consist of <I>n</I>
- * impressions from the output document. However, the first impression of each
- * input doc will always start on a new media sheet; this means the last
- * impression of an input doc may have only one impression on it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
- * For input doc <I>i,</I> each media sheet will consist of <I>n<SUB>i</SUB></I>
- * impressions from the input doc. Since the input docs are separate, the first
- * impression of each input doc will always start on a new media sheet; this
- * means the last media sheet of an input doc may have only one impression on
- * it.
- *
- * <LI>
- * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
- * For input doc <I>i,</I> each media sheet will consist of <I>n<SUB>i</SUB></I>
- * impressions from the input doc. Since the input docs are separate, the first
- * impression of each input doc will always start on a new media sheet; this
- * means the last media sheet of an input doc may have only one impression on
- * it.
- * </UL>
- * </UL>
- * <P>
- * <B>IPP Compatibility:</B> The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
-
public final class Sides extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6890309414893262822L;
/**
@@ -130,49 +122,55 @@
/**
* Imposes each consecutive pair of print-stream pages upon front and back
- * sides of consecutive media sheets, such that the orientation of each
- * pair of print-stream pages on the medium would be correct for the
- * reader as if for binding on the long edge. This imposition is also
- * known as "duplex" (see {@link #DUPLEX DUPLEX}).
+ * sides of consecutive media sheets, such that the orientation of each pair
+ * of print-stream pages on the medium would be correct for the reader as if
+ * for binding on the long edge. This imposition is also known as "duplex"
+ * (see {@link #DUPLEX DUPLEX}).
*/
public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
/**
* Imposes each consecutive pair of print-stream pages upon front and back
- * sides of consecutive media sheets, such that the orientation of each
- * pair of print-stream pages on the medium would be correct for the
- * reader as if for binding on the short edge. This imposition is also
- * known as "tumble" (see {@link #TUMBLE TUMBLE}).
+ * sides of consecutive media sheets, such that the orientation of each pair
+ * of print-stream pages on the medium would be correct for the reader as if
+ * for binding on the short edge. This imposition is also known as "tumble"
+ * (see {@link #TUMBLE TUMBLE}).
*/
public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
/**
- * An alias for "two sided long edge" (see {@link #TWO_SIDED_LONG_EDGE
- * TWO_SIDED_LONG_EDGE}).
+ * An alias for "two sided long edge" (see
+ * {@link #TWO_SIDED_LONG_EDGE TWO_SIDED_LONG_EDGE}).
*/
public static final Sides DUPLEX = TWO_SIDED_LONG_EDGE;
/**
- * An alias for "two sided short edge" (see {@link #TWO_SIDED_SHORT_EDGE
- * TWO_SIDED_SHORT_EDGE}).
+ * An alias for "two sided short edge" (see
+ * {@link #TWO_SIDED_SHORT_EDGE TWO_SIDED_SHORT_EDGE}).
*/
public static final Sides TUMBLE = TWO_SIDED_SHORT_EDGE;
/**
* Construct a new sides enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Sides(int value) {
super (value);
}
+ /**
+ * The string table for class {@code Sides}.
+ */
private static final String[] myStringTable = {
"one-sided",
"two-sided-long-edge",
"two-sided-short-edge"
};
+ /**
+ * The enumeration value table for class {@code Sides}.
+ */
private static final Sides[] myEnumValueTable = {
ONE_SIDED,
TWO_SIDED_LONG_EDGE,
@@ -180,14 +178,14 @@
};
/**
- * Returns the string table for class Sides.
+ * Returns the string table for class {@code Sides}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Sides.
+ * Returns the enumeration value table for class {@code Sides}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -196,11 +194,11 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * <P>
- * For class Sides, the category is class Sides itself.
+ * <p>
+ * For class {@code Sides}, the category is class {@code Sides} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class<? extends Attribute> getCategory() {
return Sides.class;
@@ -209,13 +207,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- * <P>
- * For class Sides, the category name is {@code "sides"}.
+ * <p>
+ * For class {@code Sides}, the category name is {@code "sides"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "sides";
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java Thu Aug 31 15:47:34 2017 -0700
@@ -24,8 +24,8 @@
*/
/**
- * Package javax.print.attribute.standard contains classes for specific printing
- * attributes. The parent package, <a href="../package-summary.html">
+ * Package {@code javax.print.attribute.standard} contains classes for specific
+ * printing attributes. The parent package, <a href="../package-summary.html">
* javax.print.attribute</a>, provides classes and interfaces that describe the
* types of Java Print Service attributes and how they can be collected into
* attribute sets.
@@ -43,19 +43,19 @@
* support them. These support requirements are recorded in the documentation
* for each attribute class.
* <p>
- * Package javax.print.attribute.standard contains standard printing attributes
- * and standard printing attribute values that are widely used in the printing
- * domain. A print service vendor can provide new vendor-specific printing
- * attributes in addition to the standard ones. A vendor can also provide
- * vendor-specific extensions (subclasses) of the standard printing attributes
- * -- for example, to provide additional vendor-specific values for an existing
- * standard attribute. Of course, if a vendor wants clients to be able to use
- * any added or extended attributes, the vendor must publish the new attribute
- * classes.
+ * Package {@code javax.print.attribute.standard} contains standard printing
+ * attributes and standard printing attribute values that are widely used in the
+ * printing domain. A print service vendor can provide new vendor-specific
+ * printing attributes in addition to the standard ones. A vendor can also
+ * provide vendor-specific extensions (subclasses) of the standard printing
+ * attributes -- for example, to provide additional vendor-specific values for
+ * an existing standard attribute. Of course, if a vendor wants clients to be
+ * able to use any added or extended attributes, the vendor must publish the new
+ * attribute classes.
* <p>
* Many of the standard attribute classes extend one of the abstract syntax
- * classes of the javax.print.attribute package. These abstract syntax classes
- * each represent a different type. The <a href="../EnumSyntax.html">
+ * classes of the {@code javax.print.attribute} package. These abstract syntax
+ * classes each represent a different type. The <a href="../EnumSyntax.html">
* EnumSyntax</a> class, for example, represents a type-safe enumeration. The
* abstract syntax class provides a wrapper for the attribute value.
* <p>
@@ -73,9 +73,9 @@
* attribute classes in package javax.print.attribute.standard, just the ones
* that pertain to the application.
* <p>
- * The attribute classes in package javax.print.attribute.standard are based on
- * the Internet Printing Protocol (IPP) attributes as defined in the Internet
- * RFC document, <i>RFC 2911 Internet Printing Protocol/1.1: Model and
+ * The attribute classes in package {@code javax.print.attribute.standard} are
+ * based on the Internet Printing Protocol (IPP) attributes as defined in the
+ * Internet RFC document, <i>RFC 2911 Internet Printing Protocol/1.1: Model and
* Semantics</i> dated September 2000. See
* <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> for more
* information. The descriptive text for each attribute class was taken largely
@@ -152,485 +152,418 @@
* indicates the supported values for that attribute category.
* <table border=1 cellpadding=2 cellspacing=1 summary="Lists all printing
* attributes as described in above text">
- * <tr style="background-color:#E5E5E5">
- * <th valign="bottom">Attribute Class</th>
- * <th valign="bottom">Doc<br>Attribute</th>
- * <th valign="bottom">Print<br>Request<br>Attribute</th>
- * <th valign="bottom">Print<br>Job<br>Attribute</th>
- * <th valign="bottom">Print<br>Service<br>Attribute</th>
- * <th valign="bottom">SupportedValuesAttribute</th>
- * </tr>
- * <tr>
- * <td><a href="Compression.html">Compression</a></td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="DocumentName.html">DocumentName</a></td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="Chromaticity.html">Chromaticity</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="Copies.html">Copies</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="CopiesSupported.html">CopiesSupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="Finishings.html">Finishings</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobHoldUntil.html">JobHoldUntil</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobImpressions.html">JobImpressions</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="JobImpressionsSupported.html">
- * JobImpressionsSupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="JobKOctets.html">JobKOctets</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="JobKOctetsSupported.html">JobKOctetsSupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="JobMediaSheets.html">JobMediaSheets</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="JobMediaSheetsSupported.html">
- * JobMediaSheetsSupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="JobName.html">JobName</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobPriority.html">JobPriority</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="JobPrioritySupported.html">JobPrioritySupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="JobSheets.html">JobSheets</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="Media.html">Media</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="MediaSize.html">MediaSize</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="MultipleDocumentHandling.html">
- * MultipleDocumentHandling</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="NumberUp.html">NumberUp</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td><a href="NumberUpSupported.html">NumberUpSupported</a></td>
- * </tr>
- * <tr>
- * <td><a href="OrientationRequested.html">OrientationRequested</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PageRanges.html">PageRanges</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PresentationDirection.html">
- * PresentationDirection</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterResolution.html">PrinterResolution</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrintQuality.html">PrintQuality</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="RequestingUserName.html">RequestingUserName</a></td>
- * <td> </td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="SheetCollate.html">SheetCollate</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="Sides.html">Sides</a></td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="DateTimeAtCompleted.html">DateTimeAtCompleted</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="DateTimeAtCreation.html">DateTimeAtCreation</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="DateTimeAtProcessing.html">DateTimeAtProcessing</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobImpressionsCompleted.html">
- * JobImpressionsCompleted</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobKOctetsProcessed.html">JobKOctetsProcessed</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobMediaSheetsCompleted.html">
- * JobMediaSheetsCompleted</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobMessageFromOperator.html">
- * JobMessageFromOperator</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobOriginatingUserName.html">
- * JobOriginatingUserName</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobState.html">JobState</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="JobStateReasons.html">JobStateReasons</a><br>
- * Contains zero or more --</td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td>-- <a href="JobStateReason.html">JobStateReason</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="NumberOfDocuments.html">NumberOfDocuments</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="NumberOfInterveningJobs.html">
- * NumberOfInterveningJobs</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="OutputDeviceAssigned.html">OutputDeviceAssigned</a></td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="ColorSupported.html">ColorSupported</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PagesPerMinute.html">PagesPerMinute</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PagesPerMinuteColor.html">PagesPerMinuteColor</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PDLOverrideSupported.html">PDLOverrideSupported</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterIsAcceptingJobs.html">
- * PrinterIsAcceptingJobs</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterInfo.html">PrinterInfo</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterLocation.html">PrinterLocation</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterMessageFromOperator.html">
- * PrinterMessageFromOperator</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterMakeAndModel.html">PrinterMakeAndModel</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterMoreInfo.html">PrinterMoreInfo</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterMoreInfoManufacturer.html">
- * PrinterMoreInfoManufacturer</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterName.html">PrinterName</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterState.html">PrinterState</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="PrinterStateReasons.html">PrinterStateReasons</a><br>
- * Contains zero or more --</td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td>-- <a href="PrinterStateReason.html">PrinterStateReason</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td>-- <a href="Severity.html">Severity</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="QueuedJobCount.html">QueuedJobCount</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td align="center">X</td>
- * <td> </td>
- * </tr>
- * <tr>
- * <td><a href="ReferenceUriSchemesSupported.html">
- * ReferenceUriSchemesSupported</a></td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * <td> </td>
- * </tr>
+ * <tr style="background-color:#E5E5E5">
+ * <th valign="bottom">Attribute Class
+ * <th valign="bottom">Doc<br>Attribute
+ * <th valign="bottom">Print<br>Request<br>Attribute
+ * <th valign="bottom">Print<br>Job<br>Attribute
+ * <th valign="bottom">Print<br>Service<br>Attribute
+ * <th valign="bottom">SupportedValuesAttribute
+ * <tr>
+ * <td><a href="Compression.html">Compression</a>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="DocumentName.html">DocumentName</a>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="Chromaticity.html">Chromaticity</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="Copies.html">Copies</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="CopiesSupported.html">CopiesSupported</a>
+ * <tr>
+ * <td><a href="Finishings.html">Finishings</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobHoldUntil.html">JobHoldUntil</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobImpressions.html">JobImpressions</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="JobImpressionsSupported.html">JobImpressionsSupported</a>
+ * <tr>
+ * <td><a href="JobKOctets.html">JobKOctets</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="JobKOctetsSupported.html">JobKOctetsSupported</a>
+ * <tr>
+ * <td><a href="JobMediaSheets.html">JobMediaSheets</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="JobMediaSheetsSupported.html">JobMediaSheetsSupported</a>
+ * <tr>
+ * <td><a href="JobName.html">JobName</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobPriority.html">JobPriority</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="JobPrioritySupported.html">JobPrioritySupported</a>
+ * <tr>
+ * <td><a href="JobSheets.html">JobSheets</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="Media.html">Media</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="MediaSize.html">MediaSize</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="MultipleDocumentHandling.html">MultipleDocumentHandling</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="NumberUp.html">NumberUp</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td><a href="NumberUpSupported.html">NumberUpSupported</a>
+ * <tr>
+ * <td><a href="OrientationRequested.html">OrientationRequested</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="PageRanges.html">PageRanges</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="PresentationDirection.html">PresentationDirection</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="PrinterResolution.html">PrinterResolution</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="PrintQuality.html">PrintQuality</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="RequestingUserName.html">RequestingUserName</a>
+ * <td>
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="SheetCollate.html">SheetCollate</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="Sides.html">Sides</a>
+ * <td align="center">X
+ * <td align="center">X
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="DateTimeAtCompleted.html">DateTimeAtCompleted</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="DateTimeAtCreation.html">DateTimeAtCreation</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="DateTimeAtProcessing.html">DateTimeAtProcessing</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobImpressionsCompleted.html">JobImpressionsCompleted</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobKOctetsProcessed.html">JobKOctetsProcessed</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobMediaSheetsCompleted.html">JobMediaSheetsCompleted</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobMessageFromOperator.html">JobMessageFromOperator</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobOriginatingUserName.html">JobOriginatingUserName</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobState.html">JobState</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="JobStateReasons.html">JobStateReasons</a><br>
+ * Contains zero or more --
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td>-- <a href="JobStateReason.html">JobStateReason</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="NumberOfDocuments.html">NumberOfDocuments</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="NumberOfInterveningJobs.html">NumberOfInterveningJobs</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="OutputDeviceAssigned.html">OutputDeviceAssigned</a>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="ColorSupported.html">ColorSupported</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PagesPerMinute.html">PagesPerMinute</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PagesPerMinuteColor.html">PagesPerMinuteColor</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PDLOverrideSupported.html">PDLOverrideSupported</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterIsAcceptingJobs.html">PrinterIsAcceptingJobs</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterInfo.html">PrinterInfo</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterLocation.html">PrinterLocation</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterMessageFromOperator.html">
+ * PrinterMessageFromOperator</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterMakeAndModel.html">PrinterMakeAndModel</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterMoreInfo.html">PrinterMoreInfo</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterMoreInfoManufacturer.html">
+ * PrinterMoreInfoManufacturer</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterName.html">PrinterName</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterState.html">PrinterState</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="PrinterStateReasons.html">PrinterStateReasons</a><br>
+ * Contains zero or more --
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td>-- <a href="PrinterStateReason.html">PrinterStateReason</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td>-- <a href="Severity.html">Severity</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <tr>
+ * <td><a href="QueuedJobCount.html">QueuedJobCount</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td align="center">X
+ * <td>
+ * <tr>
+ * <td><a href="ReferenceUriSchemesSupported.html">
+ * ReferenceUriSchemesSupported</a>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
+ * <td>
* </table>
* <p>
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,29 +26,31 @@
package javax.print.event;
/**
- *
- * Class PrintEvent is the super class of all Print Service API events.
+ * Class {@code PrintEvent} is the super class of all Print Service API events.
*/
-
public class PrintEvent extends java.util.EventObject {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2286914924430763847L;
/**
- * Constructs a PrintEvent object.
- * @param source is the source of the event
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * Constructs a {@code PrintEvent} object.
+ *
+ * @param source is the source of the event
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintEvent (Object source) {
super(source);
}
/**
+ * Returns a string representation of this {@code PrintEvent}.
+ *
* @return a message describing the event
*/
public String toString() {
return ("PrintEvent on " + getSource().toString());
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAdapter.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAdapter.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,27 +26,23 @@
package javax.print.event;
/**
- * An abstract adapter class for receiving print job events.
- * The methods in this class are empty.
- * This class exists as a convenience for creating listener objects.
- * Extend this class to create a {@link PrintJobEvent} listener and override
- * the methods for the events of interest. Unlike the
- * {@link java.awt.event.ComponentListener ComponentListener}
- * interface, this abstract interface provides null methods so that you
- * only need to define the methods you need, rather than all of the methods.
- *
- */
-
+ * An abstract adapter class for receiving print job events. The methods in this
+ * class are empty. This class exists as a convenience for creating listener
+ * objects. Extend this class to create a {@link PrintJobEvent} listener and
+ * override the methods for the events of interest. Unlike the
+ * {@link java.awt.event.ComponentListener ComponentListener} interface, this
+ * abstract interface provides empty methods so that you only need to define the
+ * methods you need, rather than all of the methods.
+ */
public abstract class PrintJobAdapter implements PrintJobListener {
/**
- * Called to notify the client that data has been successfully
- * transferred to the print service, and the client may free
- * local resources allocated for that data. The client should
- * not assume that the data has been completely printed after
- * receiving this event.
+ * Called to notify the client that data has been successfully transferred
+ * to the print service, and the client may free local resources allocated
+ * for that data. The client should not assume that the data has been
+ * completely printed after receiving this event.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printDataTransferCompleted(PrintJobEvent pje) {
}
@@ -54,52 +50,46 @@
/**
* Called to notify the client that the job completed successfully.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobCompleted(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that the job failed to complete
- * successfully and will have to be resubmitted.
+ * Called to notify the client that the job failed to complete successfully
+ * and will have to be resubmitted.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobFailed(PrintJobEvent pje) {
}
/**
- * Called to notify the client that the job was canceled
- * by user or program.
+ * Called to notify the client that the job was canceled by user or program.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobCanceled(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that no more events will be delivered.
- * One cause of this event being generated is if the job
- * has successfully completed, but the printing system
- * is limited in capability and cannot verify this.
- * This event is required to be delivered if none of the other
+ * Called to notify the client that no more events will be delivered. One
+ * cause of this event being generated is if the job has successfully
+ * completed, but the printing system is limited in capability and cannot
+ * verify this. This event is required to be delivered if none of the other
* terminal events (completed/failed/canceled) are delivered.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobNoMoreEvents(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that some possibly user rectifiable
- * problem occurs (eg printer out of paper).
+ * Called to notify the client that some possibly user rectifiable problem
+ * occurs (eg printer out of paper).
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobRequiresAttention(PrintJobEvent pje) {
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,23 +30,28 @@
import javax.print.attribute.PrintJobAttributeSet;
/**
- * Class PrintJobAttributeEvent encapsulates an event a PrintService
- * reports to let the client know that one or more printing attributes for a
- * PrintJob have changed.
+ * Class {@code PrintJobAttributeEvent} encapsulates an event a
+ * {@code PrintService} reports to let the client know that one or more printing
+ * attributes for a {@code PrintJob} have changed.
*/
-
public class PrintJobAttributeEvent extends PrintEvent {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6534469883874742101L;
+ /**
+ * The printing service attributes that changed.
+ */
private PrintJobAttributeSet attributes;
/**
- * Constructs a PrintJobAttributeEvent object.
- * @param source the print job generating this event
- * @param attributes the attribute changes being reported
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * Constructs a {@code PrintJobAttributeEvent} object.
+ *
+ * @param source the print job generating this event
+ * @param attributes the attribute changes being reported
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintJobAttributeEvent (DocPrintJob source,
PrintJobAttributeSet attributes) {
@@ -55,28 +60,24 @@
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
}
-
/**
- * Determine the Print Job to which this print job event pertains.
+ * Determine the {@code PrintJob} to which this print job event pertains.
*
- * @return Print Job object.
+ * @return {@code PrintJob} object
*/
public DocPrintJob getPrintJob() {
return (DocPrintJob) getSource();
}
-
/**
* Determine the printing attributes that changed and their new values.
*
- * @return Attributes containing the new values for the print job
- * attributes that changed. The returned set may not be modifiable.
+ * @return attributes containing the new values for the print job attributes
+ * that changed. The returned set may not be modifiable.
*/
public PrintJobAttributeSet getAttributes() {
return attributes;
-
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,21 +26,19 @@
package javax.print.event;
/**
- * Implementations of this interface are attached to a
- * {@link javax.print.DocPrintJob DocPrintJob} to monitor
- * the status of attribute changes associated with the print job.
- *
- */
+ * Implementations of this interface are attached to a
+ * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
+ * attribute changes associated with the print job.
+ */
public interface PrintJobAttributeListener {
/**
- * Notifies the listener of a change in some print job attributes.
- * One example of an occurrence triggering this event is if the
- * {@link javax.print.attribute.standard.JobState JobState}
- * attribute changed from
- * {@code PROCESSING} to {@code PROCESSING_STOPPED}.
- * @param pjae the event.
+ * Notifies the listener of a change in some print job attributes. One
+ * example of an occurrence triggering this event is if the
+ * {@link javax.print.attribute.standard.JobState JobState} attribute
+ * changed from {@code PROCESSING} to {@code PROCESSING_STOPPED}.
+ *
+ * @param pjae the event being notified
*/
public void attributeUpdate(PrintJobAttributeEvent pjae) ;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,98 +28,95 @@
import javax.print.DocPrintJob;
/**
- *
- * Class {@code PrintJobEvent} encapsulates common events a print job
- * reports to let a listener know of progress in the processing of the
- * {@link DocPrintJob}.
- *
+ * Class {@code PrintJobEvent} encapsulates common events a print job reports to
+ * let a listener know of progress in the processing of the {@link DocPrintJob}.
*/
-
public class PrintJobEvent extends PrintEvent {
- private static final long serialVersionUID = -1711656903622072997L;
-
- private int reason;
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
+ private static final long serialVersionUID = -1711656903622072997L;
- /**
- * The job was canceled by the {@link javax.print.PrintService PrintService}.
- */
- public static final int JOB_CANCELED = 101;
+ /**
+ * The reason of this event.
+ */
+ private int reason;
- /**
- * The document cis completely printed.
- */
- public static final int JOB_COMPLETE = 102;
+ /**
+ * The job was canceled by the
+ * {@link javax.print.PrintService PrintService}.
+ */
+ public static final int JOB_CANCELED = 101;
- /**
- * The print service reports that the job cannot be completed.
- * The application must resubmit the job.
- */
+ /**
+ * The document is completely printed.
+ */
+ public static final int JOB_COMPLETE = 102;
- public static final int JOB_FAILED = 103;
+ /**
+ * The print service reports that the job cannot be completed. The
+ * application must resubmit the job.
+ */
+ public static final int JOB_FAILED = 103;
- /**
- * The print service indicates that a - possibly transient - problem
- * may require external intervention before the print service can
- * continue. One example of an event that can
- * generate this message is when the printer runs out of paper.
- */
- public static final int REQUIRES_ATTENTION = 104;
+ /**
+ * The print service indicates that a - possibly transient - problem may
+ * require external intervention before the print service can continue. One
+ * example of an event that can generate this message is when the printer
+ * runs out of paper.
+ */
+ public static final int REQUIRES_ATTENTION = 104;
- /**
- * Not all print services may be capable of delivering interesting
- * events, or even telling when a job is complete. This message indicates
- * the print job has no further information or communication
- * with the print service. This message should always be delivered
- * if a terminal event (completed/failed/canceled) is not delivered.
- * For example, if messages such as JOB_COMPLETE have NOT been received
- * before receiving this message, the only inference that should be drawn
- * is that the print service does not support delivering such an event.
- */
- public static final int NO_MORE_EVENTS = 105;
+ /**
+ * Not all print services may be capable of delivering interesting events,
+ * or even telling when a job is complete. This message indicates the print
+ * job has no further information or communication with the print service.
+ * This message should always be delivered if a terminal event
+ * (completed/failed/canceled) is not delivered. For example, if messages
+ * such as {@code JOB_COMPLETE} have NOT been received before receiving this
+ * message, the only inference that should be drawn is that the print
+ * service does not support delivering such an event.
+ */
+ public static final int NO_MORE_EVENTS = 105;
- /**
- * The job is not necessarily printed yet, but the data has been transferred
- * successfully from the client to the print service. The client may
- * free data resources.
- */
- public static final int DATA_TRANSFER_COMPLETE = 106;
+ /**
+ * The job is not necessarily printed yet, but the data has been transferred
+ * successfully from the client to the print service. The client may free
+ * data resources.
+ */
+ public static final int DATA_TRANSFER_COMPLETE = 106;
- /**
+ /**
* Constructs a {@code PrintJobEvent} object.
*
- * @param source a {@code DocPrintJob} object
- * @param reason an int specifying the reason.
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * @param source a {@code DocPrintJob} object
+ * @param reason an int specifying the reason
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
-
public PrintJobEvent( DocPrintJob source, int reason) {
super(source);
this.reason = reason;
- }
+ }
/**
* Gets the reason for this event.
- * @return reason int.
+ *
+ * @return reason int
*/
public int getPrintEventType() {
return reason;
}
/**
- * Determines the {@code DocPrintJob} to which this print job
- * event pertains.
+ * Determines the {@code DocPrintJob} to which this print job event
+ * pertains.
*
- * @return the {@code DocPrintJob} object that represents the
- * print job that reports the events encapsulated by this
- * {@code PrintJobEvent}.
- *
+ * @return the {@code DocPrintJob} object that represents the print job that
+ * reports the events encapsulated by this {@code PrintJobEvent}
*/
public DocPrintJob getPrintJob() {
return (DocPrintJob) getSource();
}
-
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobListener.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobListener.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,70 +26,66 @@
package javax.print.event;
/**
- * Implementations of this listener interface should be attached to a
- * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
- * the printer job.
- * These callback methods may be invoked on the thread processing the
- * print job, or a service created notification thread. In either case
- * the client should not perform lengthy processing in these callbacks.
- */
-
+ * Implementations of this listener interface should be attached to a
+ * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of the
+ * printer job. These callback methods may be invoked on the thread processing
+ * the print job, or a service created notification thread. In either case the
+ * client should not perform lengthy processing in these callbacks.
+ */
public interface PrintJobListener {
/**
- * Called to notify the client that data has been successfully
- * transferred to the print service, and the client may free
- * local resources allocated for that data. The client should
- * not assume that the data has been completely printed after
- * receiving this event.
- * If this event is not received the client should wait for a terminal
- * event (completed/canceled/failed) before freeing the resources.
- * @param pje the job generating this event
+ * Called to notify the client that data has been successfully transferred
+ * to the print service, and the client may free local resources allocated
+ * for that data. The client should not assume that the data has been
+ * completely printed after receiving this event. If this event is not
+ * received the client should wait for a terminal event
+ * (completed/canceled/failed) before freeing the resources.
+ *
+ * @param pje the job generating this event
*/
public void printDataTransferCompleted(PrintJobEvent pje) ;
-
/**
* Called to notify the client that the job completed successfully.
- * @param pje the job generating this event
+ *
+ * @param pje the job generating this event
*/
public void printJobCompleted(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that the job failed to complete
- * successfully and will have to be resubmitted.
- * @param pje the job generating this event
+ * Called to notify the client that the job failed to complete successfully
+ * and will have to be resubmitted.
+ *
+ * @param pje the job generating this event
*/
public void printJobFailed(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that the job was canceled
- * by a user or a program.
- * @param pje the job generating this event
+ * Called to notify the client that the job was canceled by a user or a
+ * program.
+ *
+ * @param pje the job generating this event
*/
public void printJobCanceled(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that no more events will be delivered.
- * One cause of this event being generated is if the job
- * has successfully completed, but the printing system
- * is limited in capability and cannot verify this.
- * This event is required to be delivered if none of the other
+ * Called to notify the client that no more events will be delivered. One
+ * cause of this event being generated is if the job has successfully
+ * completed, but the printing system is limited in capability and cannot
+ * verify this. This event is required to be delivered if none of the other
* terminal events (completed/failed/canceled) are delivered.
- * @param pje the job generating this event
+ *
+ * @param pje the job generating this event
*/
public void printJobNoMoreEvents(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that an error has occurred that the
- * user might be able to fix. One example of an error that can
- * generate this event is when the printer runs out of paper.
- * @param pje the job generating this event
+ * Called to notify the client that an error has occurred that the user
+ * might be able to fix. One example of an error that can generate this
+ * event is when the printer runs out of paper.
+ *
+ * @param pje the job generating this event
*/
public void printJobRequiresAttention(PrintJobEvent pje) ;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,25 +30,28 @@
import javax.print.attribute.PrintServiceAttributeSet;
/**
- *
- * Class PrintServiceAttributeEvent encapsulates an event a
- * Print Service instance reports to let the client know of
- * changes in the print service state.
+ * Class {@code PrintServiceAttributeEvent} encapsulates an event a Print
+ * Service instance reports to let the client know of changes in the print
+ * service state.
*/
-
public class PrintServiceAttributeEvent extends PrintEvent {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7565987018140326600L;
+ /**
+ * The printing service attributes that changed.
+ */
private PrintServiceAttributeSet attributes;
/**
- * Constructs a PrintServiceAttributeEvent object.
+ * Constructs a {@code PrintServiceAttributeEvent} object.
*
- * @param source the print job generating this event
- * @param attributes the attribute changes being reported
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * @param source the print job generating this event
+ * @param attributes the attribute changes being reported
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintServiceAttributeEvent(PrintService source,
PrintServiceAttributeSet attributes) {
@@ -57,28 +60,25 @@
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
}
-
/**
* Returns the print service.
-
- * @return Print Service object.
+ *
+ * @return {@code PrintService} object
*/
public PrintService getPrintService() {
return (PrintService) getSource();
}
-
/**
* Determine the printing service attributes that changed and their new
* values.
*
- * @return Attributes containing the new values for the service
- * attributes that changed. The returned set may be unmodifiable.
+ * @return attributes containing the new values for the service attributes
+ * that changed. The returned set may be unmodifiable.
*/
public PrintServiceAttributeSet getAttributes() {
return attributes;
}
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeListener.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeListener.java Thu Aug 31 15:47:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,23 +26,22 @@
package javax.print.event;
/**
- * Implementations of this listener interface are attached to a
- * {@link javax.print.PrintService PrintService} to monitor
- * the status of the print service.
- * <p>
- * To monitor a particular job see {@link PrintJobListener} and
- * {@link PrintJobAttributeListener}.
- */
-
+ * Implementations of this listener interface are attached to a
+ * {@link javax.print.PrintService PrintService} to monitor the status of the
+ * print service.
+ * <p>
+ * To monitor a particular job see {@link PrintJobListener} and
+ * {@link PrintJobAttributeListener}.
+ */
public interface PrintServiceAttributeListener {
/**
- * Called to notify a listener of an event in the print service.
- * The service will call this method on an event notification thread.
- * The client should not perform lengthy processing in this callback
- * or subsequent event notifications may be blocked.
- * @param psae the event being notified
+ * Called to notify a listener of an event in the print service. The service
+ * will call this method on an event notification thread. The client should
+ * not perform lengthy processing in this callback or subsequent event
+ * notifications may be blocked.
+ *
+ * @param psae the event being notified
*/
public void attributeUpdate(PrintServiceAttributeEvent psae) ;
-
}
--- a/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java Thu Aug 31 15:47:34 2017 -0700
@@ -24,17 +24,18 @@
*/
/**
- * Package javax.print.event contains event classes and listener interfaces.
+ * Package {@code javax.print.event} contains event classes and listener
+ * interfaces.
* <p>
* They may be used to monitor both print services (such as printers going
* on-line & off-line), and the progress of a specific print job.
* <p>
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
--- a/jdk/src/java.desktop/share/classes/javax/print/package-info.java Thu Aug 31 13:00:23 2017 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/print/package-info.java Thu Aug 31 15:47:34 2017 -0700
@@ -28,10 +28,10 @@
* Service API. The Java Print Service API enables client and server
* applications to:
* <ul>
- * <li>Discover and select print services based on their capabilities</li>
- * <li>Specify the format of print data</li>
- * <li>Submit print jobs to services that support the document type to be
- * printed.</li>
+ * <li>Discover and select print services based on their capabilities
+ * <li>Specify the format of print data
+ * <li>Submit print jobs to services that support the document type to be
+ * printed.
* </ul>
*
* <h3>Print Service Discovery</h3>
@@ -51,15 +51,15 @@
* <h3>Attribute Definitions</h3>
* The {@link javax.print.attribute} and {@link javax.print.attribute.standard}
* packages define print attributes, which describe the capabilities of a print
- * service, specify the requirements of a print job, and track the progress of
- * a print job.
+ * service, specify the requirements of a print job, and track the progress of a
+ * print job.
* <p>
* The {@code javax.print.attribute} package describes the types of attributes
* and how they can be collected into sets. The
* {@code javax.print.attribute.standard} package enumerates all of the standard
* attributes supported by the API, most of which are implementations of
* attributes specified in the IETF Specification,
- * <a href="http://www.ietf.org/rfc/rfc2911.txt"> RFC 2911 Internet Printing
+ * <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911 Internet Printing
* Protocol, 1.1: Model and Semantics</a>, dated September 2000. The attributes
* specified in {@code javax.print.attribute.standard} include common
* capabilities, such as: resolution, copies, media sizes, job priority, and
@@ -78,16 +78,16 @@
* A typical application using the Java Print Service API performs these steps
* to process a print request:
* <ol>
- * <li>Chooses a {@code DocFlavor}.</li>
- * <li>Creates a set of attributes.</li>
- * <li>Locates a print service that can handle the print request as
- * specified by the {@code DocFlavor} and the attribute set.</li>
- * <li>Creates a {@link javax.print.Doc Doc} object encapsulating the
- * {@code DocFlavor} and the actual print data, which can take many forms
- * including: a Postscript file, a JPEG image, a URL, or plain text.</li>
- * <li>Gets a print job, represented by
- * {@link javax.print.DocPrintJob DocPrintJob}, from the print service.</li>
- * <li>Calls the print method of the print job.</li>
+ * <li>Chooses a {@code DocFlavor}.
+ * <li>Creates a set of attributes.
+ * <li>Locates a print service that can handle the print request as specified
+ * by the {@code DocFlavor} and the attribute set.
+ * <li>Creates a {@link javax.print.Doc Doc} object encapsulating the
+ * {@code DocFlavor} and the actual print data, which can take many forms
+ * including: a Postscript file, a JPEG image, a {@code URL}, or plain text.
+ * <li>Gets a print job, represented by
+ * {@link javax.print.DocPrintJob DocPrintJob}, from the print service.
+ * <li>Calls the print method of the print job.
* </ol>
* The following code sample demonstrates a typical use of the Java Print
* Service API: locating printers that can print five double-sided copies of a
@@ -119,13 +119,13 @@
* }
* }</pre>
* </blockquote>
- * <P>
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * <p>
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/