com.klg.jclass.util.legend
Class JCLegendBundle
java.lang.Object
|
+--com.klg.jclass.util.legend.JCLegendBundle
- public class JCLegendBundle
- extends Object
JCLegendBundle contains locale-specific objects and helpers to get this
information. When a program needs a locale-specific string it can load
it from the resource bundle that is appropriate for the current user's
locale. Those are located in the com.klg.jclass.util.legend\resources
directory. In this way, it can be written program code that is largely
independent of the user's locale isolating most of the locale-specific
information in resource bundles. This class it is used either in JDK
102 or JDK 111 for loading strings in JCLegend.
Method Summary |
static void |
setBundleLocale(Locale l)
Static function used to programatically change the default locale |
static String |
string(String key)
Static function used to retrive a string based on its key;
In JDK 1.1 the default locale it is used. |
static String |
string(String key,
MessageFormat formatter,
Object[] args)
Static function used to format a string based on its key. |
static String |
string(String key,
Object[] args)
Static function used to format a string based on its key. |
static String |
string(String key,
Object[] args,
double[] limits,
String[] formats,
int choiceVar)
Static function used to format a string based on its key. |
static String |
string(String language,
String country,
String key)
Static function used to localize a string based on its key,
language and country |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
key1
public static final String key1
key2
public static final String key2
key3
public static final String key3
key4
public static final String key4
key5
public static final String key5
key6
public static final String key6
key7
public static final String key7
key8
public static final String key8
key9
public static final String key9
key10
public static final String key10
JCLegendBundle
public JCLegendBundle()
string
public static String string(String language,
String country,
String key)
- Static function used to localize a string based on its key,
language and country
- Parameters:
language
- desired languagecountry
- desired countrykey
- the key of the string that is to be retrived
string
public static String string(String key)
- Static function used to retrive a string based on its key;
In JDK 1.1 the default locale it is used.
- Parameters:
key
- the key of the string that is to be retrived
string
public static String string(String key,
Object[] args)
- Static function used to format a string based on its key.
It produces concatenated messages in la anguage-neutral way.
- Parameters:
key
- the key of the string that is to be retrivedargs
- set of objects used in formatting
string
public static String string(String key,
MessageFormat formatter,
Object[] args)
- Static function used to format a string based on its key.
It produces concatenated messages in la anguage-neutral way.
- Parameters:
key
- the key of the string that is to be retrivedformatter
- a formatter provided by the userargs
- set of objects used in formatting
setBundleLocale
public static void setBundleLocale(Locale l)
- Static function used to programatically change the default locale
- Parameters:
lnew
- locale
string
public static String string(String key,
Object[] args,
double[] limits,
String[] formats,
int choiceVar)
- Static function used to format a string based on its key.
It produces concatenated messages in laanguage-neutral way.
Allows to attach a format to a range of numbers. It is generally used for handling plurals
The choice is specified with an ascending list of doubles, where each item
specifies a half-open interval up to the next item: X matches j if and only if limit[j] <= X < limit[j+1]
- Parameters:
key
- the key of the string that is to be retrivedargs
- set of objects used in formattinglimits
- the list of doubles that specifies a half-open intervalformats
- it is an array of choices: one choice for each interval defined by the limits arraychoiceVar
- it is used to identify which of the variable from the string that contains
the formatting information uses the choice formatting feature. Note the limitation of only one choice variable per string.