Java Code Examples for com.ibm.icu.util.ULocale#Type
The following examples show how to use
com.ibm.icu.util.ULocale#Type .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RuleBasedCollator.java From fitnotifications with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} * @draft ICU 53 (retain) * @provisional This API might change or be removed in a future release. */ @Override public ULocale getLocale(ULocale.Type type) { if (type == ULocale.ACTUAL_LOCALE) { return actualLocaleIsSameAsValid ? validLocale : tailoring.actualLocale; } else if(type == ULocale.VALID_LOCALE) { return validLocale; } else { throw new IllegalArgumentException("unknown ULocale.Type " + type); } }
Example 2
Source File: UFormat.java From fitnotifications with Apache License 2.0 | 2 votes |
/** * Return the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: This method will be implemented in ICU 3.0; ICU 2.8 * contains a partial preview implementation. The <i>actual</i> * locale is returned correctly, but the <i>valid</i> locale is * not, in most cases. * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public final ULocale getLocale(ULocale.Type type) { return type == ULocale.ACTUAL_LOCALE ? this.actualLocale : this.validLocale; }
Example 3
Source File: BreakIterator.java From fitnotifications with Apache License 2.0 | 2 votes |
/** * {@icu} Returns the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: The <i>actual</i> locale is returned correctly, but the <i>valid</i> * locale is not, in most cases. * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public final ULocale getLocale(ULocale.Type type) { return type == ULocale.ACTUAL_LOCALE ? this.actualLocale : this.validLocale; }
Example 4
Source File: DateFormatSymbols.java From fitnotifications with Apache License 2.0 | 2 votes |
/** * Returns the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: This method will be implemented in ICU 3.0; ICU 2.8 * contains a partial preview implementation. The * <i>actual</i> * locale is returned correctly, but the <i>valid</i> locale is * not, in most cases. * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public final ULocale getLocale(ULocale.Type type) { return type == ULocale.ACTUAL_LOCALE ? this.actualLocale : this.validLocale; }
Example 5
Source File: DecimalFormatSymbols.java From fitnotifications with Apache License 2.0 | 2 votes |
/** * {@icu} Returns the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: The <i>actual</i> locale is returned correctly, but the <i>valid</i> * locale is not, in most cases. * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public final ULocale getLocale(ULocale.Type type) { return type == ULocale.ACTUAL_LOCALE ? this.actualLocale : this.validLocale; }
Example 6
Source File: Collator.java From fitnotifications with Apache License 2.0 | 2 votes |
/** * {@icu} Returns the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: This method will be implemented in ICU 3.0; ICU 2.8 * contains a partial preview implementation. The * <i>actual</i> * locale is returned correctly, but the <i>valid</i> locale is * not, in most cases. * * <p>The base class method always returns {@link ULocale#ROOT}. * Subclasses should override it if appropriate. * * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public ULocale getLocale(ULocale.Type type) { return ULocale.ROOT; }
Example 7
Source File: BreakIterator.java From trekarta with GNU General Public License v3.0 | 2 votes |
/** * {@icu} Returns the locale that was used to create this object, or null. * This may may differ from the locale requested at the time of * this object's creation. For example, if an object is created * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be * drawn from <tt>en</tt> (the <i>actual</i> locale), and * <tt>en_US</tt> may be the most specific locale that exists (the * <i>valid</i> locale). * * <p>Note: The <i>actual</i> locale is returned correctly, but the <i>valid</i> * locale is not, in most cases. * @param type type of information requested, either {@link * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}. * @return the information specified by <i>type</i>, or null if * this object was not constructed from locale data. * @see com.ibm.icu.util.ULocale * @see com.ibm.icu.util.ULocale#VALID_LOCALE * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE * @draft ICU 2.8 (retain) * @provisional This API might change or be removed in a future release. */ public final ULocale getLocale(ULocale.Type type) { return type == ULocale.ACTUAL_LOCALE ? this.actualLocale : this.validLocale; }