diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
| commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
| tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/javax/print/attribute/standard/JobStateReasons.java | |
| parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
| download | ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.zip | |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 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 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java index 32f942b6bd7..997dcbc3779 100644 --- a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java +++ b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java @@ -42,6 +42,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.Iterator; +import javax.print.attribute.Attribute; import javax.print.attribute.PrintJobAttribute; /** @@ -56,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute; * @author Michael Koch (konqueror@gmx.de) * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobStateReasons extends HashSet +public final class JobStateReasons extends HashSet<JobStateReason> implements PrintJobAttribute { private static final long serialVersionUID = 8849088261264331812L; @@ -108,12 +109,11 @@ public final class JobStateReasons extends HashSet * @throws ClassCastException if values of collection are not of type * <code>JobStateReason</code>. */ - public JobStateReasons(Collection collection) + public JobStateReasons(Collection<JobStateReason> collection) { super(collection.size(), 0.75f); - Iterator it = collection.iterator(); - while (it.hasNext()) - add(it.next()); + for (JobStateReason reason : collection) + add(reason); } /** @@ -126,12 +126,12 @@ public final class JobStateReasons extends HashSet * @throws ClassCastException if given object is not an instance of * <code>JobStateReason</code>. */ - public boolean add(Object o) + public boolean add(JobStateReason o) { if (o == null) throw new NullPointerException("reason is null"); - return super.add((JobStateReason) o); + return add(o); } /** @@ -139,7 +139,7 @@ public final class JobStateReasons extends HashSet * * @return The class <code>JobStateReasons</code> itself. */ - public Class getCategory() + public Class< ? extends Attribute> getCategory() { return JobStateReasons.class; } |

