summaryrefslogtreecommitdiff
path: root/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java')
-rw-r--r--gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java54
1 files changed, 26 insertions, 28 deletions
diff --git a/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java b/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
index 4051e2420..8f6f21c58 100644
--- a/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
+++ b/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
@@ -1,4 +1,4 @@
-/* JobSheetsSupported.java --
+/* JobSheetsSupported.java --
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,26 +53,26 @@ import javax.print.attribute.standard.JobSheets;
/**
* JobSheetsSupported attribute provides the supported values
* of the job-sheets attribute.
- *
+ *
* @author Wolfgang Baer (WBaer@gmx.de)
*/
-public final class JobSheetsSupported extends TextSyntax
+public final class JobSheetsSupported extends TextSyntax
implements SupportedValuesAttribute
{
- //a keyword/name based attribute in IPP
+ //a keyword/name based attribute in IPP
// can be extended by administrators
// standard values are predefined
-
+
/** No job sheet is the default */
- public static final JobSheetsDefault NONE =
+ public static final JobSheetsDefault NONE =
new JobSheetsDefault("none", Locale.getDefault());
-
+
/** A job sheet is the default */
- public static final JobSheetsDefault STANDARD =
+ public static final JobSheetsDefault STANDARD =
new JobSheetsDefault("standard", Locale.getDefault());
-
+
/**
- * Creates a <code>JobSheetsSupported</code> object with the
+ * Creates a <code>JobSheetsSupported</code> object with the
* given value and locale.
*
* @param value the value for this syntax
@@ -85,13 +85,13 @@ public final class JobSheetsSupported extends TextSyntax
{
super(value, locale);
}
-
+
/**
* Returns category of this class.
*
* @return The class <code>JobSheetsSupported</code> itself.
*/
- public Class getCategory()
+ public Class<? extends Attribute> getCategory()
{
return JobSheetsSupported.class;
}
@@ -105,46 +105,44 @@ public final class JobSheetsSupported extends TextSyntax
{
return "job-sheets-supported";
}
-
+
/**
* Returns the equally enum of the standard attribute class
* of this SupportedValuesAttribute enum.
* <p>May return null if no value exists in JPS API.</p>
- *
+ *
* @return The enum of the standard attribute class.
*/
- public JobSheets getAssociatedAttribute()
+ public JobSheets getAssociatedAttribute()
{
if (this.equals(JobSheetsDefault.NONE))
return JobSheets.NONE;
if (this.equals(JobSheetsDefault.STANDARD))
return JobSheets.STANDARD;
-
+
return null;
}
-
+
/**
* Constructs an array from a set of -supported attributes.
* @param set set to process
* @return The constructed array.
- *
+ *
* @see #getAssociatedAttribute()
*/
- public static JobSheets[] getAssociatedAttributeArray(Set set)
+ public static JobSheets[]
+ getAssociatedAttributeArray(Set<JobSheetsSupported> set)
{
- JobSheetsSupported tmp;
- ArrayList result = new ArrayList();
- Iterator it = set.iterator();
+ ArrayList<JobSheets> result = new ArrayList<JobSheets>();
int j = 0;
- while (it.hasNext())
+ for (JobSheetsSupported tmp : set)
{
- tmp = (JobSheetsSupported) it.next();
- Attribute att = tmp.getAssociatedAttribute();
+ JobSheets att = tmp.getAssociatedAttribute();
if (att != null)
result.add(att);
j++;
- }
- return (JobSheets[]) result.toArray(new JobSheets[result.size()]);
+ }
+ return result.toArray(new JobSheets[result.size()]);
}
-
+
}