harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r454289 [8/22] - in /incubator/harmony/enhanced/classlib/trunk/modules/H-1609: ./ modules/ modules/applet/ modules/applet/src/ modules/applet/src/main/ modules/applet/src/main/java/ modules/applet/src/main/java/java/ modules/applet/src/main...
Date Mon, 09 Oct 2006 05:33:21 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReason.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReason.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReason.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReason.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,215 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, section 4.3.8, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public class JobStateReason extends EnumSyntax implements Attribute {
+
+
+    public static final JobStateReason
+        JOB_INCOMING = new JobStateReason(0);
+
+    public static final JobStateReason
+        JOB_DATA_INSUFFICIENT = new JobStateReason(1);
+
+    public static final JobStateReason
+        DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
+
+    public static final JobStateReason
+        SUBMISSION_INTERRUPTED = new JobStateReason(3);
+
+    public static final JobStateReason
+        JOB_OUTGOING = new JobStateReason(4);
+
+    public static final JobStateReason
+        JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
+
+    public static final JobStateReason
+        RESOURCES_ARE_NOT_READY = new JobStateReason(6);
+
+    public static final JobStateReason
+        PRINTER_STOPPED_PARTLY = new JobStateReason(7);
+
+    public static final JobStateReason
+        PRINTER_STOPPED = new JobStateReason(8);
+
+    public static final JobStateReason
+        JOB_INTERPRETING = new JobStateReason(9);
+
+    public static final JobStateReason
+        JOB_QUEUED = new JobStateReason(10);
+
+    public static final JobStateReason
+        JOB_TRANSFORMING = new JobStateReason(11);
+
+    public static final JobStateReason
+        JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
+
+    public static final JobStateReason
+        JOB_PRINTING = new JobStateReason(13);
+
+    public static final JobStateReason
+        JOB_CANCELED_BY_USER = new JobStateReason(14);
+
+    public static final JobStateReason
+        JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
+
+    public static final JobStateReason
+        JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
+
+    public static final JobStateReason
+        ABORTED_BY_SYSTEM = new JobStateReason(17);
+
+    public static final JobStateReason
+        UNSUPPORTED_COMPRESSION = new JobStateReason(18);
+
+    public static final JobStateReason
+        COMPRESSION_ERROR = new JobStateReason(19);
+
+    public static final JobStateReason
+        UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
+
+    public static final JobStateReason
+        DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
+
+    public static final JobStateReason
+        PROCESSING_TO_STOP_POINT = new JobStateReason(22);
+
+    public static final JobStateReason
+        SERVICE_OFF_LINE = new JobStateReason(23);
+
+    public static final JobStateReason
+        JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
+
+    public static final JobStateReason
+        JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
+
+    public static final JobStateReason
+        JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
+
+    public static final JobStateReason
+        JOB_RESTARTABLE = new JobStateReason(27);
+
+    public static final JobStateReason
+        QUEUED_IN_DEVICE = new JobStateReason(28);
+
+
+
+private static final JobStateReason[] enumValueTable = {
+
+        JOB_INCOMING,
+        JOB_DATA_INSUFFICIENT,
+        DOCUMENT_ACCESS_ERROR,
+        SUBMISSION_INTERRUPTED,
+        JOB_OUTGOING,
+        JOB_HOLD_UNTIL_SPECIFIED,
+        RESOURCES_ARE_NOT_READY,
+        PRINTER_STOPPED_PARTLY,
+        PRINTER_STOPPED,
+        JOB_INTERPRETING,
+        JOB_QUEUED,
+        JOB_TRANSFORMING,
+        JOB_QUEUED_FOR_MARKER,
+        JOB_PRINTING,
+        JOB_CANCELED_BY_USER,
+        JOB_CANCELED_BY_OPERATOR,
+        JOB_CANCELED_AT_DEVICE,
+        ABORTED_BY_SYSTEM,
+        UNSUPPORTED_COMPRESSION,
+        COMPRESSION_ERROR,
+        UNSUPPORTED_DOCUMENT_FORMAT,
+        DOCUMENT_FORMAT_ERROR,
+        PROCESSING_TO_STOP_POINT,
+        SERVICE_OFF_LINE,
+        JOB_COMPLETED_SUCCESSFULLY,
+        JOB_COMPLETED_WITH_WARNINGS,
+        JOB_COMPLETED_WITH_ERRORS,
+        JOB_RESTARTABLE,
+        QUEUED_IN_DEVICE
+
+    };
+
+    private static final String[] stringTable = {
+
+            "job-incoming",
+            "job-data-insufficient",
+            "document-access-error",
+            "submission-interrupted",
+            "job-outgoing",
+            "job-hold-until-specified",
+            "resources-are-not-ready",
+            "printer-stopped-partly",
+            "printer-stopped",
+            "job-interpreting",
+            "job-queued",
+            "job-transforming",
+            "job-queued-for-marker",
+            "job-printing",
+            "job-canceled-by-user",
+            "job-canceled-by-operator",
+            "job-canceled-at-device",
+            "aborted-by-system",
+            "unsupported-compression",
+            "compression-error",
+            "unsupported-document-format",
+            "document-format-error",
+            "processing-to-stop-point",
+            "service-off-line",
+            "job-completed-successfully",
+            "job-completed-with-warnings",
+            "job-completed-with-errors",
+            "job-restartable",
+            "queued-in-device"
+    };
+
+
+    protected JobStateReason(int value) {
+        super(value);
+    }
+
+
+    protected EnumSyntax[] getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return JobStateReason.class;
+    }
+
+    public final String getName() {
+        return "job-state-reason";
+    }
+
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReason.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,80 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.6 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import javax.print.attribute.PrintJobAttribute;
+
+public final class JobStateReasons extends HashSet implements PrintJobAttribute {
+//1.5 support requires the following changes 
+//public final class JobStateReasons extends HashSet<JobStateReason> 
+//implements PrintJobAttribute {
+
+    public JobStateReasons() {
+        super();
+    }
+
+    public JobStateReasons(Collection collection) {
+    //1.5 support requires the following changes 
+    //public JobStateReasons(Collection<JobStateReason> collection) {
+
+        this();
+        Iterator iterator = collection.iterator();
+        while (iterator.hasNext()) {
+            add(iterator.next());
+        }
+    }
+
+    public JobStateReasons(int initialCapacity) {
+        super(initialCapacity);
+
+    }
+
+    public JobStateReasons(int initialCapacity, float loadFactor) {
+        super(initialCapacity, loadFactor);
+    }
+
+
+    public boolean add(Object reason) {
+    //1.5 support requires the following changes 
+    //public boolean add(JobStateReason reason) {
+
+        if (reason == null) {
+            throw new NullPointerException("Null JobStateReason");
+        }
+        return super.add( (JobStateReason) reason);
+    }
+
+    public final Class getCategory() {
+    //1.5 support requires the following changes
+    //Class<? extends Attribute> getCategory() {
+        return JobStateReasons.class;
+    }
+
+    public final String getName() {
+        return "job-state-reasons";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Media.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Media.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Media.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Media.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,58 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+public abstract class Media extends EnumSyntax 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    protected Media(int value) {
+           super(value);
+    }
+
+
+    public boolean equals (Object object) {
+
+        if ((object instanceof Media) &&
+                (object.getClass() == this.getClass()) &&
+                    ((Media)object).getValue() == this.getValue() ) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return Media.class;
+    }
+
+    public final String getName() {
+        return "media";
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Media.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaName.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaName.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaName.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaName.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,68 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.4 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, Appendix C, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public class MediaName extends Media implements Attribute {
+
+
+    public static final MediaName NA_LETTER_WHITE = new MediaName(0);
+
+    public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
+
+    public static final MediaName ISO_A4_WHITE = new MediaName(2);
+
+    public static final MediaName ISO_A4_TRANSPARENT = new MediaName(3);
+
+
+    private static final MediaName[] enumValueTable = { NA_LETTER_WHITE,
+                                                        NA_LETTER_TRANSPARENT,
+                                                        ISO_A4_WHITE,
+                                                        ISO_A4_TRANSPARENT };
+
+    private static final String[] stringTable = { "na-letter-white",
+                                                  "na-letter-transparent",
+                                                  "iso-a4-white",
+                                                  "iso-a4-transparent" };
+
+
+    protected MediaName(int value) {
+        super(value);
+    }
+
+
+    protected EnumSyntax[] getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaName.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,146 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+public final class MediaPrintableArea 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    public static final int INCH = 25400;
+
+    public static final int MM = 1000;
+    
+    private int x;
+    private int y;
+    private int width;
+    private int height;
+    private int units;
+    
+    public MediaPrintableArea(int x, int y, int width, int height, int units) {
+
+        if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0) ||
+                                                                (units < 1)) {
+            throw new IllegalArgumentException("Valid values are: x >= 0, "
+                        + "y >= 0, width > 0, height > 0, units >= 1");
+        }
+        this.x = x*units;
+        this.y = y*units;
+        this.width = width*units;
+        this.height = height*units;
+    }
+    
+    public MediaPrintableArea(float x, float y, float width, float height, 
+                                                                   int units) {
+
+        if ((x < 0.0f) || (y < 0.0f) || (width <= 0.0f) || (height <= 0.0f) ||
+                (units < 1) ) {
+
+            throw new IllegalArgumentException("Valid values are: x >= 0.0, " +
+                            "y >= 0.0, width > 0.0, height > 0.0, units > 1");
+        }
+        this.x = Math.round(x*units);
+        this.y = Math.round(y*units);
+        this.width = Math.round(width*units);
+        this.height = Math.round(height*units);
+    }
+
+    
+    public boolean equals(Object object) {
+ 
+        boolean outcome = false;
+        if (object instanceof MediaPrintableArea) {
+           MediaPrintableArea mpArea = (MediaPrintableArea)object;
+           if ( (x == mpArea.x) &&  (y == mpArea.y) && 
+                    (width == mpArea.width) && (height == mpArea.height) ) {
+            outcome = true;
+           }   
+        }
+        return outcome;
+    }
+    
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes 
+       Class<? extends Attribute> getCategory() { */
+        return MediaPrintableArea.class;
+    }
+
+    public final String getName() {
+        return "media-printable-area";
+    }
+    
+    public float getX(int units) {
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return ((float) x)/units;
+     }
+
+     public float getY(int units) {
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return ((float) y)/units;
+     }
+
+     public float getWidth(int units) {
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return ((float) width)/units;
+     }
+
+     public float getHeight(int units) {
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return ((float) height)/units;
+     }
+     
+     public float[] getPrintableArea(int units) {
+         return new float[] { getX(units), 
+                             getY(units),
+                             getWidth(units), 
+                             getHeight(units) };
+     }
+
+     public int hashCode() { 
+         return ( (y+height) | ((x+width) << 16) );
+     }
+    
+     public String toString() {
+         return toString(MM, "mm");
+     }
+    
+     public String toString(int units, String unitsName) {
+         if (unitsName == null) {
+             unitsName = "";
+         }
+         float[] pa = getPrintableArea(units);
+         return ("x=" + pa[0] + " y=" + pa[1] + 
+                    " width=" + pa[2] + " height=" + pa[3] + " " + unitsName);
+     } 
+
+   
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,497 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.Size2DSyntax;
+
+public class MediaSize extends Size2DSyntax implements Attribute {
+
+
+    private MediaSizeName mediaSizeName;
+    private static ArrayList sizesList = new ArrayList(80);
+    private static HashMap mediaSizeMap = new HashMap(80, 1);
+
+
+    public static final class Engineering {
+
+        private Engineering() {
+
+        }
+
+        public static final MediaSize
+            A = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH, MediaSizeName.A);
+
+        public static final MediaSize
+            B = new MediaSize(11, 17, Size2DSyntax.INCH, MediaSizeName.B);
+
+        public static final MediaSize
+            C = new MediaSize(17, 22, Size2DSyntax.INCH, MediaSizeName.C);
+
+        public static final MediaSize
+            D = new MediaSize(22, 34, Size2DSyntax.INCH, MediaSizeName.D);
+
+        public static final MediaSize
+            E = new MediaSize(34, 44, Size2DSyntax.INCH, MediaSizeName.E);
+
+    }
+
+    public static final class ISO {
+
+        private ISO() {
+
+        }
+
+        public static final MediaSize
+            A0 = new MediaSize(841, 1189, Size2DSyntax.MM, MediaSizeName.ISO_A0);
+
+        public static final MediaSize
+            A1 = new MediaSize(594, 841, Size2DSyntax.MM, MediaSizeName.ISO_A1);
+
+        public static final MediaSize
+            A2 = new MediaSize(420, 594, Size2DSyntax.MM, MediaSizeName.ISO_A2);
+
+        public static final MediaSize
+            A3 = new MediaSize(297, 420, Size2DSyntax.MM, MediaSizeName.ISO_A3);
+
+        public static final MediaSize
+            A4 = new MediaSize(210, 297, Size2DSyntax.MM, MediaSizeName.ISO_A4);
+
+        public static final MediaSize
+            A5 = new MediaSize(148, 210, Size2DSyntax.MM, MediaSizeName.ISO_A5);
+
+        public static final MediaSize
+            A6 = new MediaSize(105, 148, Size2DSyntax.MM, MediaSizeName.ISO_A6);
+
+        public static final MediaSize
+            A7 = new MediaSize(74, 105, Size2DSyntax.MM, MediaSizeName.ISO_A7);
+
+        public static final MediaSize
+            A8 = new MediaSize(52, 74, Size2DSyntax.MM, MediaSizeName.ISO_A8);
+
+        public static final MediaSize
+            A9 = new MediaSize(37, 52, Size2DSyntax.MM, MediaSizeName.ISO_A9);
+
+        public static final MediaSize
+            A10 = new MediaSize(26, 37, Size2DSyntax.MM, MediaSizeName.ISO_A10);
+
+        public static final MediaSize
+            B0 = new MediaSize(1000, 1414, Size2DSyntax.MM, MediaSizeName.ISO_B0);
+
+        public static final MediaSize
+            B1 = new MediaSize(707, 1000, Size2DSyntax.MM, MediaSizeName.ISO_B1);
+
+        public static final MediaSize
+            B2 = new MediaSize(500, 707, Size2DSyntax.MM, MediaSizeName.ISO_B2);
+
+        public static final MediaSize
+            B3 = new MediaSize(353, 500, Size2DSyntax.MM, MediaSizeName.ISO_B3);
+
+        public static final MediaSize
+            B4 = new MediaSize(250, 353, Size2DSyntax.MM, MediaSizeName.ISO_B4);
+
+        public static final MediaSize
+            B5 = new MediaSize(176, 250, Size2DSyntax.MM, MediaSizeName.ISO_B5);
+
+        public static final MediaSize
+            B6 = new MediaSize(125, 176, Size2DSyntax.MM, MediaSizeName.ISO_B6);
+
+        public static final MediaSize
+            B7 = new MediaSize(88, 125, Size2DSyntax.MM, MediaSizeName.ISO_B7);
+
+        public static final MediaSize
+            B8 = new MediaSize(62, 88, Size2DSyntax.MM, MediaSizeName.ISO_B8);
+
+        public static final MediaSize
+            B9 = new MediaSize(44, 62, Size2DSyntax.MM, MediaSizeName.ISO_B9);
+
+        public static final MediaSize
+            B10 = new MediaSize(31, 44, Size2DSyntax.MM, MediaSizeName.ISO_B10);
+
+        public static final MediaSize
+            C3 = new MediaSize(324, 458, Size2DSyntax.MM, MediaSizeName.ISO_C3);
+
+        public static final MediaSize
+            C4 = new MediaSize(229, 324, Size2DSyntax.MM, MediaSizeName.ISO_C4);
+
+        public static final MediaSize
+            C5 = new MediaSize(162, 229, Size2DSyntax.MM, MediaSizeName.ISO_C5);
+
+        public static final MediaSize
+            C6 = new MediaSize(114, 162, Size2DSyntax.MM, MediaSizeName.ISO_C6);
+
+        public static final MediaSize
+            DESIGNATED_LONG = new MediaSize(110, 220,
+                Size2DSyntax.MM, MediaSizeName.ISO_DESIGNATED_LONG);
+    }
+
+    public static final class JIS {
+
+        private JIS() {
+
+        }
+
+        public static final MediaSize
+            B0 = new MediaSize(1030, 1456, Size2DSyntax.MM, MediaSizeName.JIS_B0);
+
+        public static final MediaSize
+            B1 = new MediaSize(728, 1030, Size2DSyntax.MM, MediaSizeName.JIS_B1);
+
+        public static final MediaSize
+            B2 = new MediaSize(515, 728, Size2DSyntax.MM, MediaSizeName.JIS_B2);
+
+        public static final MediaSize
+            B3 = new MediaSize(364, 515, Size2DSyntax.MM, MediaSizeName.JIS_B3);
+
+        public static final MediaSize
+            B4 = new MediaSize(257, 364, Size2DSyntax.MM, MediaSizeName.JIS_B4);
+
+        public static final MediaSize
+            B5 = new MediaSize(182, 257, Size2DSyntax.MM, MediaSizeName.JIS_B5);
+
+        public static final MediaSize
+            B6 = new MediaSize(128, 182, Size2DSyntax.MM, MediaSizeName.JIS_B6);
+
+        public static final MediaSize
+            B7 = new MediaSize(91, 128, Size2DSyntax.MM, MediaSizeName.JIS_B7);
+
+        public static final MediaSize
+            B8 = new MediaSize(64, 91, Size2DSyntax.MM, MediaSizeName.JIS_B8);
+
+        public static final MediaSize
+            B9 = new MediaSize(45, 64, Size2DSyntax.MM, MediaSizeName.JIS_B9);
+
+        public static final MediaSize
+            B10 = new MediaSize(32, 45, Size2DSyntax.MM, MediaSizeName.JIS_B10);
+
+        public static final MediaSize
+            CHOU_1 = new MediaSize(142, 332, Size2DSyntax.MM);
+
+        public static final MediaSize
+            CHOU_2 = new MediaSize(119, 277, Size2DSyntax.MM);
+
+        public static final MediaSize
+            CHOU_3 = new MediaSize(120, 235, Size2DSyntax.MM);
+
+        public static final MediaSize
+            CHOU_4 = new MediaSize(90, 205, Size2DSyntax.MM);
+
+        public static final MediaSize
+            CHOU_30 = new MediaSize(92, 235, Size2DSyntax.MM);
+
+        public static final MediaSize
+            CHOU_40 = new MediaSize(90, 225, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_0 = new MediaSize(287, 382, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_1 = new MediaSize(270, 382, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_2 = new MediaSize(240, 332, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_3 = new MediaSize(216, 277, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_4 = new MediaSize(197, 267, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_5 = new MediaSize(190, 240, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_6 = new MediaSize(162, 229, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_7 = new MediaSize(142, 205, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_8 = new MediaSize(119, 197, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_20 = new MediaSize(229, 324, Size2DSyntax.MM);
+
+        public static final MediaSize
+            KAKU_A4 = new MediaSize(228, 312, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_1 = new MediaSize(120, 176, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_2 = new MediaSize(114, 162, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_3 = new MediaSize(98, 148, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_4 = new MediaSize(105, 235, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_5 = new MediaSize(95, 217, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_6 = new MediaSize(98, 190, Size2DSyntax.MM);
+
+        public static final MediaSize
+            YOU_7 = new MediaSize(92, 165, Size2DSyntax.MM);
+
+    }
+
+    public static final class NA {
+
+        private NA() {
+
+        }
+
+        public static final MediaSize
+            LETTER = new MediaSize(8.5f, 11.0f,
+                Size2DSyntax.INCH, MediaSizeName.NA_LETTER);
+
+        public static final MediaSize
+            LEGAL = new MediaSize(8.5f, 14.0f,
+                Size2DSyntax.INCH, MediaSizeName.NA_LEGAL);
+
+        public static final MediaSize
+            NA_5X7 = new MediaSize(5, 7,
+                Size2DSyntax.INCH, MediaSizeName.NA_5X7);
+
+        public static final MediaSize
+            NA_8X10 = new MediaSize(8, 10,
+                Size2DSyntax.INCH, MediaSizeName.NA_8X10);
+
+        public static final MediaSize
+            NA_NUMBER_9_ENVELOPE = new MediaSize(3.875f, 8.875f,
+                Size2DSyntax.INCH, MediaSizeName.NA_NUMBER_9_ENVELOPE);
+
+        public static final MediaSize
+            NA_NUMBER_10_ENVELOPE = new MediaSize(4.125f, 9.5f,
+                Size2DSyntax.INCH, MediaSizeName.NA_NUMBER_10_ENVELOPE);
+
+        public static final MediaSize
+            NA_NUMBER_11_ENVELOPE = new MediaSize(4.5f, 10.375f,
+                Size2DSyntax.INCH, MediaSizeName.NA_NUMBER_11_ENVELOPE);
+
+        public static final MediaSize
+            NA_NUMBER_12_ENVELOPE = new MediaSize(4.75f, 11.0f,
+                Size2DSyntax.INCH, MediaSizeName.NA_NUMBER_12_ENVELOPE);
+
+        public static final MediaSize
+            NA_NUMBER_14_ENVELOPE = new MediaSize(5.0f, 11.5f,
+                Size2DSyntax.INCH, MediaSizeName.NA_NUMBER_14_ENVELOPE);
+
+        public static final MediaSize
+            NA_6X9_ENVELOPE = new MediaSize(6, 9,
+                Size2DSyntax.INCH, MediaSizeName.NA_6X9_ENVELOPE);
+
+        public static final MediaSize
+            NA_7X9_ENVELOPE = new MediaSize(7, 9,
+                Size2DSyntax.INCH, MediaSizeName.NA_7X9_ENVELOPE);
+
+        public static final MediaSize
+            NA_9x11_ENVELOPE = new MediaSize(9, 11,
+                Size2DSyntax.INCH, MediaSizeName.NA_9X11_ENVELOPE);
+
+        public static final MediaSize
+            NA_9x12_ENVELOPE = new MediaSize(9, 12,
+                Size2DSyntax.INCH, MediaSizeName.NA_9X12_ENVELOPE);
+
+        public static final MediaSize
+            NA_10x13_ENVELOPE = new MediaSize(10, 13,
+                Size2DSyntax.INCH, MediaSizeName.NA_10X13_ENVELOPE);
+
+        public static final MediaSize
+            NA_10x14_ENVELOPE = new MediaSize(10, 14,
+                Size2DSyntax.INCH, MediaSizeName.NA_10X14_ENVELOPE);
+
+        public static final MediaSize
+            NA_10X15_ENVELOPE = new MediaSize(10, 15,
+                Size2DSyntax.INCH, MediaSizeName.NA_10X15_ENVELOPE);
+
+    }
+
+    public static final class Other {
+
+        private Other() {
+
+        }
+
+        public static final MediaSize
+            EXECUTIVE = new MediaSize(7.25f, 10.5f,
+                Size2DSyntax.INCH, MediaSizeName.EXECUTIVE);
+
+        public static final MediaSize
+            LEDGER = new MediaSize(11, 17,
+                Size2DSyntax.INCH, MediaSizeName.LEDGER);
+
+        public static final MediaSize
+            TABLOID = new MediaSize(11, 17,
+                Size2DSyntax.INCH, MediaSizeName.TABLOID);
+
+        public static final MediaSize
+            INVOICE = new MediaSize(5.5f, 8.5f,
+                Size2DSyntax.INCH, MediaSizeName.INVOICE);
+
+        public static final MediaSize
+            FOLIO = new MediaSize(8.5f, 13.0f,
+                Size2DSyntax.INCH, MediaSizeName.FOLIO);
+
+        public static final MediaSize
+            QUARTO = new MediaSize(8.5f, 10.83f,
+                Size2DSyntax.INCH, MediaSizeName.QUARTO);
+
+        public static final MediaSize
+            ITALY_ENVELOPE = new MediaSize(110, 230,
+                Size2DSyntax.MM, MediaSizeName.ITALY_ENVELOPE);
+
+        public static final MediaSize
+            MONARCH_ENVELOPE = new MediaSize(3.87f, 7.5f,
+                Size2DSyntax.INCH, MediaSizeName.MONARCH_ENVELOPE);
+
+        public static final MediaSize
+            PERSONAL_ENVELOPE = new MediaSize(3.625f, 6.5f,
+                Size2DSyntax.INCH, MediaSizeName.PERSONAL_ENVELOPE);
+
+        public static final MediaSize
+            JAPANESE_POSTCARD = new MediaSize(100, 148,
+                Size2DSyntax.MM, MediaSizeName.JAPANESE_POSTCARD);
+
+        public static final MediaSize
+            JAPANESE_DOUBLE_POSTCARD = new MediaSize(148, 200,
+                Size2DSyntax.MM, MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
+
+
+    }
+
+
+    /*
+     * Loading nested classes and initializing it's static fields.
+     * It is necessary to put MediaSize instances into ArrayList
+     * and HashMap used in static MediaSize methods.
+     */
+    static {
+        MediaSize initClass = MediaSize.Engineering.A;
+        initClass = MediaSize.ISO.A0;
+        initClass = MediaSize.JIS.B0;
+        initClass = MediaSize.NA.LEGAL;
+        initClass = MediaSize.Other.EXECUTIVE;
+    }
+
+
+    public MediaSize(int x, int y, int units) {
+        super(x, y, units);
+        if (x > y) {
+            throw new IllegalArgumentException("x > y");
+        }
+        sizesList.add(this);
+    }
+
+    public MediaSize(float x, float y, int units) {
+        super(x, y, units);
+        if (x > y) {
+            throw new IllegalArgumentException("x > y");
+        }
+        sizesList.add(this);
+    }
+
+    public MediaSize(int x, int y, int units, MediaSizeName mediaSizeName) {
+        super(x, y, units);
+        if (x > y) {
+            throw new IllegalArgumentException("x > y");
+        }
+        this.mediaSizeName = mediaSizeName;
+        sizesList.add(this);
+        mediaSizeMap.put(mediaSizeName, this);
+    }
+
+    public MediaSize(float x, float y,int units, MediaSizeName mediaSizeName) {
+        super(x, y, units);
+        if (x > y) {
+            throw new IllegalArgumentException("x > y");
+        }
+        this.mediaSizeName = mediaSizeName;
+        sizesList.add(this);
+        mediaSizeMap.put(mediaSizeName, this);
+    }
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof MediaSize ) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public static MediaSizeName findMedia(float x, float y, int units) {
+
+        if ( (x <= 0.0) || (y <= 0.0) || (units < 1) ) {
+            throw new IllegalArgumentException("Valid values are: " +
+                                            "x > 0, y > 0, units >= 1");
+        }
+        MediaSize hit = null;
+        double curX, curY, curDif;
+        double difference = Double.MAX_VALUE;
+        Iterator i = sizesList.iterator();
+        while (i.hasNext()) {
+            MediaSize mediaSize = (MediaSize) i.next();
+            curX = mediaSize.getX(units);
+            curY = mediaSize.getY(units);
+            if ( (x == curX) && (y == curY) ) {
+                hit = mediaSize;
+                break;
+            } else {
+                curDif = curX*curX - 2*x*curX - 2*y*curY + curY*curY;
+                if (curDif <= difference){
+                    difference = curDif;
+                    hit = mediaSize;
+                }
+            }
+        }
+        if (hit != null) {
+            return hit.getMediaSizeName();
+        } else {
+            return null;
+        }
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return MediaSize.class;
+    }
+
+    public static MediaSize getMediaSizeForName(MediaSizeName mediaSizeName) {
+        return (MediaSize) mediaSizeMap.get(mediaSizeName);
+    }
+
+    public MediaSizeName getMediaSizeName() {
+        return mediaSizeName;
+    }
+
+    public final String getName() {
+        return "media-size";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSizeName.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSizeName.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSizeName.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSizeName.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,359 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.4 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, Appendix C, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public class MediaSizeName extends Media {
+
+
+    public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
+   
+    public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
+    
+    public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
+    
+    public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
+    
+    public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
+    
+    public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
+   
+    public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
+    
+    public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
+    
+    public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
+    
+    public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
+    
+    public static final MediaSizeName ISO_A10 = new MediaSizeName(10);  
+
+    public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
+    
+    public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
+    
+    public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
+    
+    public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
+   
+    public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
+   
+    public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
+    
+    public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
+    
+    public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
+    
+    public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
+    
+    public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
+   
+    public static final MediaSizeName ISO_B10 = new MediaSizeName(21);  
+
+    public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
+  
+    public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
+   
+    public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
+    
+    public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
+    
+    public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
+    
+    public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
+    
+    public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
+    
+    public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
+    
+    public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
+    
+    public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
+    
+    public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
+
+    public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
+    
+    public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
+    
+    public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
+    
+    public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
+    
+    public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
+    
+    public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
+    
+    public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
+    
+    public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
+
+    public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
+
+    public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
+
+    public static final MediaSizeName LEDGER = new MediaSizeName(43);
+
+    public static final MediaSizeName TABLOID = new MediaSizeName(44);
+
+    public static final MediaSizeName INVOICE = new MediaSizeName(45);
+
+    public static final MediaSizeName FOLIO = new MediaSizeName(46);
+
+    public static final MediaSizeName QUARTO = new MediaSizeName(47);
+
+    public static final MediaSizeName 
+                            JAPANESE_POSTCARD = new MediaSizeName(48);
+   
+    public static final MediaSizeName 
+                            JAPANESE_DOUBLE_POSTCARD = new MediaSizeName(49);
+
+    public static final MediaSizeName A = new MediaSizeName(50);
+
+    public static final MediaSizeName B = new MediaSizeName(51);
+
+    public static final MediaSizeName C = new MediaSizeName(52);
+
+    public static final MediaSizeName D = new MediaSizeName(53);
+
+    public static final MediaSizeName E = new MediaSizeName(54);
+
+    public static final MediaSizeName 
+                            ISO_DESIGNATED_LONG = new MediaSizeName(55);
+
+    public static final MediaSizeName ITALY_ENVELOPE = new MediaSizeName(56); 
+
+    public static final MediaSizeName MONARCH_ENVELOPE = new MediaSizeName(57);
+    
+    public static final MediaSizeName 
+                            PERSONAL_ENVELOPE = new MediaSizeName(58);
+    
+    public static final MediaSizeName 
+                            NA_NUMBER_9_ENVELOPE = new MediaSizeName(59);
+    
+    public static final MediaSizeName 
+                            NA_NUMBER_10_ENVELOPE = new MediaSizeName(60);
+    
+    public static final MediaSizeName 
+                            NA_NUMBER_11_ENVELOPE = new MediaSizeName(61);
+    
+    public static final MediaSizeName 
+                            NA_NUMBER_12_ENVELOPE = new MediaSizeName(62);
+   
+    public static final MediaSizeName 
+                            NA_NUMBER_14_ENVELOPE = new MediaSizeName(63);
+   
+    public static final MediaSizeName NA_6X9_ENVELOPE = new MediaSizeName(64);
+   
+    public static final MediaSizeName NA_7X9_ENVELOPE = new MediaSizeName(65);
+   
+    public static final MediaSizeName NA_9X11_ENVELOPE = new MediaSizeName(66);
+    
+    public static final MediaSizeName 
+                            NA_9X12_ENVELOPE = new MediaSizeName(67);
+
+    public static final MediaSizeName NA_10X13_ENVELOPE = new MediaSizeName(68);
+    
+    public static final MediaSizeName NA_10X14_ENVELOPE = new MediaSizeName(69);
+    
+    public static final MediaSizeName NA_10X15_ENVELOPE = new MediaSizeName(70);
+
+    public static final MediaSizeName NA_5X7 = new MediaSizeName(71);
+
+    public static final MediaSizeName NA_8X10 = new MediaSizeName(72);
+        
+
+    private static final String[] stringTable =  { 
+
+        "iso-a0",
+        "iso-a1",
+        "iso-a2",
+        "iso-a3",
+        "iso-a4",
+        "iso-a5",
+        "iso-a6",
+        "iso-a7",
+        "iso-a8",
+        "iso-a9",
+        "iso-a10",
+        "iso-b0",
+        "iso-b1",
+        "iso-b2",
+        "iso-b3",
+        "iso-b4",
+        "iso-b5",
+        "iso-b6",
+        "iso-b7",
+        "iso-b8",
+        "iso-b9",
+        "iso-b10",
+        "jis-b0",
+        "jis-b1",
+        "jis-b2",
+        "jis-b3",
+        "jis-b4",
+        "jis-b5",
+        "jis-b6",
+        "jis-b7",
+        "jis-b8",
+        "jis-b9",
+        "jis-b10",
+        "iso-c0",
+        "iso-c1",
+        "iso-c2",
+        "iso-c3",
+        "iso-c4",
+        "iso-c5",
+        "iso-c6",
+        "na-letter",
+        "na-legal",
+        "executive",
+        "ledger",
+        "tabloid",
+        "invoice",
+        "folio",
+        "quarto",
+        "japanese-postcard",
+        "japanese-double-postcard",
+        "a",
+        "b",
+        "c",
+        "d",
+        "e",
+        "iso-designated-long",
+        "italy-envelope",
+        "monarch-envelope",
+        "personal-envelope",
+        "na-number-9-envelope",
+        "na-number-10-envelope",
+        "na-number-11-envelope",
+        "na-number-12-envelope",
+        "na-number-14-envelope",
+        "na-6x9-envelope",
+        "na-7x9-envelope",
+        "na-9x11-envelope",
+        "na-9x12-envelope",
+        "na-10x13-envelope",
+        "na-10x14-envelope",
+        "na-10x15-envelope",
+        "na-5x7",
+        "na-8x10"
+    };
+
+    private static final MediaSizeName[] enumValueTable = {
+
+        ISO_A0,
+        ISO_A1,
+        ISO_A2,
+        ISO_A3,
+        ISO_A4,
+        ISO_A5,
+        ISO_A6,
+        ISO_A7,
+        ISO_A8,
+        ISO_A9,
+        ISO_A10,
+        ISO_B0,
+        ISO_B1,
+        ISO_B2,
+        ISO_B3,
+        ISO_B4,
+        ISO_B5,
+        ISO_B6,
+        ISO_B7,
+        ISO_B8,
+        ISO_B9,
+        ISO_B10,
+        JIS_B0,
+        JIS_B1,
+        JIS_B2,
+        JIS_B3,
+        JIS_B4,
+        JIS_B5,
+        JIS_B6,
+        JIS_B7,
+        JIS_B8,
+        JIS_B9,
+        JIS_B10,
+        ISO_C0,
+        ISO_C1,
+        ISO_C2,
+        ISO_C3,
+        ISO_C4,
+        ISO_C5,
+        ISO_C6,
+        NA_LETTER,
+        NA_LEGAL,
+        EXECUTIVE,
+        LEDGER,
+        TABLOID,
+        INVOICE,
+        FOLIO,
+        QUARTO,
+        JAPANESE_POSTCARD,
+        JAPANESE_DOUBLE_POSTCARD,
+        A,
+        B,
+        C,
+        D,
+        E,
+        ISO_DESIGNATED_LONG,
+        ITALY_ENVELOPE,
+        MONARCH_ENVELOPE,
+        PERSONAL_ENVELOPE,
+        NA_NUMBER_9_ENVELOPE,
+        NA_NUMBER_10_ENVELOPE,
+        NA_NUMBER_11_ENVELOPE,
+        NA_NUMBER_12_ENVELOPE,
+        NA_NUMBER_14_ENVELOPE,
+        NA_6X9_ENVELOPE,
+        NA_7X9_ENVELOPE,
+        NA_9X11_ENVELOPE,
+        NA_9X12_ENVELOPE,
+        NA_10X13_ENVELOPE,
+        NA_10X14_ENVELOPE,
+        NA_10X15_ENVELOPE,
+        NA_5X7,
+        NA_8X10
+
+    };
+
+    
+    protected MediaSizeName(int value) {
+        super(value);
+    }
+    
+
+    protected EnumSyntax[] getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+    
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSizeName.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaTray.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaTray.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaTray.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaTray.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,83 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.4 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, Appendix C, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public class MediaTray extends Media implements Attribute {
+
+
+    public static final MediaTray TOP = new MediaTray(0);
+
+    public static final MediaTray MIDDLE = new MediaTray(1);
+
+    public static final MediaTray BOTTOM = new MediaTray(2);
+
+    public static final MediaTray ENVELOPE = new MediaTray(3);
+
+    public static final MediaTray MANUAL = new MediaTray(4);
+
+    public static final MediaTray LARGE_CAPACITY = new MediaTray(5);
+
+    public static final MediaTray MAIN = new MediaTray(6);
+
+    public static final MediaTray SIDE = new MediaTray(7);
+    
+
+    private static final MediaTray[] enumValueTable = { TOP,
+                                                        MIDDLE,
+                                                        BOTTOM,
+                                                        ENVELOPE,
+                                                        MANUAL,
+                                                        LARGE_CAPACITY,
+                                                        MAIN,
+                                                        SIDE };
+    private static final String[] stringTable ={ "top",
+                                                 "middle",
+                                                 "bottom",
+                                                 "envelope",
+                                                 "manual",
+                                                 "large-capacity",
+                                                 "main",
+                                                 "side" };
+    
+    
+    protected MediaTray(int value) {
+        super(value);
+    }
+    
+
+    protected EnumSyntax[] getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+    
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+
+    
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MediaTray.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MultipleDocumentHandling.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MultipleDocumentHandling.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MultipleDocumentHandling.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MultipleDocumentHandling.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,90 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, section 4.2.4, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public class MultipleDocumentHandling extends EnumSyntax 
+    implements PrintJobAttribute, PrintRequestAttribute {
+
+
+    public static final MultipleDocumentHandling
+        SINGLE_DOCUMENT = new MultipleDocumentHandling (0);
+
+    public static final MultipleDocumentHandling 
+        SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling (1);
+
+    public static final MultipleDocumentHandling 
+        SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling (2);
+
+    public static final MultipleDocumentHandling
+        SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling (3);
+
+    
+    private static final MultipleDocumentHandling[] enumValueTable = { 
+
+        SINGLE_DOCUMENT,
+        SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
+        SEPARATE_DOCUMENTS_COLLATED_COPIES,
+        SINGLE_DOCUMENT_NEW_SHEET
+    };
+    
+    private static final String[] stringTable = {
+
+        "single-document",
+        "separate-documents-uncollated-copies",
+        "separate-documents-collated-copies",
+        "single-document-new-sheet"
+    };
+    
+    
+    protected MultipleDocumentHandling(int value) {
+        super(value);
+    }
+    
+    
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes 
+       Class<? extends Attribute> getCategory() { */
+        return MultipleDocumentHandling.class;
+    }
+    
+    protected EnumSyntax[] getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+    
+    public final String getName() {
+        return "multiple-document-handling";
+    }
+    
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+    
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/MultipleDocumentHandling.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfDocuments.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfDocuments.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfDocuments.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfDocuments.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,53 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+public final class NumberOfDocuments extends IntegerSyntax 
+    implements PrintJobAttribute {
+
+
+    public NumberOfDocuments(int value) {
+        super(value, 0, Integer.MAX_VALUE);
+    }
+
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof NumberOfDocuments) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return NumberOfDocuments.class;
+    }
+
+    public final String getName() {
+        return "number-of-documents";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfDocuments.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfInterveningJobs.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfInterveningJobs.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfInterveningJobs.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfInterveningJobs.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,53 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+public final class NumberOfInterveningJobs extends IntegerSyntax 
+    implements PrintJobAttribute {
+
+
+    public NumberOfInterveningJobs(int value) {
+        super(value, 0, Integer.MAX_VALUE);
+    }
+
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof NumberOfInterveningJobs) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return NumberOfInterveningJobs.class;
+    }
+
+    public final String getName() {
+        return "number-of-intervening-jobs";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberOfInterveningJobs.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUp.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUp.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUp.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,55 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+public final class NumberUp extends IntegerSyntax 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    public NumberUp(int value) {
+        super(value, 1, Integer.MAX_VALUE);
+    }
+
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof NumberUp) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes 
+       Class<? extends Attribute> getCategory() { */
+        return NumberUp.class;
+    }
+
+    public final String getName() {
+        return "number-up";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUp.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,85 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+public final class NumberUpSupported extends SetOfIntegerSyntax 
+    implements SupportedValuesAttribute {
+
+
+    public NumberUpSupported(int value) {
+        super(value);
+        if (value < 1) {
+            throw new IllegalArgumentException("Value" + value +
+                                                    "is less than 1");
+        }
+    }
+
+    public NumberUpSupported(int lowerBound, int upperBound) {
+        super(lowerBound, upperBound);
+        if (lowerBound > upperBound) {
+            throw new IllegalArgumentException("Null range: lowerBound " +
+                                                            "> upperBound");
+        } else if (lowerBound < 1) {
+            throw new IllegalArgumentException("Lower bound " + lowerBound +
+                                                            " is less than 1");
+        }
+    }
+
+    public NumberUpSupported(int[][] members) {
+        super(members);
+        if (members == null) {
+            throw new NullPointerException("Null int[][] parameter");
+        }
+        int[][] canonicalArray = getMembers();
+        if (canonicalArray.length == 0) {
+                throw new IllegalArgumentException("Zero-length array");
+        }
+        for (int i = 0; i < canonicalArray.length; i++) {
+            if (canonicalArray[i][0] < 1) {
+                throw new IllegalArgumentException("Valid values are not " +
+                                                                "less than 1");
+            }
+        }
+    }
+
+
+    public boolean equals(Object object) {
+        if( !(object instanceof NumberUpSupported) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return NumberUpSupported.class;
+    }
+
+    public String getName() {
+        return "number-up-supported";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OrientationRequested.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OrientationRequested.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OrientationRequested.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OrientationRequested.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,92 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/*
+ * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
+ * Model and Semantics, section 4.2.10, http://ietf.org/rfc/rfc2911.txt?number=2911
+ */
+
+public final class OrientationRequested extends EnumSyntax 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    public static final OrientationRequested
+        PORTRAIT = new OrientationRequested(3);
+
+    public static final OrientationRequested 
+        LANDSCAPE = new OrientationRequested(4);
+   
+    public static final OrientationRequested 
+        REVERSE_LANDSCAPE = new OrientationRequested(5);
+
+    public static final OrientationRequested 
+        REVERSE_PORTRAIT  = new OrientationRequested(6);
+
+
+    private static final OrientationRequested[] enumValueTable = {
+
+            PORTRAIT,
+            LANDSCAPE,
+            REVERSE_LANDSCAPE,
+            REVERSE_PORTRAIT
+    };
+    
+    private static final String[] stringTable = { "portrait",
+                                                  "landscape",
+                                                  "reverse-landscape",
+                                                  "reverse-portrait" };
+    
+
+    protected OrientationRequested(int value) {
+        super(value);
+    }
+    
+    
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes 
+       Class<? extends Attribute> getCategory() { */
+        return OrientationRequested.class;
+    }
+    
+    protected EnumSyntax[] getEnumValueTable() {
+        return enumValueTable;
+    }
+    
+    public final String getName() {
+        return "orientation-requested";
+    }
+    
+    protected int getOffset() {
+        return 3;
+    } 
+    
+    protected String[] getStringTable() {
+        return stringTable;
+    }
+    
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OrientationRequested.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OutputDeviceAssigned.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OutputDeviceAssigned.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OutputDeviceAssigned.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OutputDeviceAssigned.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,55 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.TextSyntax;
+
+public final class OutputDeviceAssigned extends TextSyntax 
+    implements PrintJobAttribute {
+
+
+    public OutputDeviceAssigned(String deviceName, Locale locale) {
+        super(deviceName, locale);
+    }
+
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof OutputDeviceAssigned)) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return OutputDeviceAssigned.class;
+    }
+
+    public final String getName() {
+        return "output-device-assigned";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/OutputDeviceAssigned.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PDLOverrideSupported.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PDLOverrideSupported.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PDLOverrideSupported.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PDLOverrideSupported.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,72 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+
+public class PDLOverrideSupported extends EnumSyntax 
+    implements PrintServiceAttribute {
+
+
+    public static final PDLOverrideSupported
+        NOT_ATTEMPTED = new PDLOverrideSupported(0);
+
+    public static final PDLOverrideSupported
+        ATTEMPTED = new PDLOverrideSupported(1);
+
+
+    private static final PDLOverrideSupported[] enumValueTable = {
+
+            NOT_ATTEMPTED,
+            ATTEMPTED
+    };
+
+    private static final String[] stringTable = { "not-attempted",
+                                                  "attempted" };
+
+
+    protected PDLOverrideSupported(int value) {
+        super(value);
+    }
+
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return PDLOverrideSupported.class;
+    }
+
+    protected EnumSyntax[]  getEnumValueTable() {
+        return (EnumSyntax[]) enumValueTable.clone();
+    }
+
+    public final String getName() {
+        return "pdl-override-supported";
+    }
+
+    protected String[] getStringTable() {
+        return (String[]) stringTable.clone();
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PDLOverrideSupported.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,100 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.SetOfIntegerSyntax;
+
+public final class PageRanges extends SetOfIntegerSyntax 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    public PageRanges(int value) {
+        super(value);
+        if (value < 1) {
+            throw new IllegalArgumentException("Value" + value +
+                                                    "is less than 1");
+        }
+    }
+
+    public PageRanges(int lowerBound, int upperBound) {
+        super(lowerBound, upperBound);
+        if (lowerBound > upperBound) {
+            throw new IllegalArgumentException("Null range: lowerBound " +
+                                                            "> upperBound");
+        } else if (lowerBound < 1) {
+            throw new IllegalArgumentException("Lower bound " + lowerBound +
+                                                            " is less than 1");
+        }
+    }
+
+    public PageRanges(int[][] members) {
+        super(members);
+        if (members == null) {
+            throw new NullPointerException("Null int[][] parameter");
+        }
+        precisionCheck();
+    }
+
+    public PageRanges(String string) {
+        super(string);
+        if (string == null) {
+            throw new NullPointerException("Null string parameter");
+        }
+        precisionCheck();
+    }
+
+
+    private void precisionCheck() {
+        int[][] canonicalArray = getMembers();
+        if (canonicalArray.length == 0) {
+                throw new IllegalArgumentException("Zero-length array");
+        }
+        for (int i = 0; i < canonicalArray.length; i++) {
+            if (canonicalArray[i][0] < 1) {
+                throw new IllegalArgumentException("Valid values are not " +
+                                                                "less than 1");
+            }
+        }
+    }
+
+
+    public boolean equals(Object object) {
+        if( !(object instanceof PageRanges) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return PageRanges.class;
+    }
+
+    public String getName() {
+        return "page-ranges";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PagesPerMinute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PagesPerMinute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PagesPerMinute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PagesPerMinute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,54 @@
+/*
+ *  Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+ * @author Elena V. Sayapina 
+ * @version $Revision: 1.5 $ 
+ */ 
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+
+public final class PagesPerMinute extends IntegerSyntax 
+    implements PrintServiceAttribute {
+
+
+    public PagesPerMinute(int value) {
+        super(value, 0, Integer.MAX_VALUE);
+    }
+
+
+    public boolean equals(Object object) {
+        if ( !(object instanceof PagesPerMinute) ) {
+            return false;
+        }
+        return super.equals(object);
+    }
+
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes
+       Class<? extends Attribute> getCategory() { */
+        return PagesPerMinute.class;
+    }
+
+    public final String getName() {
+        return "pages-per-minute";
+    }
+
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/PagesPerMinute.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message