2004-04-20 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Tue, 20 Apr 2004 10:48:56 +0000 (10:48 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 20 Apr 2004 10:48:56 +0000 (10:48 +0000)
* javax/print/attribute/EnumSyntax.java
(getOffset): Made protected.
* javax/print/attribute/HashAttributeSet.java
(HashAttributeSet): Likewise.
* javax/print/attribute/ResolutionSyntax.java
(getFeedResolution): Fixed typo in exception name.
(getCrossFeedResolution): Likewise.
* javax/print/attribute/SetOfIntegerSyntax.java
(SetOfIntegerSyntax): Fixed HTML entities in javadoc.
* javax/print/attribute/TextSyntax.java
(TextSyntax): Handle locale correctly.
(hashCode): Calc better hashcode value.
(equals): Fixed @return tag.
(toString): New method.

From-SVN: r80892

libjava/ChangeLog
libjava/javax/print/attribute/EnumSyntax.java
libjava/javax/print/attribute/HashAttributeSet.java
libjava/javax/print/attribute/ResolutionSyntax.java
libjava/javax/print/attribute/SetOfIntegerSyntax.java
libjava/javax/print/attribute/TextSyntax.java

index 9bc39aa5e4be24e32448ea848f6880735fa61b37..434e91c1c3c3f040341773a0b88b8486bc2db6bc 100644 (file)
@@ -1,3 +1,20 @@
+2004-04-20  Michael Koch  <konqueror@gmx.de>
+
+       * javax/print/attribute/EnumSyntax.java
+       (getOffset): Made protected.
+       * javax/print/attribute/HashAttributeSet.java
+       (HashAttributeSet): Likewise.
+       * javax/print/attribute/ResolutionSyntax.java
+       (getFeedResolution): Fixed typo in exception name.
+       (getCrossFeedResolution): Likewise.
+       * javax/print/attribute/SetOfIntegerSyntax.java
+       (SetOfIntegerSyntax): Fixed HTML entities in javadoc.
+       * javax/print/attribute/TextSyntax.java
+       (TextSyntax): Handle locale correctly.
+       (hashCode): Calc better hashcode value.
+       (equals): Fixed @return tag.
+       (toString): New method.
+
 2004-04-20  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/nio/FileLockImpl.java
index 4a87c975a6f6e136d9b3031e6c88a5d7dc833a45..aa82ccc6bb855e5c2d350c9e043838fd93933390 100644 (file)
@@ -139,7 +139,7 @@ public abstract class EnumSyntax implements Cloneable, Serializable
     return null;
   }
 
-  public int getOffset()
+  protected int getOffset()
   {
     return 0;
   }
index 63b4105cb42cf43619ca23839763d7458423ca20..af5b3d188f3cacf1aa8f8e98caa88fdac3af9a67 100644 (file)
@@ -151,7 +151,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
    * @exception ClassCastException if any element of attributes is not an
    * interface of interfaceName
    */
-  public HashAttributeSet(AttributeSet attributes, Class interfaceName)
+  protected HashAttributeSet(AttributeSet attributes, Class interfaceName)
   {
     this(interfaceName);
     
index 592d995df7de4d214ce797e4d96a44b57317fd1d..4eba85499ffb75f5964d54696146e12f7c1f453c 100644 (file)
@@ -104,7 +104,7 @@ public abstract class ResolutionSyntax
    *
    * @return the resolution
    *
-   * @exception IllegalArgumenException if units < 1
+   * @exception IllegalArgumentException if units < 1
    */
   public int getCrossFeedResolution(int units)
   {
@@ -130,7 +130,7 @@ public abstract class ResolutionSyntax
    *
    * @return the resolution
    *
-   * @exception IllegalArgumenException if units < 1
+   * @exception IllegalArgumentException if units < 1
    */
   public int getFeedResolution(int units)
   {
index d4e7fde00c2b70a21e9120328c12da8ca058ca39..7c022125f454bd01069e5a78f33f8377f870b920 100644 (file)
@@ -148,8 +148,8 @@ public abstract class SetOfIntegerSyntax
    * @param lowerBound the lower bound value
    * @param upperBound the upper bound value
    *
-   * @exception IllegalArgumentException if lowerBound <= uppbound
-   * and lowerBound < 0
+   * @exception IllegalArgumentException if lowerBound &lt;= upperbound
+   * and lowerBound &lt; 0
    */
   protected SetOfIntegerSyntax(int lowerBound, int upperBound)
   {
index 51909be9803e12bd2307d1399a716726aac530c6..ebad88b654189252ba8fca318c5b9345c5d5a569 100644 (file)
@@ -1,5 +1,5 @@
 /* TextSyntax.java -- 
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -57,12 +57,12 @@ public abstract class TextSyntax implements Cloneable, Serializable
    * @param value the value for this syntax
    * @param locale the locale to use
    *
-   * @exception NullPointerException if value is null
+   * @exception NullPointerException if value and/or locale is null
    */
   protected TextSyntax(String value, Locale locale)
   {
-    if (value == null)
-      throw new NullPointerException("value may not be null");
+    if (value == null || locale == null)
+      throw new NullPointerException("value and/or locale may not be null");
 
     this.value = value;
     this.locale = locale;
@@ -95,7 +95,7 @@ public abstract class TextSyntax implements Cloneable, Serializable
    */
   public int hashCode()
   {
-    return value.hashCode() + locale.hashCode();
+    return value.hashCode() ^ locale.hashCode();
   }
 
   /**
@@ -103,7 +103,7 @@ public abstract class TextSyntax implements Cloneable, Serializable
    *
    * @param obj the object to test
    *
-   * @returns true if both objects are equal, false otherwise.
+   * @return true if both objects are equal, false otherwise.
    */
   public boolean equals(Object obj)
   {
@@ -115,4 +115,12 @@ public abstract class TextSyntax implements Cloneable, Serializable
     return (value.equals(tmp.getValue())
             && locale.equals(tmp.getLocale()));
   }
+
+  /**
+   * Returns a string representing the object.
+   */
+  public String toString()
+  {
+    return value;
+  }
 }