Ignore:
Timestamp:
2003-05-27T15:57:37+12:00 (21 years ago)
Author:
kjdon
Message:

re-tabbed the code for java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/Language.java

    r4293 r4366  
    5656*/
    5757public class Language
    58     implements Comparable {
    59     /** Is this language the default one. */
    60     private boolean default_language = false;
    61     /** The name of this language. */
    62     private String name = null;
    63     /** The two character code for this language. */
    64     private String value = null;
    65     /** Constructor.
    66       * @param value A <strong>String</strong> representing the code for this language.
    67       * @param name A <strong>String</strong> representing the name of this language.
    68       * @param default_language A <i>boolean</i> which is <i>true</i> if this language is the default one.
     58    implements Comparable {
     59    /** Is this language the default one. */
     60    private boolean default_language = false;
     61    /** The name of this language. */
     62    private String name = null;
     63    /** The two character code for this language. */
     64    private String value = null;
     65    /** Constructor.
     66     * @param value A <strong>String</strong> representing the code for this language.
     67     * @param name A <strong>String</strong> representing the name of this language.
     68     * @param default_language A <i>boolean</i> which is <i>true</i> if this language is the default one.
    6969      */
    70     public Language(String value, String name, boolean default_language) {
    71           this.default_language = default_language;
    72           this.name = name;
    73           this.value = value.substring(0, 2);
    74     }
    75     /** Copy constructor.
     70    public Language(String value, String name, boolean default_language) {
     71    this.default_language = default_language;
     72    this.name = name;
     73    this.value = value.substring(0, 2);
     74    }
     75    /** Copy constructor.
    7676      * @param language The <strong>Language</strong> we want to copy.
    7777      */
    78     public Language(Language language) {
    79           this.default_language = language.isDefault();
    80           this.name = language.toString();
    81           this.value = language.getCode();
    82     }
    83     /** Method to compare two languages for ordering purposes.
     78    public Language(Language language) {
     79    this.default_language = language.isDefault();
     80    this.name = language.toString();
     81    this.value = language.getCode();
     82    }
     83    /** Method to compare two languages for ordering purposes.
    8484      * @param object The other language as an <strong>Object</strong>.
    8585      * @return An <i>int</i> which indicates order using the same values as in String.compareTo().
    8686      * @see java.lang.String#compareTo
    8787      */
    88     public int compareTo(Object object) {
    89           return toString().compareTo(object.toString());
    90     }
    91     /** Method to test for the equality of two languages.
     88    public int compareTo(Object object) {
     89    return toString().compareTo(object.toString());
     90    }
     91    /** Method to test for the equality of two languages.
    9292      * @param object The other language as an <strong>Object</strong>.
    9393      * @return <i>true</i> if the languages are equal, <i>false</i> otherwise.
    9494      */
    95     public boolean equals(Object object) {
    96           if(compareTo(object) == 0) {
    97                 return true;
    98           }
    99           return false;
    100     }
    101     /** Method to retrieve the code of this language.
     95    public boolean equals(Object object) {
     96    if(compareTo(object) == 0) {
     97        return true;
     98    }
     99    return false;
     100    }
     101    /** Method to retrieve the code of this language.
    102102      * @return A <strong>String</strong> representing the two letter code.
    103103      */
    104     public String getCode() {
    105           return value;
    106     }
    107     /** Method to determine if this language is the default one.
     104    public String getCode() {
     105    return value;
     106    }
     107    /** Method to determine if this language is the default one.
    108108      * @return A <i>boolean</i> which is <i>true</i> if this language is the default one.
    109109      */
    110     public boolean isDefault() {
    111           return default_language;
    112     }
    113     /** Method to set the value of default.
     110    public boolean isDefault() {
     111    return default_language;
     112    }
     113    /** Method to set the value of default.
    114114      * @param value The new value of default as a <i>boolean</i>.
    115115      */
    116     public void setDefault(boolean value) {
    117           this.default_language = default_language;
    118     }
    119     /** Method to display the language code.
     116    public void setDefault(boolean value) {
     117    this.default_language = default_language;
     118    }
     119    /** Method to display the language code.
    120120      * @return A <strong>String</strong> representing the language code.
    121121      */
    122     public String toString() {
    123           return name;
    124     }
     122    public String toString() {
     123    return name;
     124    }
    125125}
    126126
Note: See TracChangeset for help on using the changeset viewer.