public interface MultiDoc
 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
 current doc in the list and a pointer to the next node (multidoc) in the
 list. The Print Job can call the multidoc's getDoc()next()
 void processMultiDoc(MultiDoc theMultiDoc) {
 MultiDoc current = theMultiDoc;
 while (current != null) {
 processDoc (current.getDoc());
 current = current.next();
 }
 }
 
 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.
To get all the print data for a multidoc print job, a Print Service proxy could use either of two patterns:
 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 getDoc()next()
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
Doc getDoc() throws IOException
IOException  - Thrown if a error ocurred reading the document.MultiDoc next() throws IOException
IOException  - Thrown if an error occurred locating the next document Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy. 
Scripting on this page tracks web page traffic, but does not change the content in any way.