harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r454289 [6/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/AttributeSetUtilities.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,375 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+public final class AttributeSetUtilities {
+
+
+    private static class SynchronizedAttributeSet
+        implements AttributeSet, Serializable {
+
+
+        private AttributeSet aset;
+
+        public SynchronizedAttributeSet(AttributeSet attributeSet) {
+            aset = attributeSet;
+        }
+
+
+        public synchronized boolean add (Attribute attribute) {
+            return aset.add(attribute);
+        }
+
+        public synchronized boolean addAll (AttributeSet attributeSet) {
+            return aset.addAll(attributeSet);
+        }
+
+        public synchronized void clear() {
+            aset.clear();
+        }
+
+        public synchronized boolean containsKey (Class attributeCategory) {
+            return aset.containsKey(attributeCategory);
+        }
+
+        public synchronized boolean containsValue (Attribute attribute) {
+            return aset.containsValue(attribute);
+        }
+
+        public synchronized boolean equals (Object object) {
+            return aset.equals (object);
+        }
+
+        public synchronized Attribute get (Class attributeCategory) {
+            return aset.get(attributeCategory);
+        }
+
+        public synchronized int hashCode() {
+            return aset.hashCode();
+        }
+
+        public synchronized boolean isEmpty() {
+            return aset.isEmpty();
+        }
+
+        public synchronized boolean remove (Attribute attribute) {
+            return aset.remove(attribute);
+        }
+
+        public synchronized boolean remove (Class attributeCategory) {
+            return aset.remove(attributeCategory);
+        }
+
+        public synchronized int size() {
+            return aset.size();
+        }
+
+        public synchronized Attribute[] toArray() {
+            return aset.toArray();
+        }
+
+
+    }
+
+    private static class SynchronizedDocAttributeSet
+        extends SynchronizedAttributeSet
+            implements DocAttributeSet, Serializable {
+
+        public SynchronizedDocAttributeSet(DocAttributeSet attributeSet) {
+            super(attributeSet);
+        }
+    }
+
+    private static class SynchronizedPrintJobAttributeSet
+        extends SynchronizedAttributeSet
+            implements PrintJobAttributeSet, Serializable {
+
+        public SynchronizedPrintJobAttributeSet
+                    (PrintJobAttributeSet attributeSet) {
+                        super(attributeSet);
+        }
+    }
+
+    private static class SynchronizedPrintRequestAttributeSet
+        extends SynchronizedAttributeSet
+            implements PrintRequestAttributeSet, Serializable {
+
+        public SynchronizedPrintRequestAttributeSet
+                    (PrintRequestAttributeSet attributeSet) {
+                        super(attributeSet);
+        }
+    }
+
+    private static class SynchronizedPrintServiceAttributeSet
+        extends SynchronizedAttributeSet
+            implements PrintServiceAttributeSet, Serializable {
+
+        public SynchronizedPrintServiceAttributeSet
+                    (PrintServiceAttributeSet attributeSet) {
+                        super(attributeSet);
+        }
+    }
+
+    private static class UnmodifiableAttributeSet
+        implements AttributeSet, Serializable {
+
+
+        private AttributeSet aset;
+
+        public UnmodifiableAttributeSet(AttributeSet attributeSet) {
+            aset = attributeSet;
+        }
+
+
+        public boolean add(Attribute attribute) {
+            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        }
+
+        public boolean addAll(AttributeSet attributeSet) {
+            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        }
+
+        public void clear() {
+            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        }
+
+        public boolean containsKey(Class attributeCategory) {
+            return aset.containsKey(attributeCategory);
+        }
+
+        public boolean containsValue(Attribute attribute) {
+            return aset.containsValue(attribute);
+        }
+
+        public boolean equals(Object object) {
+            return aset.equals(object);
+        }
+
+        public Attribute get (Class attributeCategory) {
+            return aset.get(attributeCategory);
+        }
+
+        public int hashCode() {
+            return aset.hashCode();
+        }
+
+        public boolean isEmpty() {
+            return aset.isEmpty();
+        }
+
+        public boolean remove(Attribute attribute) {
+            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        }
+
+        public synchronized boolean remove (Class attributeCategory) {
+            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        }
+
+        public int size() {
+            return aset.size();
+        }
+
+        public Attribute[] toArray() {
+            return aset.toArray();
+        }
+
+
+    }
+
+    private static class UnmodifiableDocAttributeSet
+        extends UnmodifiableAttributeSet
+            implements DocAttributeSet, Serializable {
+
+        public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet) {
+            super(attributeSet);
+        }
+    }
+
+    private static class UnmodifiablePrintJobAttributeSet
+        extends UnmodifiableAttributeSet
+            implements PrintJobAttributeSet, Serializable {
+
+        public UnmodifiablePrintJobAttributeSet
+                    (PrintJobAttributeSet attributeSet) {
+                        super (attributeSet);
+        }
+    }
+
+    private static class UnmodifiablePrintRequestAttributeSet
+        extends UnmodifiableAttributeSet
+            implements PrintRequestAttributeSet, Serializable {
+
+        public UnmodifiablePrintRequestAttributeSet
+                    (PrintRequestAttributeSet attributeSet) {
+                        super(attributeSet);
+        }
+    }
+
+    private static class UnmodifiablePrintServiceAttributeSet
+        extends UnmodifiableAttributeSet
+            implements PrintServiceAttributeSet, Serializable {
+
+        public UnmodifiablePrintServiceAttributeSet
+                    (PrintServiceAttributeSet attributeSet) {
+                        super(attributeSet);
+        }
+    }
+
+    
+    private AttributeSetUtilities() {
+
+    }
+
+
+    public static AttributeSet 
+        synchronizedView (AttributeSet attributeSet) {
+            if (attributeSet == null) {
+                throw new NullPointerException("Null attribute set");
+            }
+            return new SynchronizedAttributeSet(attributeSet);
+    }
+  
+    public static DocAttributeSet 
+        synchronizedView (DocAttributeSet attributeSet) {
+            if (attributeSet == null) {
+                throw new NullPointerException("Null attribute set");
+            }
+            return new SynchronizedDocAttributeSet(attributeSet);
+    }
+    
+    public static PrintRequestAttributeSet 
+        synchronizedView(PrintRequestAttributeSet attributeSet) {
+            if (attributeSet == null) {
+                throw new NullPointerException("Null attribute set");
+            }
+            return new SynchronizedPrintRequestAttributeSet(attributeSet);
+    }
+
+    public static PrintJobAttributeSet
+        synchronizedView(PrintJobAttributeSet attributeSet) {
+            if (attributeSet == null) {
+                throw new NullPointerException("Null attribute set");
+            }
+            return new SynchronizedPrintJobAttributeSet(attributeSet);
+    }
+
+    public static PrintServiceAttributeSet
+        synchronizedView(PrintServiceAttributeSet attributeSet) {
+            if (attributeSet == null) {
+                throw new NullPointerException("Null attribute set");
+            }
+            return new SynchronizedPrintServiceAttributeSet(attributeSet);
+    }
+
+    
+    public static AttributeSet unmodifiableView (AttributeSet attributeSet) {
+        if (attributeSet == null) {
+            throw new NullPointerException("Null attribute set");
+        }
+        return new UnmodifiableAttributeSet(attributeSet);
+    }
+    
+    public static DocAttributeSet 
+                    unmodifiableView (DocAttributeSet attributeSet) {
+        if (attributeSet == null) {
+            throw new NullPointerException("Null attribute set");
+        }
+        return new UnmodifiableDocAttributeSet(attributeSet);
+    }
+    
+    public static PrintJobAttributeSet
+                    unmodifiableView(PrintJobAttributeSet attributeSet) {
+        if (attributeSet == null) {
+            throw new NullPointerException("Null attribute set");
+        }
+        return new UnmodifiablePrintJobAttributeSet(attributeSet);
+    }
+    
+    public static PrintRequestAttributeSet 
+                    unmodifiableView(PrintRequestAttributeSet attributeSet) {
+        if (attributeSet == null) {
+            throw new NullPointerException("Null attribute set");
+        }
+        return new UnmodifiablePrintRequestAttributeSet(attributeSet);
+    }
+      
+    public static PrintServiceAttributeSet
+                        unmodifiableView(PrintServiceAttributeSet attributeSet) {
+        if (attributeSet == null) {
+            throw new NullPointerException("Null attribute set");
+        }
+        return new UnmodifiablePrintServiceAttributeSet (attributeSet);
+    }
+
+    
+    public static Class
+        verifyAttributeCategory(Object object, Class interfaceName) {
+
+    //1.5 support requires the following changes 
+    //public static Class<?> verifyAttributeCategory(Object object,
+    //Class<?> interfaceName);   
+
+        if ( !(Attribute.class).isAssignableFrom(interfaceName) ){
+        throw new ClassCastException(interfaceName.getName()+" is not " +
+                            "interface Attribute or it's subinterface");
+        } else if ( interfaceName.isAssignableFrom((Class) object) ) {
+            return (Class) object;
+        } else {
+            throw new ClassCastException(object.getClass().getName()+
+                    "doesn't implement"+interfaceName.getName());
+        }
+    }
+ 
+    public static Attribute 
+        verifyAttributeValue(Object attribute, Class interfaceName) {
+    
+    //1.5 support requires the following changes 
+    //public static Attribute verifyAttributeValue(Object object,
+    //Class<?> interfaceName);
+        
+        if (attribute == null) {
+            throw new NullPointerException("Null attribute");
+        } else if ( interfaceName.isInstance(attribute) ) {
+            return (Attribute) attribute;
+        } else {
+            throw new ClassCastException("Object is not an instance of "
+                            + interfaceName.getName());
+        }
+    }
+    
+    public static void 
+        verifyCategoryForValue(Class attributeCategory, Attribute attribute) {
+    
+    //1.5 support requires the following changes 
+    //public static void verifyCategoryForValue(Class<?> category,
+    //Attribute attribute);
+        
+        if (!attributeCategory.equals (attribute.getCategory())) {
+            throw new IllegalArgumentException(attributeCategory.getName()+
+                            "is not equal to the category of the attribute"+
+                                attribute.getCategory().getName());
+        }
+
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DateTimeSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DateTimeSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DateTimeSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DateTimeSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,61 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public abstract class DateTimeSyntax implements Cloneable, Serializable {
+
+
+    private Date date;
+
+    protected DateTimeSyntax(Date value) {
+        if (value == null) {
+            throw new NullPointerException("Null date value");
+        }
+        date = value;
+    }
+
+    public boolean equals(Object object) {
+
+        if ((object instanceof DateTimeSyntax) &&
+                date.equals(((DateTimeSyntax) object).date) ) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public Date getValue() {
+        return new Date ( date.getTime() );
+    }
+
+    public int hashCode() {
+        return date.hashCode();
+    }
+
+    public String toString() {
+        return date.toString();
+    }
+
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttribute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttribute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttribute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttribute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,25 @@
+/*
+ *  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.3 $ 
+ */ 
+
+package javax.print.attribute;
+
+public interface DocAttribute extends Attribute {
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/DocAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,29 @@
+/*
+ *  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;
+
+public interface DocAttributeSet extends AttributeSet {
+
+    boolean add(Attribute attribute);
+
+    boolean addAll(AttributeSet attributeSet);
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/EnumSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/EnumSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/EnumSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/EnumSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,99 @@
+/*
+ *  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;
+
+import java.io.InvalidObjectException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+public abstract class EnumSyntax implements Cloneable, Serializable {
+
+
+    private int value;
+
+    protected EnumSyntax(int intValue) {
+        value = intValue;
+    }
+
+    public Object clone() {
+        return this;
+    }
+
+    protected  EnumSyntax[] getEnumValueTable() {
+        return null;
+    }
+
+    protected  int getOffset() {
+        return 0;
+    }
+
+    protected  String[] getStringTable() {
+        return null;
+    }
+
+    public int getValue() {
+        return value;
+     }
+
+    public int hashCode() {
+        return value;
+    }
+
+    protected Object readResolve() throws ObjectStreamException {
+
+        int offset = getOffset();
+        int i = value - offset;
+        EnumSyntax[] enumTable = getEnumValueTable();
+
+        if (enumTable == null) {
+            throw new InvalidObjectException("Null enumeration value table");
+        }
+
+        if ( (i < 0) || (i > enumTable.length-1) ) {
+            throw new InvalidObjectException("Value = " + value +
+                    " is not in valid range (" + offset + ","
+                        +(offset + enumTable.length-1) + ")" );
+        }
+
+        EnumSyntax outcome = enumTable[i];
+
+        if (outcome == null) {
+            throw new InvalidObjectException("Null enumeration value");
+        }
+
+        return outcome;
+
+    }
+
+    public String toString() {
+
+        int i = value - getOffset();
+        String[] stringTable = getStringTable();
+        if ( (stringTable == null) || (i < 0) || (i > stringTable.length-1) ) {
+            //No string value corresponding to enumeration value
+            return Integer.toString(value);
+        } else {
+            return stringTable[i];
+        }
+    }
+
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,244 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+
+public class HashAttributeSet implements Serializable, AttributeSet {
+
+
+    private Class attributeInterfaceName;
+
+    private transient HashMap attributesMap = new HashMap();
+
+    public HashAttributeSet(){
+
+        this(Attribute.class);
+    }
+    
+    public HashAttributeSet(Attribute attribute){
+
+        this(attribute, Attribute.class);
+    }
+    
+    public HashAttributeSet(Attribute[] attributes) {
+
+        this(attributes, Attribute.class);
+    }
+  
+    public HashAttributeSet(AttributeSet attributeSet) {
+
+        this(attributeSet, Attribute.class);
+    }
+    
+    protected  HashAttributeSet(Class interfaceName) {
+    //1.5 support requires the following changes
+    //protected HashAttributeSet(Class<?> interfaceName) {
+
+        if (interfaceName == null) {
+            throw new NullPointerException("Null attribute interface");
+        }
+        attributeInterfaceName = interfaceName;
+    }
+    
+    protected  HashAttributeSet(Attribute attribute, Class interfaceName) {
+    //1.5 support requires the following changes
+    //protected HashAttributeSet(Attribute attribute, Class<?> interfaceName) {
+
+        if (interfaceName == null) {
+            throw new NullPointerException("Null attribute interface");
+        }
+        attributeInterfaceName = interfaceName;
+        add(attribute);
+    }
+
+    protected  HashAttributeSet(Attribute[] attributes, Class interfaceName) {
+    //1.5 support requires the following changes
+    //protected HashAttributeSet(Attribute[] attributes,
+    //Class<?> interfaceName) {
+
+        if (interfaceName == null) {
+            throw new NullPointerException("Null attribute interface");
+        }
+        attributeInterfaceName = interfaceName;
+        if (attributes != null) {
+            for (int i = 0; i < attributes.length; i++) {
+            add(attributes[i]);
+            }
+        }
+    }
+
+    protected  HashAttributeSet(AttributeSet attributeSet, Class interfaceName) {
+    //1.5 support requires the following changes
+    //protected HashAttributeSet(AttributeSet attributeSet,
+    //Class<?> interfaceName) {
+        
+        attributeInterfaceName = interfaceName;
+        if (attributeSet != null) {
+            Attribute[] attributes = attributeSet.toArray();
+            for (int i = 0; i < attributes.length; i++) {
+                add(attributes[i]);
+            }
+        }
+    }
+
+
+    private void readObject (ObjectInputStream ois)
+        throws ClassNotFoundException, IOException {
+
+        ois.defaultReadObject();
+        Attribute attribute;
+        attributesMap = new HashMap();
+        int n = ois.readInt();
+        for (int i = 0; i < n; i++) {
+            attribute = (Attribute) ois.readObject();
+            add(attribute);
+        }
+
+    }
+
+    private void writeObject (ObjectOutputStream oos) throws IOException {
+
+        oos.defaultWriteObject();
+        Attribute[] attributes = toArray();
+        int n = attributes.length;
+        oos.writeInt(n);
+        for (int i = 0; i < n; i++) {
+            oos.writeObject(attributes[i]);
+        }
+    }
+
+
+    public boolean add(Attribute attribute) {
+
+        Attribute newValue =
+            AttributeSetUtilities.verifyAttributeValue(attribute,
+                    attributeInterfaceName);
+        Object oldValue = attributesMap.put(attribute.getCategory(), newValue);
+        return  !attribute.equals(oldValue);
+    }
+
+    public boolean addAll(AttributeSet attributeSet) {
+
+        boolean outcome = true;
+        Attribute[] attributes = attributeSet.toArray();
+        for (int i = 0; i < attributes.length; i++) {
+            if ( !add(attributes[i])) {
+                outcome = false;
+            }
+        }
+        return outcome;
+    }
+
+    public void clear() {
+        attributesMap.clear();
+    }
+
+    public boolean containsKey(Class attributeCategory) {
+    //1.5 support requires the following changes
+    //public boolean containsKey(Class<?> attributeCategory) {
+
+        if (attributeCategory == null) {
+            return false;
+        }
+        return attributesMap.containsKey(attributeCategory);
+    }
+
+    public boolean containsValue(Attribute attribute) {
+
+        if (attribute == null){
+            return false;
+        }
+        Object curValue = attributesMap.get(attribute.getCategory());
+        return attribute.equals(curValue);
+    }
+
+    public boolean equals(Object object) {
+
+        if ( !(object instanceof AttributeSet) ||
+                ((AttributeSet) object).size() != size() ) {
+            return false;
+        }
+        Attribute[] attributes = toArray();
+        for (int i = 0; i < attributes.length; i++) {
+            if ( !((AttributeSet) object).containsValue(attributes[i]) ) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public Attribute get(Class attributeCategory) {
+    //1.5 support requires the following changes
+    //public Attribute get(Class<?> attributeCategory) {
+
+        AttributeSetUtilities.
+            verifyAttributeCategory(attributeCategory, Attribute.class);
+        return (Attribute) attributesMap.get(attributeCategory);
+    }
+
+    public int hashCode() {
+        return attributesMap.hashCode();
+    }
+
+    public boolean isEmpty() {
+        return attributesMap.isEmpty();
+    }
+
+    public boolean remove(Attribute attribute) {
+
+        if ( (attribute == null) ||
+                (attributesMap.remove(attribute.getCategory()) == null) ) {
+            return false;
+        }else {
+            return true;
+        }
+    }
+
+    public boolean remove(Class attributeCategory) {
+    //1.5 support requires the following changes
+    //public boolean remove(Class<?> attributeCategory) {
+
+        if ((attributeCategory == null) ||
+                (attributesMap.remove(attributeCategory) == null) ) {
+                return false;
+        } else {
+            return true;
+        }
+    }
+
+    public int size() {
+        return attributesMap.size();
+    }
+
+    public Attribute[] toArray() {
+
+        Attribute[] attributes = new Attribute[size()];
+        attributesMap.values().toArray(attributes);
+        return attributes;
+    }
+
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashDocAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashDocAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashDocAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashDocAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,45 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+public class HashDocAttributeSet 
+    extends HashAttributeSet implements Serializable, DocAttributeSet {
+
+    
+    public HashDocAttributeSet() {
+        super(DocAttribute.class);
+    }
+
+    public HashDocAttributeSet(DocAttribute attribute) {
+        super(attribute, DocAttribute.class);
+    }
+
+    public HashDocAttributeSet(DocAttribute[] attributes) {
+        super(attributes, DocAttribute.class);
+    }
+
+    public HashDocAttributeSet(DocAttributeSet attributeSet) {
+        super(attributeSet, DocAttribute.class);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintJobAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintJobAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintJobAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintJobAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,45 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+public class HashPrintJobAttributeSet 
+    extends HashAttributeSet implements Serializable, PrintJobAttributeSet {
+
+    
+    public HashPrintJobAttributeSet() {
+        super(PrintJobAttribute.class);
+    }
+
+    public HashPrintJobAttributeSet(PrintJobAttribute attribute) {
+        super(attribute, PrintJobAttribute.class);
+    }
+
+    public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {
+        super(attributes, PrintJobAttribute.class);
+    }
+
+    public HashPrintJobAttributeSet(PrintJobAttributeSet attributeSet) {
+        super(attributeSet, PrintJobAttribute.class);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintRequestAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintRequestAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintRequestAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintRequestAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,45 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+public class HashPrintRequestAttributeSet 
+    extends HashAttributeSet implements Serializable, PrintRequestAttributeSet {
+
+    
+    public HashPrintRequestAttributeSet() {
+        super(PrintRequestAttribute.class);
+    }
+
+    public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) {
+        super(attribute, PrintRequestAttribute.class);
+    }
+
+    public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) {
+        super(attributes, PrintRequestAttribute.class);
+    }
+
+    public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributeSet) {
+        super(attributeSet, PrintRequestAttribute.class);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintServiceAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintServiceAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintServiceAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/HashPrintServiceAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,45 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+public class HashPrintServiceAttributeSet 
+    extends HashAttributeSet implements Serializable, PrintServiceAttributeSet {
+
+
+    public HashPrintServiceAttributeSet() {
+        super(PrintServiceAttribute.class);
+    }
+
+    public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {
+        super(attribute, PrintServiceAttribute.class);
+    }
+
+    public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {
+        super(attributes, PrintServiceAttribute.class);
+    }
+
+    public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributeSet) {
+        super(attributeSet, PrintServiceAttribute.class);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.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;
+
+import java.io.Serializable;
+
+public abstract class IntegerSyntax implements Cloneable, Serializable {
+
+
+    private int value;
+
+
+    protected IntegerSyntax(int intValue) {
+        value = intValue;
+    }
+
+    protected IntegerSyntax(int intValue, int lowerBound, int upperBound) {
+
+        if ((intValue < lowerBound) || (intValue > upperBound)) {
+            throw new IllegalArgumentException("Value " + value +
+                    " not in valid range (" + lowerBound + "," +
+                        upperBound + ")" );
+        }
+        value = intValue;
+    }
+
+
+    public boolean equals(Object object) {
+
+        if ((object instanceof IntegerSyntax) &&
+                value == ((IntegerSyntax) object).value) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public int hashCode() {
+        return value;
+    }
+
+    public String toString() {
+        return Integer.toString(value);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttribute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttribute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttribute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttribute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,26 @@
+/*
+ *  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.3 $ 
+ */ 
+
+package javax.print.attribute;
+
+
+public interface PrintJobAttribute extends Attribute {
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintJobAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,30 @@
+/*
+ *  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;
+
+
+public interface PrintJobAttributeSet extends AttributeSet {
+
+    boolean add(Attribute attribute);
+
+    boolean addAll(AttributeSet attributeSet); 
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttribute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttribute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttribute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttribute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,26 @@
+/*
+ *  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.3 $ 
+ */ 
+
+package javax.print.attribute;
+
+
+public interface PrintRequestAttribute extends Attribute {
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintRequestAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,30 @@
+/*
+ *  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;
+
+
+public interface PrintRequestAttributeSet extends AttributeSet {
+
+    boolean add(Attribute attribute);
+
+    boolean addAll(AttributeSet attributeSet);
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttribute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttribute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttribute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttribute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,26 @@
+/*
+ *  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.3 $ 
+ */ 
+
+package javax.print.attribute;
+
+
+public interface PrintServiceAttribute extends Attribute {
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttributeSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttributeSet.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttributeSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/PrintServiceAttributeSet.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,30 @@
+/*
+ *  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;
+
+
+public interface PrintServiceAttributeSet extends AttributeSet {
+
+    boolean add(Attribute attribute);
+
+    boolean addAll(AttributeSet attributeSet); 
+  
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,127 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+
+public abstract class ResolutionSyntax implements Cloneable, Serializable {
+
+
+    public static final int DPI = 100;
+
+    public static final int DPCM = 254;
+
+
+    private int crossFeedRes;
+
+    private int feedRes;
+
+    
+    public ResolutionSyntax(int crossFeedResolution,
+                                        int feedResolution, int units) {
+
+        if (crossFeedResolution < 1) {
+            throw new IllegalArgumentException("CrossFeedResolution " +
+                                                    "is less than 1");
+        }
+        if (feedResolution < 1) {
+            throw new IllegalArgumentException("FeedResolution is less than 1");
+        }
+        if (units < 1) {
+            throw new IllegalArgumentException("Units is less than 1");
+        }
+        crossFeedRes = crossFeedResolution * units;
+        feedRes = feedResolution * units;
+    }
+
+
+    public boolean equals(Object object) {
+
+        if ((object instanceof ResolutionSyntax) &&
+                crossFeedRes == ((ResolutionSyntax) object).crossFeedRes &&
+                feedRes == ((ResolutionSyntax) object).feedRes) {
+                            return true;
+        } else {
+            return false;
+        }
+
+    }
+
+    public int getCrossFeedResolution(int units) {
+
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return Math.round( ((float) crossFeedRes)/units);
+
+    }
+
+    protected int getCrossFeedResolutionDphi() {
+        return crossFeedRes;
+    }
+
+    public int getFeedResolution (int units) {
+
+        if (units < 1) {
+            throw new IllegalArgumentException("units is less than 1");
+        }
+        return Math.round( ((float) feedRes)/units);
+    }
+
+    protected int getFeedResolutionDphi() {
+        return feedRes;
+    }
+
+    public int[] getResolution(int units) {
+        return new int[] { getCrossFeedResolution(units),
+                           getFeedResolution(units) };
+    }
+
+    public int hashCode() {
+        return ( crossFeedRes | (feedRes << 16) );
+    }
+
+    public boolean lessThanOrEquals (ResolutionSyntax resolutionSyntax) {
+
+        if ( crossFeedRes <= resolutionSyntax.crossFeedRes &&
+                feedRes <= resolutionSyntax.feedRes ) {
+                    return true;
+        } else {
+            return false;
+        }
+
+    }
+
+    public String toString() {
+        return (crossFeedRes + "x" + feedRes + " dphi");
+    }
+
+    public String toString (int units, String unitsName) {
+        if (unitsName == null) {
+            unitsName = "";
+        }
+        return (getCrossFeedResolution(units) + "x" + getFeedResolution(units) +
+                    " " + unitsName);
+    }
+
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,338 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+
+public abstract class SetOfIntegerSyntax implements Cloneable, Serializable {
+
+
+    private int[][] canonicalArray;
+
+
+    protected  SetOfIntegerSyntax(int value) {
+
+        if (value < 0) {
+            throw new IllegalArgumentException ("Value " + value +
+                    " is less than 0");
+        }
+        canonicalArray = new int[][] {{value, value} };
+
+    }
+
+    protected  SetOfIntegerSyntax(int lowerBound, int upperBound) {
+
+        if (lowerBound <= upperBound) {
+            if (lowerBound < 0) {
+                throw new IllegalArgumentException ("Lower bound is less than 0");
+            } else {
+                canonicalArray = new int[][] {{lowerBound, upperBound} };
+            }
+        } else {
+            canonicalArray = new int[0][];
+        }
+
+    }
+
+    protected  SetOfIntegerSyntax(int[][] values) {
+        if (values == null) {
+            canonicalArray = new int[0][];
+        } else {
+            canonicalArray = rearrange(values);
+        }
+    }
+
+    protected  SetOfIntegerSyntax(String values) {
+        if (values == null) {
+            canonicalArray = new int[0][];
+        } else {
+            canonicalArray = parse(values);
+        }
+    }
+
+    /*
+     * Parses given string containing set of integer and
+     * returns this set in cannonical array form.
+     * One after another integer intervals are extracted from the string
+     * according comma-separated integer groups and than these intervals
+     * are organized in cannonical array form.
+     */
+    private static int[][] parse(String values) {
+
+        int flag;
+        long num1long; /*first number in a range*/
+        long num2long; /*second number in a range*/
+        char symbol;
+
+        /*vector for storing integer intervals in cannonical form*/
+        Vector vector = new Vector();
+
+        /*obtain an array of intervals from the string*/
+        String[] str = values.split(",");
+        int n = str.length;
+
+        /*take next interval*/
+        for (int i = 0; i < n; i++) {
+            flag = 0;
+            num1long = 0;
+            num2long = 0;
+
+            /*take next literal in interval*/
+            for (int j = 0; j < str[i].length(); j++) {
+                symbol = str[i].charAt(j);
+                switch(flag) {
+
+                    /*before the first number*/
+                    case 0:
+                        if(Character.isWhitespace(symbol)) {
+                            continue;
+                        } else if(Character.isDigit(symbol) ) {
+                            num1long = Character.digit(symbol,10);
+                            num2long = num1long;
+                            flag = 1;
+                        } else {
+                            throw new IllegalArgumentException();
+                        }
+                        break;
+
+                    /*before the separator*/
+                    case 1:
+                        if(Character.isWhitespace(symbol)) {
+                            continue;
+                        } else if(Character.isDigit(symbol)) {
+                            num1long = num1long*10 + Character.digit(symbol,10);
+                            if (num1long > Integer.MAX_VALUE) {
+                                throw new IllegalArgumentException(num1long +
+                                            " is out of int range");
+                            }
+                            num2long = num1long;
+                        } else if( (symbol == ':') || (symbol == '-')) {
+                            flag = 2;
+                        } else {
+                            throw new IllegalArgumentException();
+                        }
+                        break;
+
+                    /*before the second number*/
+                    case 2:
+                        if(Character.isWhitespace(symbol)) {
+                            continue;
+                        } else if(Character.isDigit(symbol)) {
+                            num2long = Character.digit(symbol,10);
+                            flag = 3;
+                        } else {
+                            throw new IllegalArgumentException();
+                        }
+                        break;
+
+                    /*afrer the first digit of second number*/
+                    case 3:
+                        if(Character.isWhitespace(symbol)) {
+                            continue;
+                        } else if(Character.isDigit(symbol)) {
+                            num2long = num2long*10 + Character.digit(symbol,10);
+                            if (num2long > Integer.MAX_VALUE) {
+                                throw new IllegalArgumentException(num2long +
+                                            " is out of int range");
+                            }
+                        } else {
+                            throw new IllegalArgumentException();
+                        }
+                        break;
+                }
+            }
+
+            /*Add the int interval to the vector if the interval in the
+              string form had legal syntax*/
+
+            if (((flag == 1) || (flag == 3)) && (num1long <= num2long)) {
+                addRange(vector, (int) num1long, (int) num2long);
+            }
+        }
+        return (int[][]) vector.toArray(new int[vector.size()][]);
+    }
+
+    /*
+     * Work this array out to cannonical array form.
+     */
+    private static int[][] rearrange(int[][] values) {
+
+        Vector vector = new Vector();
+        int num1;
+        int num2;
+        for (int i = 0; i < values.length; i++) {
+            if (values[i] == null) {
+                throw new NullPointerException("int[][] array has null element");
+            }
+            if (values[i].length == 1) {
+                num1 = values[i][0];
+                num2 = values[i][0];
+            } else if (values[i].length == 2) {
+                num1 = values[i][0];
+                num2 = values[i][1];
+            } else {
+                throw new IllegalArgumentException("Only array of length-1 " +
+                   "or length-2 arrays of ints are valid");
+            }
+            if (num1 < 0) {
+                throw new IllegalArgumentException("Valid values are " +
+                                                            "not less than 0");
+            } else if (num1 <= num2) {
+                addRange(vector, num1, num2);
+            }
+        }
+        return (int[][]) vector.toArray(new int[vector.size()][]);
+    }
+
+    /*
+     * Adds interval [lowerBound, upperBound] to the vector containing
+     * intervals in cannoical form and modifies it so that cannonical form
+     * is saved.
+     */
+    private static void addRange(Vector vector,
+                                    int lowerBound, int upperBound) {
+
+        int l1; /*lowerBound of the first interval*/
+        int u1; /*upperBound of the first interval*/
+
+        int l2; /*lowerBound of the next interval*/
+        int u2; /*upperBound of the next interval*/
+
+        /*add interval [lowerBound, upperBound] to the vector*/
+        vector.add(new int[] {lowerBound, upperBound});
+
+        /*enumerate all intervals in the vector*/
+        for (int i = vector.size()-2; i >= 0; i--) {
+            l1 = ((int[]) vector.elementAt(i))[0];
+            u1 = ((int[]) vector.elementAt(i))[1];
+            l2 = ((int[]) vector.elementAt(i+1))[0];
+            u2 = ((int[]) vector.elementAt(i+1))[1];
+
+            /*check if two consecutive intervals overlap*/
+            if ( Math.max(l1, l2) - Math.min(u1, u2) <= 1) {
+
+                /*make new interval from two consecutive intervals
+                  contained all theirs elements*/
+                vector.setElementAt(new int[] { Math.min(l1, l2),
+                                                Math.max(u1, u2) }, i);
+                vector.removeElementAt(i+1);
+
+            /*if two consecutive intervals doesn't overlap but
+              lowerBound of the first interval is bigger than
+              upperBound of the next interval
+              than interchange theirs position*/
+            } else if (l1 > u2) {
+                vector.setElementAt(new int[] {l2,u2}, i);
+                vector.setElementAt(new int[] {l1,u1}, i+1);
+            } else {
+                break;
+            }
+        }
+    }
+
+
+    public boolean contains(int value) {
+
+        for (int i = 0; i < canonicalArray.length; i++) {
+            if ( (value >= canonicalArray[i][0]) &&
+                    (value <= canonicalArray[i][1]) ) {
+                        return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean contains(IntegerSyntax attribute) {
+        return contains(attribute.getValue());
+    }
+
+    public boolean equals(Object object) {
+
+        if (object instanceof SetOfIntegerSyntax) {
+
+            int[][] compare = ((SetOfIntegerSyntax)object).canonicalArray;
+            int n = compare.length;
+            if (n == canonicalArray.length) {
+                for (int i = 0; i < n; i++) {
+                    if ( (canonicalArray[i][0] != compare[i][0]) ||
+                            (canonicalArray[i][1] != compare[i][1]) ) {
+                                return false;
+                    }
+                }
+                return true;
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    public int[][] getMembers() {
+
+        int n = canonicalArray.length;
+        int[][] members = new int[n][];
+        for (int i = 0; i < n; i++) {
+            members[i] = new int[] {canonicalArray[i][0], canonicalArray[i][1]};
+        }
+        return members;
+    }
+
+    public int hashCode() {
+
+        int hashCode = 0;
+        for (int i = 0; i < canonicalArray.length; i++) {
+            hashCode += canonicalArray[i][0] + canonicalArray[i][1];
+        }
+        return hashCode;
+    }
+
+    public int next(int value) {
+
+        for (int i = 0; i < canonicalArray.length; i++) {
+            if (value < canonicalArray[i][0]) {
+                return canonicalArray[i][0];
+            } else if (value < canonicalArray[i][1]) {
+                return value+1;
+            }
+        }
+        return -1;
+    }
+
+    public String toString() {
+
+        StringBuffer stringSet = new StringBuffer("");
+        for (int i = 0; i < canonicalArray.length; i++) {
+            if (i > 0) {
+                stringSet.append(",");
+            }
+            stringSet.append (canonicalArray[i][0]);
+            if (canonicalArray[i][0] != canonicalArray[i][1]) {
+                stringSet.append("-");
+                stringSet.append(canonicalArray[i][1]);
+            }
+        }
+        return stringSet.toString();
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,115 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+
+
+public abstract class Size2DSyntax implements Cloneable, Serializable {
+
+
+    public static final int INCH = 25400;
+
+    public static final int MM = 1000;
+
+    private int x;
+
+    private int y;
+
+
+    protected Size2DSyntax(int x, int y, int units) {
+
+        if ((x < 0) || (y < 0) || (units < 1)) {
+            throw new IllegalArgumentException("Valid values are:" +
+                                            "x>=0, y>=0, units>=1");
+        }
+        this.x = x*units;
+        this.y = y*units;
+
+    }
+
+    protected Size2DSyntax(float x, float y, int units) {
+
+        if ( (x < 0.0f) || (y < 0.0f) || (units < 1) ) {
+            throw new IllegalArgumentException("Valid values are:" +
+                                            "x>=0.0, y>=0.0, units>=1");
+        }
+        this.x = Math.round(x*units);
+        this.y = Math.round(y*units);
+
+    }
+
+    public boolean equals(Object object) {
+
+        if ((object instanceof Size2DSyntax) &&
+                (x == ((Size2DSyntax) object).x ) &&
+                    (y == ((Size2DSyntax) object).y)) {
+                            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public float[] getSize(int units) {
+        return new float[] { getX(units),
+                             getY(units) };
+    }
+
+    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;
+    }
+
+    protected int getXMicrometers() {
+        return x;
+    }
+
+    protected int getYMicrometers() {
+        return y;
+    }
+
+    public int hashCode() {
+        return ( y | (x << 16) );
+    }
+
+    public String toString() {
+        return (x + "x" + y + " um");
+    }
+
+    public String toString(int units, String unitsName) {
+        if (unitsName == null) {
+            unitsName = "";
+        }
+        return (getX(units) + "x" + getX(units) + " " + unitsName);
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SupportedValuesAttribute.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SupportedValuesAttribute.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SupportedValuesAttribute.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/SupportedValuesAttribute.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,26 @@
+/*
+ *  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.3 $ 
+ */ 
+
+package javax.print.attribute;
+
+
+public interface SupportedValuesAttribute extends Attribute {
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/TextSyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/TextSyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/TextSyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/TextSyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,77 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+
+public abstract class TextSyntax implements Cloneable, Serializable {
+
+
+    private String text;
+
+    private Locale locale;
+
+
+    protected TextSyntax(String textValue, Locale textLocale) {
+
+        if (textValue == null) {
+            throw new NullPointerException("Text is null");
+        } else {
+            text = textValue;
+        }
+
+        if (textLocale == null) {
+            locale = Locale.getDefault();
+        } else {
+            locale = textLocale;
+        }
+    }
+    
+    
+    public boolean equals(Object object) {
+
+        if ((object instanceof TextSyntax) &&
+                text.equals( ((TextSyntax) object).text ) &&
+                    locale.equals( ((TextSyntax) object).locale )) {
+            return true;
+        }
+        return false;
+    }
+    
+    public Locale getLocale() {
+        return locale;
+    } 
+
+    public String getValue() {
+        return text;
+    }
+
+    public int hashCode() {
+        return text.hashCode() + locale.hashCode();
+    }   
+    
+    public String toString(){
+        return text;
+    }
+           
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/URISyntax.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/URISyntax.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/URISyntax.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/URISyntax.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,65 @@
+/*
+ *  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;
+
+import java.io.Serializable;
+import java.net.URI;
+
+
+public abstract class URISyntax implements Cloneable, Serializable {
+
+
+    private URI uri;
+
+
+    protected URISyntax (URI uriValue) {
+
+        if (uriValue == null) {
+            throw new NullPointerException("Null uri value");
+        } else {
+            uri = uriValue;
+        }
+    }
+
+
+    public boolean equals(Object object) {
+
+        if ((object instanceof URISyntax) &&
+                uri.equals (((URISyntax) object).uri)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public URI getURI()  {
+        return uri;
+    }
+
+    public int hashCode() {
+        return uri.hashCode();
+     }
+
+    public String toString() {
+        return uri.toString();
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/UnmodifiableSetException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/UnmodifiableSetException.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/UnmodifiableSetException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/UnmodifiableSetException.java Sun Oct  8 22:33:09 2006
@@ -0,0 +1,35 @@
+/*
+ *  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;
+
+
+public class UnmodifiableSetException extends RuntimeException {
+
+    public UnmodifiableSetException() {
+        super();
+    }
+
+    public UnmodifiableSetException(String exceptionInformation) {
+        super(exceptionInformation);
+
+    }
+
+}

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

Added: incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Chromaticity.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/Chromaticity.java?view=auto&rev=454289
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Chromaticity.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/H-1609/modules/print/src/main/java/common/javax/print/attribute/standard/Chromaticity.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.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 final class Chromaticity extends EnumSyntax 
+    implements DocAttribute, PrintJobAttribute, PrintRequestAttribute {
+
+
+    public static final Chromaticity MONOCHROME = new Chromaticity(0);
+
+    public static final Chromaticity COLOR = new Chromaticity(1);
+
+
+    private static final Chromaticity[] enumValueTable = { MONOCHROME,
+                                                           COLOR };
+
+    private static final String[] stringTable = { "monochrome",
+                                                  "color" };
+    
+    
+    protected Chromaticity(int value) {
+        super(value);
+    }
+    
+    
+    public final Class getCategory() {
+    /* 1.5 support requires the following changes 
+       Class<? extends Attribute> getCategory() { */
+        return Chromaticity.class;
+    }
+    
+    protected EnumSyntax[] getEnumValueTable() {
+        return enumValueTable;
+    }
+    
+    protected String[] getStringTable() {
+        return stringTable;
+    }
+
+    public final String getName() {
+        return "chromaticity";
+    }
+
+
+}

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



Mime
View raw message