org.crosswire.common.util
Class Language

java.lang.Object
  extended by org.crosswire.common.util.Language
All Implemented Interfaces:
Comparable

public class Language
extends Object
implements Comparable

A single language, paring an ISO-639 code to a localized representation of the language.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
private  String code
           
static Language DEFAULT_LANG
           
private  boolean knowsDirection
           
private  boolean ltor
           
private  String name
           
 
Constructor Summary
Language(String iso639Code)
          A single language defined by an ISO-639 code.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object obj)
           
 String getCode()
          Get the language code.
 String getName()
          Get the language name.
 int hashCode()
           
 boolean isLeftToRight()
          Determine whether this language is a Left-to-Right or a Right-to-Left language.
 boolean isValidLanguage()
          Determine whether this language is valid.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LANG

public static final Language DEFAULT_LANG

code

private String code

name

private String name

knowsDirection

private boolean knowsDirection

ltor

private boolean ltor
Constructor Detail

Language

public Language(String iso639Code)
A single language defined by an ISO-639 code. If the code is null or empty then it is considered to be DEFAULT_LANG_CODE (that is, English).

Parameters:
iso639Code - the particular language
Method Detail

isValidLanguage

public boolean isValidLanguage()
Determine whether this language is valid. The code is valid if it is in iso639.properties.

Returns:
true if the language is valid.

getCode

public String getCode()
Get the language code.

Returns:
the code for the language

getName

public String getName()
Get the language name.

Returns:
the name of the language

isLeftToRight

public boolean isLeftToRight()
Determine whether this language is a Left-to-Right or a Right-to-Left language.

Returns:
true if the language is Left-to-Right.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

Copyright ยจ 2003-2007