|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.sys.Locale
| Field Summary | |
static int |
AM_PM
Use with getString()/fromString() - The full name of the AM/PM. |
static int |
COUNTRY
Use with getString() - The full name of the locale country. |
static int |
COUNTRY_ENGLISH
Use with getString() - The full English name of the locale country. |
static int |
COUNTRY_NATIVE
Use with getString() - The full native name of the locale country. |
static int |
COUNTRY_SHORT
Use with getString() - The three letter (uppercase) ISO country code. |
static int |
CURRENCY
Use with getString()/fromString() - Gets the currencty symbol. |
static int |
DATE_SEPARATOR
Use with getString() - The character(s) for the date separator. |
static int |
DAY
Use with getString()/fromString() - The full name of the day which is equivalent to Monday to Sunday, where 1 == Monday, 2 == Tuesday. |
static int |
DAY_OF_WEEK
Use with getString()/fromString() - The full name of a DAY IN THE WEEK. |
static int |
defaultID
This is the ID to use as the default locale identifier. |
static int |
FIRST_DAY_OF_WEEK
Use with getString() - The index of the first day of the week where 1 = Monday, 2 = Tuesday, ... |
static int |
FORCE_CREATION
This is an options for createFor() it tells the system to create a Locale that always reports the specified language and country even if the Locale is not actually supported by the underlying system. |
static int |
FORMAT_PARSE_CURRENCY
Parameter for format() or parse() method, used when formating/parsing a currency value. |
static int |
FORMAT_PARSE_DATE
Deprecated. use a Time value and set its format to be the value returned by getString() for TIME_FORMAT or DATE_FORMAT or LONG_DATE_FORMAT, and then request that Time value to convert itself to a String or to read from a String. |
static int |
FORMAT_PARSE_NUMBER
Parameter for format() or parse() method, used when formating/parsing a numeric value. |
static int |
HAS_WILD_CARDS
A compare option. |
static int |
IGNORE_CASE
An option for getStringComparer. |
static int |
IGNORE_NONSPACE
An option for getStringComparer. |
static int |
IGNORE_SYMBOLS
An option for getStringComparer. |
static int |
LANGUAGE
Use with getString() - The full name of the locale language. |
static int |
LANGUAGE_ENGLISH
Use with getString() - The ISO English name of the locale language. |
static int |
LANGUAGE_NATIVE
Use with getString() - The full native name of the locale language. |
static int |
LANGUAGE_SHORT
Use with getString() - The ISO two letter (lowercase) name of the locale language. |
static int |
LOCALE_NEUTRAL
This is the native Win32 definition of a Neutral locale ID. |
static int |
LOCALE_SYSTEM_DEFAULT
This is the native Win32 definition of the system default locale ID. |
static int |
LOCALE_USER_DEFAULT
This is the native Win32 definition of the user default locale ID. |
static int |
LONG_DATE_FORMAT
Use with getString() - The format for the long date display. |
static int |
MONTH
Use with getString()/fromString() - The full name of a month. |
static int |
MONTH_YEAR_FORMAT
Use with getString() - The correct format for displaying month and year only. |
protected int |
myLocalID
Do not use or move this variable. |
static int |
NO_ROUNDING
Option for format() method when using FORMAT_PARSE_CURRENCY or FORMAT_PARSE_NUMBER It specifies not to round up the last decimal digit. |
static int |
SHORT_DATE_FORMAT
Use with getString() - The format for the short date display. |
static int |
SHORT_DAY
Use with getString()/fromString() - The short name of the day which is equivalent to Monday to Sunday, where 1 == Monday, 2 == Tuesday. |
static int |
SHORT_DAY_OF_WEEK
Use with getString()/fromString() - The short name of a DAY IN THE WEEK. |
static int |
SHORT_MONTH
Use with getString()/fromString() - The short name of a month. |
static int |
TIME_FORMAT
Use with getString() - The format for the time display. |
static int |
TIME_SEPARATOR
Use with getString() - The character(s) for the time separator. |
static String |
unknownString
This is the value that will be returned by getString() in some instances if the value is not known. |
| Constructor Summary | |
Locale()
Creates a new default Locale object. |
|
Locale(boolean dontSetId)
This creates a Locale without an ID. |
|
Locale(int id)
Creates a new Locale object with the specified ID. |
|
Locale(String language,
String country,
boolean forceSupport)
Create a Locale for the specified language and optional country. |
|
| Method Summary | |
void |
changeCase(char[] ch,
int start,
int length,
boolean toUpper)
This converts the character array to either upper case or lower case. |
char |
changeCase(char c,
boolean toUpper)
This converts the character to either upper case or lower case. |
int |
compare(char[] one,
int oneOffset,
int oneLength,
char[] two,
int twoOffset,
int twoLength,
int options)
Compare two sections of character arrays. |
int |
compare(char one,
char two,
int options)
Compare two characters. |
int |
compare(String one,
String two,
int options)
Compare two strings. |
static String |
convertCountryCode(String countryCode)
This will convert a three letter (uppercase) ISO country code to the two letter (uppercase) ISO country code OR the other way. |
static Locale |
createFor(String language,
String country,
int options)
|
static int |
createID(String language,
String country,
int options)
This should create a locale ID based on the ISO two character language and country codes. |
String |
format(int what,
Object value,
Object layout)
This is for formatting number/currency values etc. |
int |
fromString(int what,
String str,
int options)
This is the reverse of getString() - it takes a locale dependent string and returns the value associated with it. |
static int[] |
getAllIDs(int options)
Get an array of all supported Locale IDs |
int |
getCalendarForMonth(Time time,
int[] dayOfWeekLayout,
int[] dayOfMonthLayout,
boolean wrapAround)
Get the calendar layout for the month/year that the specified Time is currently set for. |
static Locale |
getDefault()
|
LocalResource |
getLocalResource(String moduleName,
boolean returnNullIfNotFound)
This returns an object which implements LocalResource. |
String |
getString(int what,
int forValue,
int options)
This is used to retrieve locale specific information as a String. |
Comparer |
getStringComparer(int options)
Get a locale specific string comparer. |
boolean |
parse(String source,
int what,
Object value,
Object layout)
This is for parse number/currency values etc. |
void |
set(int id)
Set the ID for this locale. |
static boolean |
setDefault(String language,
String country,
int options)
This attempts to set what the default language and (optionally) country for the application. |
String |
toString()
Return a String representation of this object. |
static boolean |
unknown(String value)
This checks if the value is either null or the unknownString. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Field Detail |
protected int myLocalID
public static final int MONTH
public static final int SHORT_MONTH
public static final int DAY_OF_WEEK
public static final int SHORT_DAY_OF_WEEK
public static final int CURRENCY
public static final int AM_PM
public static final int DAY
public static final int SHORT_DAY
public static final int FIRST_DAY_OF_WEEK
public static final int LANGUAGE
public static final int LANGUAGE_ENGLISH
public static final int LANGUAGE_NATIVE
public static final int LANGUAGE_SHORT
public static final int TIME_SEPARATOR
public static final int DATE_SEPARATOR
public static final int TIME_FORMAT
public static final int SHORT_DATE_FORMAT
public static final int LONG_DATE_FORMAT
public static final int MONTH_YEAR_FORMAT
public static final int COUNTRY
public static final int COUNTRY_ENGLISH
public static final int COUNTRY_NATIVE
public static final int COUNTRY_SHORT
public static final int FORMAT_PARSE_NUMBER
public static final int FORMAT_PARSE_CURRENCY
public static final int FORMAT_PARSE_DATE
public static final int NO_ROUNDING
public static final int LOCALE_NEUTRAL
public static final int LOCALE_USER_DEFAULT
public static final int LOCALE_SYSTEM_DEFAULT
public static int defaultID
public static final String unknownString
public static final int FORCE_CREATION
public static final int IGNORE_CASE
public static final int IGNORE_NONSPACE
public static final int IGNORE_SYMBOLS
public static final int HAS_WILD_CARDS
| Constructor Detail |
public Locale(boolean dontSetId)
public Locale(String language,
String country,
boolean forceSupport)
throws IllegalArgumentException
language - The two letter lower case language specifier (e.g. "en").country - The three letter upper case country specifier (e.g. "GBR"). This may be null.forceSupport - If the specified language/country is not supported usually an IllegalArgumentException
will be thrown. However if this is true then a Locale will still be created, but it will only
be able to report its COUNTRY_SHORT and LANGUAGE_SHORT values (which will be same as the
language and country parameters).
IllegalArgumentException - If the specified language/country is not supported and
forceSupport is false.public Locale()
public Locale(int id)
id - the ID to use for this locale.set(int)| Method Detail |
public static boolean unknown(String value)
public static Locale getDefault()
public static boolean setDefault(String language,
String country,
int options)
language - The two letter language code.country - The three letter country code (optional).options - If FORCE_CREATION is used as an option BUT the specified language/country does is not supported,
then the default locale will
still report this language and country as its language and country
but will not be able to provide any other info or services.
public void set(int id)
id - the ID to use for this locale.public static String convertCountryCode(String countryCode)
public static int createID(String language,
String country,
int options)
language - the ISO-639 two character language specifier.country - the ISO-3166 three character country specifier - this can
be null and the first locale with the specified language will be used.options - options for creating the ID. None are defined yet.
public static Locale createFor(String language,
String country,
int options)
language - the ISO-639 two character language specifier.country - the ISO-3166 three character country specifier - this can
be null and the first locale with the specified language will be used.options - options for creating the ID. The only supported option is FORCE_CREATION
public String getString(int what,
int forValue,
int options)
what - should be one of MONTH, SHORT_MONTH, etc.forValue - should be a value relative to the "what" parameter.
e.g. if (what == MONTH) value should be a number for 1 to 12.options - options for getting the information. None are defined yet.
public int fromString(int what,
String str,
int options)
what - should be one of MONTH, SHORT_MONTH, DAY, SHORT_DAY or AM_PMstr - should be a string to parse.options - options for getting the information. None are defined yet.
public String format(int what,
Object value,
Object layout)
what - one of FORMAT_PARSE_NUMBER or FORMAT_PARSE_CURRENCY constants.value - this should be a ewe.sys.Long() for all integer values or a ewe.sys.Double() for
all floating point values.layout - This should be String that holds the following characters:Examples include: ",.#", "$,0000.00"
public boolean parse(String source,
int what,
Object value,
Object layout)
what - one of FORMAT_PARSE_NUMBER or FORMAT_PARSE_CURRENCY constants.value - this should be a ewe.sys.Long() for all integer values or a ewe.sys.Double() for
all floating point values.layout - This should be String that holds the following characters:Examples include: ",.#", "$,0000.00"
public Comparer getStringComparer(int options)
options - IGNORE_CASE, IGNORE_NONSPACE, IGNORE_SYMBOLS possibly OR'ed together.
public static int[] getAllIDs(int options)
options - None defined yet.
public int compare(char one,
char two,
int options)
one - A charactertwo - A characteroptions - IGNORE_CASE.
public int compare(char[] one,
int oneOffset,
int oneLength,
char[] two,
int twoOffset,
int twoLength,
int options)
one - The first array.oneOffset - The start index.oneLength - The number of characters to compare.two - The second array.twoOffset - The start index.twoLength - The number of characters to compare.options - IGNORE_CASE, IGNORE_NONSPACE, IGNORE_SYMBOLS, HAS_WILD_CARDS.
public int compare(String one,
String two,
int options)
one - The first String.two - The second Stringoptions - IGNORE_CASE, IGNORE_NONSPACE, IGNORE_SYMBOLS, HAS_WILD_CARDS.
public char changeCase(char c,
boolean toUpper)
public void changeCase(char[] ch,
int start,
int length,
boolean toUpper)
public LocalResource getLocalResource(String moduleName,
boolean returnNullIfNotFound)
public String toString()
Object
toString in class Object
public int getCalendarForMonth(Time time,
int[] dayOfWeekLayout,
int[] dayOfMonthLayout,
boolean wrapAround)
time - the Time specifying the month and year required.dayOfWeekLayout - an array of 7 ints which will contain values from 1 = Monday to 7 = Sunday
in the appropriate location for the day of the week for the locale. The value at index 0
will be the first day of the week in this locale (which may be Monday, Sunday or possibly Saturday).dayOfMonthLayout - an array of 35 or 42 integers where the values 1 to 31 will be stored with
1 being stored within the range 0 to 6 depending on what day it is in. The values 2, 3 etc
will follow sequentially from 1. It is possible that the values 31 and 30 may wrap around
and be placed at indexes 0 and 1 if wrapAround is true. Locations where there are no days will be set to 0.wrapAround - if this is true then if the index of values 31 and/or 30 exceed 35 then they
will be wrapped to 0.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||