diff options
author | Wolfgang Baer <WBaer@gmx.de> | 2005-11-19 13:10:17 +0000 |
---|---|---|
committer | Wolfgang Baer <WBaer@gmx.de> | 2005-11-19 13:10:17 +0000 |
commit | 6171f93c82b868b420176746d7f31f21c8db0201 (patch) | |
tree | 5393eadcd8e243ad3afaad372c7662913776903a /javax | |
parent | 6f1bce2d1aa5f4b62e4145271e00c735c19a74fd (diff) | |
download | classpath-6171f93c82b868b420176746d7f31f21c8db0201.tar.gz |
2005-11-19 Wolfgang Baer <WBaer@gmx.de>
* javax/print/attribute/TextSyntax.java:
Added and enhanced api docs for this class.
(TextSyntax): If locale is null use the default locale.
Diffstat (limited to 'javax')
-rw-r--r-- | javax/print/attribute/TextSyntax.java | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/javax/print/attribute/TextSyntax.java b/javax/print/attribute/TextSyntax.java index 98fabdc67..2daab6ec3 100644 --- a/javax/print/attribute/TextSyntax.java +++ b/javax/print/attribute/TextSyntax.java @@ -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.io.Serializable; 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 (konqueror@gmx.de) */ public abstract class TextSyntax implements Cloneable, Serializable { @@ -55,23 +62,24 @@ public abstract class TextSyntax implements Cloneable, Serializable * 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 @@ public abstract class TextSyntax implements Cloneable, Serializable /** * Returns the locale of this syntax object. * - * @return the locale + * @return The locale. */ public Locale getLocale() { @@ -91,7 +99,7 @@ public abstract class TextSyntax implements Cloneable, Serializable /** * Returns the hashcode for this object. * - * @return the hashcode + * @return The hashcode. */ public int hashCode() { @@ -99,7 +107,7 @@ public abstract class TextSyntax implements Cloneable, Serializable } /** - * 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 @@ public abstract class TextSyntax implements Cloneable, Serializable } /** - * 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() { |