|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.jini.lookup.ui.attribute.Locales
UI attribute that lists the locales supported by a generated UI.
| Constructor Summary | |
Locales(java.util.Set locales)
Constructs a Locales using the
passed Set. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
Compares the specified object (the Object passed
in o) with this Locales
object for equality. |
java.util.Locale |
getFirstSupportedLocale(java.util.List locales)
Iterates through the passed List of Locales
and returns the first Locale that is
supported by the UI (as defined by isLocaleSupported()),
or null, if none of the Locales in
the passed array are supported by the UI. |
java.util.Locale |
getFirstSupportedLocale(java.util.Locale[] locales)
Looks through the passed array of Locales
(in the order they appear in the array)
and returns the first Locale that is
supported by the UI (as defined by isLocaleSupported()),
or null, if none of the Locales in
the passed array are supported by the UI. |
java.util.Set |
getLocales()
Returns an unmodifiable java.util.Set that contains
java.util.Locale objects, one for each locale supported
by the UI generated by the UI factory stored in
the marshalled object of the same UIDescriptor. |
int |
hashCode()
Returns the hash code value for this Locales object. |
boolean |
isLocaleSupported(java.util.Locale locale)
Indicates whether or not a locale is supported by the UI generated by the UI factory stored in the marshalled object of the same UIDescriptor. |
java.util.Iterator |
iterator()
Returns an iterator over the set of java.util.Locale
objects, one for each locale supported
by the UI generated by the UI factory stored in
the marshalled object of the same UIDescriptor. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Locales(java.util.Set locales)
Locales using the
passed Set. The Set can
be mutable or immutable, and must contain only
java.util.Locale objects. Each Locale must
represent a locale that is supported by the UI generated
by the UI factory stored in marshalled form in the
same UIDescriptor. This constructor copies
the contents of the passed Set into a
serializable read-only Set that has a
consistent serialized form across all VMs.locales - A Set of Locale
objects. Each element must be non-null and an instance
of java.util.Locale.NullPointerException - if locales
is null or any element of locales
set is null.java.lang.IllegalArgumentException - if any non-null element of
locales set is not an instance of
java.util.Locale.| Method Detail |
public boolean isLocaleSupported(java.util.Locale locale)
UIDescriptor.
This method returns true only if the passed
Locale exactly matches a Locale
supported by the UI, as defined by the equals()
method of class java.util.Locale. For example, imagine the UI supports the
"en" (General English) locale, but not the "en_US" (US English) locale.
Then, if "en_US" is passed to this method, the method will return
false.locale - the locale to checkNullPointerException - if locale
is null.public java.util.Locale getFirstSupportedLocale(java.util.Locale[] locales)
Locales
(in the order they appear in the array)
and returns the first Locale that is
supported by the UI (as defined by isLocaleSupported()),
or null, if none of the Locales in
the passed array are supported by the UI.locales - an array of locales in order of most desired to
least desiredNullPointerException - if locales
is null.public java.util.Locale getFirstSupportedLocale(java.util.List locales)
List of Locales
and returns the first Locale that is
supported by the UI (as defined by isLocaleSupported()),
or null, if none of the Locales in
the passed array are supported by the UI.locales - a List of locales in order of most
desired to least desiredNullPointerException - if locales
is null.public java.util.Iterator iterator()
java.util.Locale
objects, one for each locale supported
by the UI generated by the UI factory stored in
the marshalled object of the same UIDescriptor.
The returned Iterator does not support
remove().public java.util.Set getLocales()
java.util.Set that contains
java.util.Locale objects, one for each locale supported
by the UI generated by the UI factory stored in
the marshalled object of the same UIDescriptor.public boolean equals(java.lang.Object o)
Object passed
in o) with this Locales
object for equality. Returns true if the specified object
is not null, if the specified object's class is
Locales, if the two sets of
supported locales are the same size, and if every locale mentioned in the
specified Locales object (passed in o) is also mentioned
in this Locales object.equals in class java.lang.Objecto - the object to compare againsttrue if the objects are the same,
false otherwise.public int hashCode()
Locales object.hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||