diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
| commit | 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede (patch) | |
| tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/javax/print/attribute/standard/JobStateReasons.java | |
| parent | a3ef37ddfeddcc5b0f1c5068d8fdeb25a302d5cd (diff) | |
| download | ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.tar.gz ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.zip | |
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/print/attribute/standard/JobStateReasons.java')
| -rw-r--r-- | libjava/classpath/javax/print/attribute/standard/JobStateReasons.java | 90 |
1 files changed, 87 insertions, 3 deletions
diff --git a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java index 39187373ded..9dbca0cd57b 100644 --- a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java +++ b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java @@ -1,5 +1,5 @@ /* JobStateReasons.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,12 +38,23 @@ exception statement from your version. */ package javax.print.attribute.standard; +import java.util.Collection; import java.util.HashSet; +import java.util.Iterator; import javax.print.attribute.PrintJobAttribute; /** + * The <code>JobStateReasons</code> attribute provides the set of + * additional informations available about the current state of a print job. + * <p> + * <b>IPP Compatibility:</b> JobStateReasons is an IPP 1.1 attribute. + * </p> + * @see javax.print.attribute.standard.JobState + * @see javax.print.attribute.standard.JobStateReason + * * @author Michael Koch (konqueror@gmx.de) + * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobStateReasons extends HashSet implements PrintJobAttribute @@ -51,9 +62,82 @@ public final class JobStateReasons extends HashSet private static final long serialVersionUID = 8849088261264331812L; /** + * Constructs an empty <code>JobStateReasons</code> attribute. + */ + public JobStateReasons() + { + super(); + } + + /** + * Constructs an empty <code>JobStateReasons</code> attribute + * with the given initial capacity and load factor. + * + * @param initialCapacity the intial capacity. + * @param loadFactor the load factor of the underlying HashSet. + * + * @throws IllegalArgumentException if initialCapacity < 0 + * @throws IllegalArgumentException if initialCapacity or loadFactor < 0 + */ + public JobStateReasons(int initialCapacity, float loadFactor) + { + super(initialCapacity, loadFactor); + } + + /** + * Constructs an empty <code>JobStateReasons</code> attribute + * with the given initial capacity and the default load factor. + * + * @param initialCapacity the intial capacity. + * + * @throws IllegalArgumentException if initialCapacity < 0 + */ + public JobStateReasons(int initialCapacity) + { + super(initialCapacity); + } + + /** + * Constructs a <code>JobStateReasons</code> attribute + * with the content of the given collection. + * + * @param collection the collection for the initial values. + * + * @throws NullPointerException if collection or any value is + * <code>null</code>. + * @throws ClassCastException if values of collection are not of type + * <code>JobStateReason</code>. + */ + public JobStateReasons(Collection collection) + { + super(collection.size(), 0.75f); + Iterator it = collection.iterator(); + while (it.hasNext()) + add(it.next()); + } + + /** + * Adds the given job state reason object to the set. + * + * @param o the reason of type <code>JobStateReason</code>. + * @return <code>true</code> if set changed, <code>false</code> otherwise. + * + * @throws NullPointerException if given object is <code>null</code>. + * @throws ClassCastException if given object is not an instance of + * <code>JobStateReason</code>. + */ + public boolean add(Object o) + { + if (o == null) + throw new NullPointerException("reason is null"); + + return add((JobStateReason) o); + } + + /** * Returns category of this class. * - * @return the class <code>ColorSupported</code> itself + * @return The class <code>JobStateReasons</code> itself. */ public Class getCategory() { @@ -63,7 +147,7 @@ public final class JobStateReasons extends HashSet /** * Returns the name of this attribute. * - * @return the name + * @return The name "job-state-reasons". */ public String getName() { |

