org.basex.util.ft
Class Language

java.lang.Object
  extended by org.basex.util.ft.Language
All Implemented Interfaces:
java.lang.Comparable<Language>

public final class Language
extends java.lang.Object
implements java.lang.Comparable<Language>

This class contains language tokens which are valid for the xml:lang attribute. As specified by W3C, the values of the attribute are language identifiers as defined by IETF BCP 47, Tags for the Identification of Languages.

Author:
BaseX Team 2005-12, BSD License, Dimitar Popov, Jens Erat
See Also:
http://www.w3.org/TR/REC-xml/#sec-lang-tag, http://tools.ietf.org/html/bcp47, http://www.iana.org/assignments/language-subtag-registry

Method Summary
 int compareTo(Language o)
           
static Language def()
          Returns the user language as default language, or English, if the user language cannot be assigned.
 boolean equals(java.lang.Object o)
           
static Language get(Prop prop)
          Returns an instance for the current language property, or English as default language.
static Language get(java.lang.String lang)
          Returns an instance for the specified language code, or null.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

get

public static Language get(java.lang.String lang)
Returns an instance for the specified language code, or null.

Parameters:
lang - name or code of language
Returns:
language code

get

public static Language get(Prop prop)
Returns an instance for the current language property, or English as default language.

Parameters:
prop - properties
Returns:
language code

def

public static Language def()
Returns the user language as default language, or English, if the user language cannot be assigned.

Returns:
default language

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Language o)
Specified by:
compareTo in interface java.lang.Comparable<Language>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object