public char[] formatLong(long value, FieldPosition field) { FieldPositionIterator fpi = FieldPositionIterator.forFieldPosition(field); char[] result = formatLong(this.address, value, fpi); if (fpi != null) { FieldPositionIterator.setFieldPosition(fpi, field); } return result; }
private static long getFormatter(String skeleton, String localeName, String tzName) { String key = skeleton + "\t" + localeName + "\t" + tzName; Long formatter = CACHED_FORMATTERS.get(key); if (formatter != null) { return formatter; } long address = createDateIntervalFormat(skeleton, localeName, tzName); CACHED_FORMATTERS.put(key, address); return address; }
/** * Returns an ImmutableIndex created from this AlphabeticIndex. */ public synchronized ImmutableIndex getImmutableIndex() { return new ImmutableIndex(buildImmutableIndex(peer)); }
public CollationKey getCollationKey(String source) { if (source == null) { return null; } byte[] key = NativeCollation.getSortKey(address, source); if (key == null) { return null; } return new CollationKeyICU(source, key); }
public char[] formatDouble(double value, FieldPosition field) { FieldPositionIterator fpi = FieldPositionIterator.forFieldPosition(field); char[] result = formatDouble(this.address, value, fpi); if (fpi != null) { FieldPositionIterator.setFieldPosition(fpi, field); } return result; }
public static CollationElementIteratorICU getInstance(long collatorAddress, String source) { long iteratorAddress = NativeCollation.getCollationElementIterator(collatorAddress, source); return new CollationElementIteratorICU(iteratorAddress); }
/** * Returns the number of digits grouped together by the grouping separator. * This only allows to get the primary grouping size. There is no API to get * the secondary grouping size. * * @return the number of digits grouped together. */ public int getGroupingSize() { return ndf.getGroupingSize(); }
/** * This value indicates whether the return object of the parse operation is * of type {@code BigDecimal}. This value defaults to {@code false}. * * @return {@code true} if parse always returns {@code BigDecimals}, * {@code false} if the type of the result is {@code Long} or * {@code Double}. */ public boolean isParseBigDecimal() { return ndf.isParseBigDecimal(); }
/** * Sets whether the decimal separator is shown when there are no fractional * digits. * * @param value * {@code true} if the decimal separator should always be * formatted; {@code false} otherwise. */ public void setDecimalSeparatorAlwaysShown(boolean value) { ndf.setDecimalSeparatorAlwaysShown(value); }
/** * Indicates whether grouping will be used in this format. * * @return {@code true} if grouping is used; {@code false} otherwise. */ @Override public boolean isGroupingUsed() { return ndf.isGroupingUsed(); }
/** * Returns the pattern of this decimal format using non-localized pattern * characters. * * @return the non-localized pattern. */ public String toPattern() { return ndf.toPattern(); }
/** * Returns the number of the label buckets in this index. */ public int getBucketCount() { return getBucketCount(peer); }
/** * Adds the index characters in the range between the specified start and * end code points, inclusive. */ public synchronized AlphabeticIndex addLabelRange(int codePointStart, int codePointEnd) { addLabelRange(peer, codePointStart, codePointEnd); return this; }
/** * Returns an array of strings containing all the two-letter ISO 3166 country codes that can be * used as the country code when constructing a {@code Locale}. */ public static String[] getISOCountries() { return ICU.getISOCountries(); }
/** * Obtains the next collation element in the source string. * * @return the next collation element or {@code NULLORDER} if the end * of the iteration has been reached. */ public int next() { return this.icuIterator.next(); }
/** * Repositions the cursor to point at the first element of the current * string. The next call to {@link #next()} or {@link #previous()} will * return the first and last collation element in the string, respectively. * <p> * If the {@code RuleBasedCollator} used by this iterator has had its * attributes changed, calling {@code reset()} reinitializes the iterator to * use the new attributes. */ public void reset() { this.icuIterator.reset(); }
/** * Sets a new source string iterator for iteration, and resets the offset to * the beginning of the text. * * @param source * the new source string iterator for iteration. */ public void setText(CharacterIterator source) { this.icuIterator.setText(source); }
/** * Obtains the tertiary order of the specified collation element, i.e. the * last 8 bits. This value is unsigned. * * @param order * the element of the collation. * @return the 8 bit tertiary order of the element. */ public static final short tertiaryOrder(int order) { return (short) CollationElementIteratorICU.tertiaryOrder(order); } }
@Override public boolean equals(Object o) { if (!(o instanceof RuleBasedBreakIterator)) { return false; } return wrapped.equals(((RuleBasedBreakIterator) o).wrapped); }
/** * Returns an array of locales for which custom {@code DateFormatSymbols} instances * are available. * <p>Note that Android does not support user-supplied locale service providers. * @since 1.6 */ public static Locale[] getAvailableLocales() { return ICU.getAvailableDateFormatSymbolsLocales(); }