|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.util.i18n.LanguageResource
Models a container for localized language specific resources.
| Field Summary | |
private ResourceBundle |
bundle
The ResourceBundle associated to the
LanguageResource
|
static String |
KEY_NOT_FOUND
Predefined String constant for unknown keys which are not
part of the LanguageResource
|
private static String |
TRANSLATION_DATE
Predefined key to access the date of translation of a LanguageResource
|
private static String |
TRANSLATOR_KEY
Predefined key to access the name of the translator of a LanguageResource
|
| Constructor Summary | |
LanguageResource(ResourceBundle bundle)
Creates a new LanguageResource whcih works on the
specified ResourceBundle, i.e. extracts the messages from
it.
|
|
| Method Summary | |
int |
compareTo(Object obj)
Compares this LanguageResource with the specified object
for order. |
boolean |
equals(Object obj)
Tests if this LanguageResource equals the specified
obj which also has to be a LanguageResource.
|
String |
getFormattedString(String key,
Object[] arguments)
Gets a localized formatted String from this
LanguageResource matching the specified key.
|
String |
getISOLanguage()
Gets the lowercase ISO 639 code of this LanguageResource,
e.g. |
String |
getLanguage()
Gets the full language identifier of this LanguageResource,
e.g. |
String |
getLanguage(LanguageResource resource)
Gets the full language identifier of this LanguageResource,
e.g. |
String |
getString(String key)
Gets a localized String from this
LanguageResource matching the specified key.
|
String |
getTranslationDate()
Gets the date of translation of this LanguageResource.
|
String |
getTranslator()
Gets the name of the translator of this LanguageResource.
|
String |
toString()
Converts this LanguageResource to a human readable
representation. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String KEY_NOT_FOUND
Predefined String constant for unknown keys which are not
part of the LanguageResource
private static final String TRANSLATOR_KEY
Predefined key to access the name of the translator of a
LanguageResource
private static final String TRANSLATION_DATE
Predefined key to access the date of translation of a
LanguageResource
private ResourceBundle bundle
The ResourceBundle associated to the
LanguageResource
| Constructor Detail |
public LanguageResource(ResourceBundle bundle)
Creates a new LanguageResource whcih works on the
specified ResourceBundle, i.e. extracts the messages from
it.
bundle - the associated ResourceBundle| Method Detail |
public String getISOLanguage()
Gets the lowercase ISO 639 code of this LanguageResource,
e.g. "en" for English.
LanguageResourcepublic String getLanguage()
Gets the full language identifier of this LanguageResource,
e.g. "English". If possible, the name returned will be localized
according to the current default LanguageResource. For
example, if the LanguageResource is fr and the default
LanguageResource is en, getLanguage(LanguageResource) will
return "French"; if the LanguageResource is en and the
default LanguageResource is fr,
getLanguage(LanguageResource) will return "anglais".
LanguageResourcegetLanguage(LanguageResource)public String getLanguage(LanguageResource resource)
Gets the full language identifier of this LanguageResource,
e.g. "English". If possible, the name returned will be localized
according to resource. For example, if the
LanguageResource is fr and resource is en,
getLanguage(LanguageResource) will return "French"; if the
LanguageResource is en and resource is fr,
getLanguage(LanguageResource) will return "anglais".
resource - the LanguageResource to use for getting
the language
LanguageResourcegetLanguage()public String getTranslator()
Gets the name of the translator of this LanguageResource.
LanguageResourcepublic String getTranslationDate()
Gets the date of translation of this LanguageResource.
LanguageResourcepublic String getString(String key)
Gets a localized String from this
LanguageResource matching the specified key.
key - the key of the localized String to access
String; KEY_NOT_FOUND if
the key is not part of this LanguageResource
public String getFormattedString(String key,
Object[] arguments)
Gets a localized formatted String from this
LanguageResource matching the specified key.
key - the key of the localized String to accessarguments - a list of parameters to use for formatting
String;
KEY_NOT_FOUND if the key is not part of this
LanguageResourcepublic String toString()
Converts this LanguageResource to a human readable
representation.
LanguageResource as returned
by the getLanguage() method
public boolean equals(Object obj)
Tests if this LanguageResource equals the specified
obj which also has to be a LanguageResource.
Two LanguageResources are considered equal if both have
the same language as returned by the getLanguage() method.
obj - the Object to test for equality
true if this LanguageResource
equals the specified obj; false otherwisepublic int compareTo(Object obj)
Compares this LanguageResource with the specified object
for order. Returns a negative integer, zero, or a positive integer as
this object is less than, equal to, or greater than the specified object.
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
compareTo in interface Comparableobj - the Object to be compared.
LanguageResource is less than, equal to, or greater than
the specified object.
ClassCastException - if the specified object's type prevents it
from being compared to this Object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||