classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: TextSyntax API docs additions and minor fixlet


From: Wolfgang Baer
Subject: [cp-patches] FYI: TextSyntax API docs additions and minor fixlet
Date: Sat, 19 Nov 2005 14:02:52 +0100
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Hi,

I added and enhanced api docs for SetOfIntegerSyntax

There is also one fix included. If the given locale to the constructor
is null the default locale as given by Locale.getDefault is to be used.

This change is backed by the mauve tests checked in earlier.

2005-11-19  Wolfgang Baer  <address@hidden>

        * javax/print/attribute/TextSyntax.java:
        Added and enhanced api docs for this class.
        (TextSyntax): If locale is null use the default locale.

Regards,
Wolfgang





Index: javax/print/attribute/TextSyntax.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/print/attribute/TextSyntax.java,v
retrieving revision 1.4
diff -u -r1.4 TextSyntax.java
--- javax/print/attribute/TextSyntax.java       2 Jul 2005 20:32:46 -0000       
1.4
+++ javax/print/attribute/TextSyntax.java       19 Nov 2005 13:00:01 -0000
@@ -1,5 +1,5 @@
 /* TextSyntax.java -- 
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -41,7 +41,14 @@
 import java.util.Locale;
 
 /**
- * @author Michael Koch
+ * <code>TextSyntax</code> is the abstract base class of all attribute 
+ * classes which provide a string as value (e.g. the location of the printer).
+ * <p>
+ * A <code>TextSyntax</code> instance consists of a string value and a
+ * locale which indicates the language of the locale of the string.
+ * </p>
+ *
+ * @author Michael Koch (address@hidden)
  */
 public abstract class TextSyntax implements Cloneable, Serializable
 {
@@ -55,23 +62,24 @@
    * and locale.
    *
    * @param value the value for this syntax
-   * @param locale the locale to use
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
    *
-   * @exception NullPointerException if value and/or locale is null
+   * @exception NullPointerException if value is null
    */
   protected TextSyntax(String value, Locale locale)
   {
-    if (value == null || locale == null)
-      throw new NullPointerException("value and/or locale may not be null");
-
+    if (value == null)
+      throw new NullPointerException("value may not be null");
+    
     this.value = value;
-    this.locale = locale;
+    this.locale = (locale == null ? Locale.getDefault() : locale);
   }
 
   /**
    * Returns the value of this syntax object.
    *
-   * @return the value
+   * @return The value.
    */
   public String getValue()
   {
@@ -81,7 +89,7 @@
   /**
    * Returns the locale of this syntax object.
    *
-   * @return the locale
+   * @return The locale.
    */
   public Locale getLocale()
   {
@@ -91,7 +99,7 @@
   /**
    * Returns the hashcode for this object.
    *
-   * @return the hashcode
+   * @return The hashcode.
    */
   public int hashCode()
   {
@@ -99,7 +107,7 @@
   }
 
   /**
-   * Tests of obj is equal to this object.
+   * Tests if the given object is equal to this object.
    *
    * @param obj the object to test
    *
@@ -117,7 +125,10 @@
   }
 
   /**
-   * Returns a string representing the object.
+   * Returns a string representing the object. The returned
+   * string is the underlying text value of this object.
+   * 
+   * @return The string representation.
    */
   public String toString()
   {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]