MultiDoc.java 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* MultiDoc.java --
  2. Copyright (C) 2004, 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package javax.print;
  32. import java.io.IOException;
  33. /**
  34. * <code>MultiDoc</code> defines the interface for objects providing multiple
  35. * documents for use in a print job.
  36. * <p>
  37. * Implementations of this interface are used to pass multiple documents, to be
  38. * printed as one print job, to the <code>MultiDocPrintJob</code> instance.
  39. * </p><p>
  40. * There exists no implementation of this interface in the Java Print Service
  41. * API. Implementors may assume the following usage in print jobs and the needed
  42. * behaviour for implementations: The print job fetches the single documents via
  43. * iteration by consecutive calls of the {@link #getDoc()} method to obtain the
  44. * current document follwing calls of the {@link #next()} method to get the next
  45. * multidoc object for the next <code>getDoc()</code> method call (if returned
  46. * multidoc object is not <code>null</code>). The print service will fetch the
  47. * document object and then retrieve the print data from the document before it
  48. * proceeds with the next call for the next MultiDoc object in the sequence.
  49. * </p><p>
  50. * Implementations of this interface have to be multiple thread-safe.
  51. * </p>
  52. *
  53. * @author Michael Koch (konqueror@gmx.de)
  54. */
  55. public interface MultiDoc
  56. {
  57. /**
  58. * Returns the current document.
  59. *
  60. * @return The current document.
  61. *
  62. * @throws IOException if an error occurs
  63. */
  64. Doc getDoc() throws IOException;
  65. /**
  66. * Returns the next <code>MultiDoc</code> object that contains the
  67. * next document for retrieval.
  68. *
  69. * @return The next <code>MultiDoc</code> object, or <code>null</code>
  70. * if no more documents are available.
  71. *
  72. * @throws IOException if an error occurs
  73. */
  74. MultiDoc next() throws IOException;
  75. }