javax.print

Interface MultiDoc

public interface MultiDoc

MultiDoc defines the interface for objects providing multiple documents for use in a print job.

Implementations of this interface are used to pass multiple documents, to be printed as one print job, to the MultiDocPrintJob instance.

There exists no implementation of this interface in the Java Print Service API. Implementors may assume the following usage in print jobs and the needed behaviour for implementations: The print job fetches the single documents via iteration by consecutive calls of the {@link #getDoc()} method to obtain the current document follwing calls of the {@link #next()} method to get the next multidoc object for the next getDoc() method call (if returned multidoc object is not null). The print service will fetch the document object and then retrieve the print data from the document before it proceeds with the next call for the next MultiDoc object in the sequence.

Implementations of this interface have to be multiple thread-safe.

Method Summary
DocgetDoc()
Returns the current document.
MultiDocnext()
Returns the next MultiDoc object that contains the next document for retrieval.

Method Detail

getDoc

public Doc getDoc()
Returns the current document.

Returns: The current document.

Throws: IOException if an error occurs

next

public MultiDoc next()
Returns the next MultiDoc object that contains the next document for retrieval.

Returns: The next MultiDoc object, or null if no more documents are available.

Throws: IOException if an error occurs