/[classpath]/classpath/javax/print/attribute/TextSyntax.java
ViewVC logotype

Diff of /classpath/javax/print/attribute/TextSyntax.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.2.1 by gnu_andrew, Tue Aug 2 20:12:36 2005 UTC revision 1.3.2.2 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 1  Line 1 
1  /* TextSyntax.java --  /* TextSyntax.java --
2     Copyright (C) 2003, 2004 Free Software Foundation, Inc.     Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 41  import java.io.Serializable; Line 41  import java.io.Serializable;
41  import java.util.Locale;  import java.util.Locale;
42    
43  /**  /**
44   * @author Michael Koch   * <code>TextSyntax</code> is the abstract base class of all attribute
45     * classes which provide a string as value (e.g. the location of the printer).
46     * <p>
47     * A <code>TextSyntax</code> instance consists of a string value and a
48     * locale which indicates the language of the locale of the string.
49     * </p>
50     *
51     * @author Michael Koch (konqueror@gmx.de)
52   */   */
53  public abstract class TextSyntax implements Cloneable, Serializable  public abstract class TextSyntax implements Cloneable, Serializable
54  {  {
# Line 55  public abstract class TextSyntax impleme Line 62  public abstract class TextSyntax impleme
62     * and locale.     * and locale.
63     *     *
64     * @param value the value for this syntax     * @param value the value for this syntax
65     * @param locale the locale to use     * @param locale the locale to use, if <code>null</code> the default
66       * locale is used.
67     *     *
68     * @exception NullPointerException if value and/or locale is null     * @exception NullPointerException if value is null
69     */     */
70    protected TextSyntax(String value, Locale locale)    protected TextSyntax(String value, Locale locale)
71    {    {
72      if (value == null || locale == null)      if (value == null)
73        throw new NullPointerException("value and/or locale may not be null");        throw new NullPointerException("value may not be null");
74        
75      this.value = value;      this.value = value;
76      this.locale = locale;      this.locale = (locale == null ? Locale.getDefault() : locale);
77    }    }
78    
79    /**    /**
80     * Returns the value of this syntax object.     * Returns the value of this syntax object.
81     *     *
82     * @return the value     * @return The value.
83     */     */
84    public String getValue()    public String getValue()
85    {    {
# Line 81  public abstract class TextSyntax impleme Line 89  public abstract class TextSyntax impleme
89    /**    /**
90     * Returns the locale of this syntax object.     * Returns the locale of this syntax object.
91     *     *
92     * @return the locale     * @return The locale.
93     */     */
94    public Locale getLocale()    public Locale getLocale()
95    {    {
# Line 91  public abstract class TextSyntax impleme Line 99  public abstract class TextSyntax impleme
99    /**    /**
100     * Returns the hashcode for this object.     * Returns the hashcode for this object.
101     *     *
102     * @return the hashcode     * @return The hashcode.
103     */     */
104    public int hashCode()    public int hashCode()
105    {    {
# Line 99  public abstract class TextSyntax impleme Line 107  public abstract class TextSyntax impleme
107    }    }
108    
109    /**    /**
110     * Tests of obj is equal to this object.     * Tests if the given object is equal to this object.
111     *     *
112     * @param obj the object to test     * @param obj the object to test
113     *     *
# Line 117  public abstract class TextSyntax impleme Line 125  public abstract class TextSyntax impleme
125    }    }
126    
127    /**    /**
128     * Returns a string representing the object.     * Returns a string representing the object. The returned
129       * string is the underlying text value of this object.
130       *
131       * @return The string representation.
132     */     */
133    public String toString()    public String toString()
134    {    {

Legend:
Removed from v.1.3.2.1  
changed lines
  Added in v.1.3.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26