</target>
- <target name="build-tools" description="Build build-tool classes">
- <ant dir="${icu4j.build-tools.dir}" inheritAll="false"/>
- </target>
-
<target name="initPluginVersion">
<tstamp>
<format property="build.date" pattern="yyyyMMdd"/>
</target>
<target name="icuProjectFiles"
- depends="initPluginVersion,build-tools"
+ depends="initPluginVersion"
description="Copy com.ibm.icu plug-in project files">
<delete failonerror="no">
<fileset dir="${icu4j.translit.dir}/src"/>
</copy>
- <!-- update some source files to change API signatures for backward compatibility support -->
- <echo message="Updating java source files for eclipse in com.ibm.icu"/>
- <java classname="com.ibm.icu.dev.tool.docs.CodeMangler"
- classpath="${icu4j.build-tools.jar}"
- failonerror="true">
- <arg line="-dECLIPSE -in ${eclipse.projects.dir}/plugins/com.ibm.icu/src -f @eclipse_mod_classes.txt"/>
- </java>
-
<!-- overwriting the ICU runtime configuration file for forcing ICU4J plugin to use JDK time zone rules -->
<copy file="misc/ICUConfig.properties"
toDir="${eclipse.projects.dir}/plugins/com.ibm.icu/src/com/ibm/icu"
</target>
<target name="icuTestsProjectFiles"
- depends="initPluginVersion,build-tools"
+ depends="initPluginVersion"
description="Copy com.ibm.icu.tests plug-in project files">
<delete failonerror="no">
<fileset dir="${icu4j.translit-tests.dir}/src"/>
</copy>
- <!-- update some source files to change API signatures for backward compatibility support -->
- <echo message="Updating java source files for eclipse in com.ibm.icu.tests"/>
- <java classname="com.ibm.icu.dev.tool.docs.CodeMangler"
- classpath="${icu4j.build-tools.jar}"
- failonerror="true">
- <arg line="-dECLIPSE -in ${eclipse.projects.dir}/plugins/com.ibm.icu.tests/src -f @eclipse_mod_test_classes.txt"/>
- </java>
-
<!-- icu test data -->
<unjar src="${icu4j.testdata.jar}" dest="${eclipse.projects.dir}/plugins/com.ibm.icu.tests/src">
<patternset>
+++ /dev/null
-# Copyright (C) 2011, International Business Machines Corporation and
-# others. All Rights Reserved.
-
-com/ibm/icu/lang/UCharacter.java
-com/ibm/icu/text/DecimalFormat.java
+++ /dev/null
-# Copyright (C) 2011, International Business Machines Corporation and
-# others. All Rights Reserved.
-
-com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java
-com/ibm/icu/dev/test/format/NumberFormatTest.java
-com/ibm/icu/dev/test/serializable/CompatibilityTest.java
-com/ibm/icu/dev/test/serializable/CoverageTest.java
/*
*******************************************************************************
- * Copyright (C) 2006-2011, International Business Machines Corporation and *
+ * Copyright (C) 2006-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
assertEquals(Calendar.WEEKEND, cal.getDayOfWeekType(Calendar.SATURDAY));
}
- /*
- * Test method for 'com.ibm.icu.util.Calendar.getWeekendTransition(int)'
- */
- public void testGetWeekendTransition() {
- Calendar cal = Calendar.getInstance(Locale.US);
- try {
- cal.getWeekendTransition(Calendar.WEEKEND_ONSET);
- fail("expected IllegalArgumentException from getWeekendTransition");
- }
- catch (UnsupportedOperationException e) {
- // ok
- }
- }
-
/*
* Test method for 'com.ibm.icu.util.Calendar.isWeekend(Date)'
*/
/*
******************************************************************************
-* Copyright (C) 2003-2011, International Business Machines Corporation and *
+* Copyright (C) 2003-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
* Utility class to parse and normalize locale ids (including POSIX style)
*/
public final class LocaleIDParser {
+
+ /**
+ * Char array representing the locale ID.
+ */
private char[] id;
+
+ /**
+ * Current position in {@link #id} (while parsing).
+ */
private int index;
- private char[] buffer;
- private int blen;
+
+ /**
+ * Temporary buffer for parsed sections of data.
+ */
+ private StringBuilder buffer;
+
// um, don't handle POSIX ids unless we request it. why not? well... because.
private boolean canonicalize;
private boolean hadCountry;
public LocaleIDParser(String localeID, boolean canonicalize) {
id = localeID.toCharArray();
index = 0;
- buffer = new char[id.length + 5];
- blen = 0;
+ buffer = new StringBuilder(id.length + 5);
this.canonicalize = canonicalize;
}
private void reset() {
- index = blen = 0;
+ index = 0;
+ buffer = new StringBuilder(id.length + 5);
}
// utilities for working on text in the buffer
-
+
/**
* Append c to the buffer.
*/
private void append(char c) {
- try {
- buffer[blen] = c;
- }
- catch (IndexOutOfBoundsException e) {
- if (buffer.length > 512) {
- // something is seriously wrong, let this go
- throw e;
- }
- char[] nbuffer = new char[buffer.length * 2];
- System.arraycopy(buffer, 0, nbuffer, 0, buffer.length);
- nbuffer[blen] = c;
- buffer = nbuffer;
- }
- ++blen;
+ buffer.append(c);
}
-
+
private void addSeparator() {
append(UNDERSCORE);
}
* Returns the text in the buffer from start to blen as a String.
*/
private String getString(int start) {
- if (start == blen) {
- return "";
- }
- return new String(buffer, start, blen-start);
+ return buffer.substring(start);
}
/**
* Set the length of the buffer to pos, then append the string.
*/
private void set(int pos, String s) {
- this.blen = pos; // no safety
- append(s);
+ buffer.delete(pos, buffer.length());
+ buffer.insert(pos, s);
}
/**
* Append the string to the buffer.
*/
private void append(String s) {
- for (int i = 0; i < s.length(); ++i) {
- append(s.charAt(i));
- }
+ buffer.append(s);
}
// utilities for parsing text out of the id
* Advance index until the next terminator or id separator, and leave it there.
*/
private void skipUntilTerminatorOrIDSeparator() {
- while (!isTerminatorOrIDSeparator(next())) {
- }
+ while (!isTerminatorOrIDSeparator(next()));
--index;
}
return index >= id.length || isTerminator(id[index]);
}
- /*
- * Returns true if the character is an id separator (underscore or hyphen).
- */
- /* private boolean isIDSeparator(char c) {
- return c == UNDERSCORE || c == HYPHEN;
- }*/
-
/**
* Returns true if the character is a terminator (keyword separator, dot, or DONE).
* Dot is a terminator because of the POSIX form, where dot precedes the codepage.
* Returns true if the character is a terminator or id separator.
*/
private boolean isTerminatorOrIDSeparator(char c) {
- return c == KEYWORD_SEPARATOR || c == UNDERSCORE || c == HYPHEN ||
- c == DONE || c == DOT;
+ return c == UNDERSCORE || c == HYPHEN || isTerminator(c);
}
/**
* separator. Returns the start of the language code in the buffer.
*/
private int parseLanguage() {
+ int startLength = buffer.length();
+
if (haveExperimentalLanguagePrefix()) {
- append(Character.toLowerCase(id[0]));
+ append(AsciiUtil.toLower(id[0]));
append(HYPHEN);
index = 2;
}
char c;
while(!isTerminatorOrIDSeparator(c = next())) {
- append(Character.toLowerCase(c));
+ append(AsciiUtil.toLower(c));
}
--index; // unget
- if (blen == 3) {
+ if (buffer.length() - startLength == 3) {
String lang = LocaleIDs.threeToTwoLetterLanguage(getString(0));
if (lang != null) {
set(0, lang);
int oldIndex = index; // save original index
++index;
- int oldBlen = blen; // get before append hyphen, if we truncate everything is undone
+ int oldBlen = buffer.length(); // get before append hyphen, if we truncate everything is undone
char c;
- while(!isTerminatorOrIDSeparator(c = next())) {
- if (blen == oldBlen) { // first pass
+ boolean firstPass = true;
+ while(!isTerminatorOrIDSeparator(c = next()) && AsciiUtil.isAlpha(c)) {
+ if (firstPass) {
addSeparator();
- append(Character.toUpperCase(c));
+ append(AsciiUtil.toUpper(c));
+ firstPass = false;
} else {
- append(Character.toLowerCase(c));
+ append(AsciiUtil.toLower(c));
}
}
--index; // unget
/* If it's not exactly 4 characters long, then it's not a script. */
if (index - oldIndex != 5) { // +1 to account for separator
index = oldIndex;
- blen = oldBlen;
+ buffer.delete(oldBlen, buffer.length());
} else {
oldBlen++; // index past hyphen, for clients who want to extract just the script
}
return oldBlen;
}
- return blen;
+ return buffer.length();
}
/**
if (!atTerminator()) {
int oldIndex = index;
++index;
+
+ char c;
+ while (!isTerminatorOrIDSeparator(c = next()) && AsciiUtil.isAlpha(c));
+ --index;
- skipUntilTerminatorOrIDSeparator();
if (index - oldIndex != 5) { // +1 to account for separator
index = oldIndex;
}
int oldIndex = index;
++index;
- int oldBlen = blen;
+ int oldBlen = buffer.length();
char c;
+ boolean firstPass = true;
while (!isTerminatorOrIDSeparator(c = next())) {
- if (oldBlen == blen) { // first, add hyphen
+ if (firstPass) { // first, add hyphen
hadCountry = true; // we have a country, let variant parsing know
addSeparator();
++oldBlen; // increment past hyphen
+ firstPass = false;
}
- append(Character.toUpperCase(c));
+ append(AsciiUtil.toUpper(c));
}
--index; // unget
- int charsAppended = blen - oldBlen;
+ int charsAppended = buffer.length() - oldBlen;
if (charsAppended == 0) {
// Do nothing.
// their previous values.
index = oldIndex;
--oldBlen;
- blen = oldBlen;
+ buffer.delete(oldBlen, buffer.length());
hadCountry = false;
}
else if (charsAppended == 3) {
return oldBlen;
}
- return blen;
+ return buffer.length();
}
/**
*/
private void skipCountry() {
if (!atTerminator()) {
- ++index;
+ if (id[index] == UNDERSCORE || id[index] == HYPHEN) {
+ ++index;
+ }
/*
* Save the index point after the separator, since the format
* requires two separators if the country is not present.
* becomes a bit more complex.
*/
private int parseVariant() {
- int oldBlen = blen;
+ int oldBlen = buffer.length();
boolean start = true;
boolean needSeparator = true;
boolean skipping = false;
char c;
+ boolean firstPass = true;
+
while ((c = next()) != DONE) {
if (c == DOT) {
start = false;
needSeparator = true; // add another underscore if we have more text
} else if (start) {
start = false;
+ if (c != UNDERSCORE && c != HYPHEN) {
+ index--;
+ }
} else if (!skipping) {
if (needSeparator) {
- boolean incOldBlen = blen == oldBlen; // need to skip separators
needSeparator = false;
- if (incOldBlen && !hadCountry) { // no country, we'll need two
+ if (firstPass && !hadCountry) { // no country, we'll need two
addSeparator();
++oldBlen; // for sure
}
addSeparator();
- if (incOldBlen) { // only for the first separator
+ if (firstPass) { // only for the first separator
++oldBlen;
+ firstPass = false;
}
}
- c = Character.toUpperCase(c);
+ c = AsciiUtil.toUpper(c);
if (c == HYPHEN || c == COMMA) {
c = UNDERSCORE;
}
parseVariant();
// catch unwanted trailing underscore after country if there was no variant
- if (blen > 1 && buffer[blen-1] == UNDERSCORE) {
- --blen;
+ int len = buffer.length();
+ if (len > 0 && buffer.charAt(len - 1) == UNDERSCORE) {
+ buffer.deleteCharAt(len - 1);
}
}
}
* Parse the keywords and return start of the string in the buffer.
*/
private int parseKeywords() {
- int oldBlen = blen;
+ int oldBlen = buffer.length();
Map<String, String> m = getKeywordMap();
if (!m.isEmpty()) {
boolean first = true;
append(KEYWORD_ASSIGN);
append(e.getValue());
}
- if (blen != oldBlen) {
+ if (first == false) {
++oldBlen;
}
}
}
}
}
-}
\ No newline at end of file
+}
*/
public static final int CLASS_DEFAULT = 19; //UCharacterDirection.CHAR_DIRECTION_COUNT;
- /**
- * Allocate a <code>Bidi</code> object.
- * Such an object is initially empty. It is assigned
- * the Bidi properties of a piece of text containing one or more paragraphs
- * by <code>setPara()</code>
- * or the Bidi properties of a line within a paragraph by
- * <code>setLine()</code>.<p>
- * This object can be reused.<p>
- * <code>setPara()</code> and <code>setLine()</code> will allocate
- * additional memory for internal structures as necessary.
- *
- * @stable ICU 3.8
- */
- public Bidi()
- {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Allocate a <code>Bidi</code> object with preallocated memory
- * for internal structures.
- * This method provides a <code>Bidi</code> object like the default constructor
- * but it also preallocates memory for internal structures
- * according to the sizings supplied by the caller.<p>
- * The preallocation can be limited to some of the internal memory
- * by setting some values to 0 here. That means that if, e.g.,
- * <code>maxRunCount</code> cannot be reasonably predetermined and should not
- * be set to <code>maxLength</code> (the only failproof value) to avoid
- * wasting memory, then <code>maxRunCount</code> could be set to 0 here
- * and the internal structures that are associated with it will be allocated
- * on demand, just like with the default constructor.
- *
- * @param maxLength is the maximum text or line length that internal memory
- * will be preallocated for. An attempt to associate this object with a
- * longer text will fail, unless this value is 0, which leaves the allocation
- * up to the implementation.
- *
- * @param maxRunCount is the maximum anticipated number of same-level runs
- * that internal memory will be preallocated for. An attempt to access
- * visual runs on an object that was not preallocated for as many runs
- * as the text was actually resolved to will fail,
- * unless this value is 0, which leaves the allocation up to the implementation.<br><br>
- * The number of runs depends on the actual text and maybe anywhere between
- * 1 and <code>maxLength</code>. It is typically small.
- *
- * @throws IllegalArgumentException if maxLength or maxRunCount is less than 0
- * @stable ICU 3.8
- */
- public Bidi(int maxLength, int maxRunCount)
- {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Modify the operation of the Bidi algorithm such that it
- * approximates an "inverse Bidi" algorithm. This method
- * must be called before <code>setPara()</code>.
- *
- * <p>The normal operation of the Bidi algorithm as described
- * in the Unicode Technical Report is to take text stored in logical
- * (keyboard, typing) order and to determine the reordering of it for visual
- * rendering.
- * Some legacy systems store text in visual order, and for operations
- * with standard, Unicode-based algorithms, the text needs to be transformed
- * to logical order. This is effectively the inverse algorithm of the
- * described Bidi algorithm. Note that there is no standard algorithm for
- * this "inverse Bidi" and that the current implementation provides only an
- * approximation of "inverse Bidi".</p>
- *
- * <p>With <code>isInversed</code> set to <code>true</code>,
- * this method changes the behavior of some of the subsequent methods
- * in a way that they can be used for the inverse Bidi algorithm.
- * Specifically, runs of text with numeric characters will be treated in a
- * special way and may need to be surrounded with LRM characters when they are
- * written in reordered sequence.</p>
- *
- * <p>Output runs should be retrieved using <code>getVisualRun()</code>.
- * Since the actual input for "inverse Bidi" is visually ordered text and
- * <code>getVisualRun()</code> gets the reordered runs, these are actually
- * the runs of the logically ordered output.</p>
- *
- * <p>Calling this method with argument <code>isInverse</code> set to
- * <code>true</code> is equivalent to calling <code>setReorderingMode</code>
- * with argument <code>reorderingMode</code>
- * set to <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
- * Calling this method with argument <code>isInverse</code> set to
- * <code>false</code> is equivalent to calling <code>setReorderingMode</code>
- * with argument <code>reorderingMode</code>
- * set to <code>REORDER_DEFAULT</code>.
- *
- * @param isInverse specifies "forward" or "inverse" Bidi operation.
- *
- * @see #setPara
- * @see #writeReordered
- * @see #setReorderingMode
- * @see #REORDER_INVERSE_NUMBERS_AS_L
- * @see #REORDER_DEFAULT
- * @stable ICU 3.8
- */
- public void setInverse(boolean isInverse) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Is this <code>Bidi</code> object set to perform the inverse Bidi
- * algorithm?
- * <p>Note: calling this method after setting the reordering mode with
- * <code>setReorderingMode</code> will return <code>true</code> if the
- * reordering mode was set to
- * <code>REORDER_INVERSE_NUMBERS_AS_L<code>, <code>false</code>
- * for all other values.</p>
- *
- * @return <code>true</code> if the <code>Bidi</code> object is set to
- * perform the inverse Bidi algorithm by handling numbers as L.
- *
- * @see #setInverse
- * @see #setReorderingMode
- * @see #REORDER_INVERSE_NUMBERS_AS_L
- * @stable ICU 3.8
- */
- public boolean isInverse() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Modify the operation of the Bidi algorithm such that it implements some
- * variant to the basic Bidi algorithm or approximates an "inverse Bidi"
- * algorithm, depending on different values of the "reordering mode".
- * This method must be called before <code>setPara()</code>, and stays in
- * effect until called again with a different argument.
- *
- * <p>The normal operation of the Bidi algorithm as described in the Unicode
- * Standard Annex #9 is to take text stored in logical (keyboard, typing)
- * order and to determine how to reorder it for visual rendering.</p>
- *
- * <p>With the reordering mode set to a value other than
- * <code>REORDER_DEFAULT</code>, this method changes the behavior of some of
- * the subsequent methods in a way such that they implement an inverse Bidi
- * algorithm or some other algorithm variants.</p>
- *
- * <p>Some legacy systems store text in visual order, and for operations
- * with standard, Unicode-based algorithms, the text needs to be transformed
- * into logical order. This is effectively the inverse algorithm of the
- * described Bidi algorithm. Note that there is no standard algorithm for
- * this "inverse Bidi", so a number of variants are implemented here.</p>
- *
- * <p>In other cases, it may be desirable to emulate some variant of the
- * Logical to Visual algorithm (e.g. one used in MS Windows), or perform a
- * Logical to Logical transformation.</p>
- *
- * <ul>
- * <li>When the Reordering Mode is set to
- * <code>REORDER_DEFAULT</code>,
- * the standard Bidi Logical to Visual algorithm is applied.</li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_NUMBERS_SPECIAL</code>,
- * the algorithm used to perform Bidi transformations when calling
- * <code>setPara</code> should approximate the algorithm used in Microsoft
- * Windows XP rather than strictly conform to the Unicode Bidi algorithm.
- * <br>
- * The differences between the basic algorithm and the algorithm addressed
- * by this option are as follows:
- * <ul>
- * <li>Within text at an even embedding level, the sequence "123AB"
- * (where AB represent R or AL letters) is transformed to "123BA" by the
- * Unicode algorithm and to "BA123" by the Windows algorithm.</li>
- *
- * <li>Arabic-Indic numbers (AN) are handled by the Windows algorithm just
- * like regular numbers (EN).</li>
- * </ul></li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_GROUP_NUMBERS_WITH_R</code>,
- * numbers located between LTR text and RTL text are associated with the RTL
- * text. For instance, an LTR paragraph with content "abc 123 DEF" (where
- * upper case letters represent RTL characters) will be transformed to
- * "abc FED 123" (and not "abc 123 FED"), "DEF 123 abc" will be transformed
- * to "123 FED abc" and "123 FED abc" will be transformed to "DEF 123 abc".
- * This makes the algorithm reversible and makes it useful when round trip
- * (from visual to logical and back to visual) must be achieved without
- * adding LRM characters. However, this is a variation from the standard
- * Unicode Bidi algorithm.<br>
- * The source text should not contain Bidi control characters other than LRM
- * or RLM.</li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_RUNS_ONLY</code>,
- * a "Logical to Logical" transformation must be performed:
- * <ul>
- * <li>If the default text level of the source text (argument
- * <code>paraLevel</code> in <code>setPara</code>) is even, the source text
- * will be handled as LTR logical text and will be transformed to the RTL
- * logical text which has the same LTR visual display.</li>
- * <li>If the default level of the source text is odd, the source text
- * will be handled as RTL logical text and will be transformed to the
- * LTR logical text which has the same LTR visual display.</li>
- * </ul>
- * This mode may be needed when logical text which is basically Arabic or
- * Hebrew, with possible included numbers or phrases in English, has to be
- * displayed as if it had an even embedding level (this can happen if the
- * displaying application treats all text as if it was basically LTR).
- * <br>
- * This mode may also be needed in the reverse case, when logical text which
- * is basically English, with possible included phrases in Arabic or Hebrew,
- * has to be displayed as if it had an odd embedding level.
- * <br>
- * Both cases could be handled by adding LRE or RLE at the head of the
- * text, if the display subsystem supports these formatting controls. If it
- * does not, the problem may be handled by transforming the source text in
- * this mode before displaying it, so that it will be displayed properly.
- * <br>
- * The source text should not contain Bidi control characters other than LRM
- * or RLM.</li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_INVERSE_NUMBERS_AS_L</code>, an "inverse Bidi"
- * algorithm is applied.
- * Runs of text with numeric characters will be treated like LTR letters and
- * may need to be surrounded with LRM characters when they are written in
- * reordered sequence (the option <code>INSERT_LRM_FOR_NUMERIC</code> can
- * be used with method <code>writeReordered</code> to this end. This mode
- * is equivalent to calling <code>setInverse()</code> with
- * argument <code>isInverse</code> set to <code>true</code>.</li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_INVERSE_LIKE_DIRECT</code>, the "direct" Logical to
- * Visual Bidi algorithm is used as an approximation of an "inverse Bidi"
- * algorithm. This mode is similar to mode
- * <code>REORDER_INVERSE_NUMBERS_AS_L</code> but is closer to the
- * regular Bidi algorithm.
- * <br>
- * For example, an LTR paragraph with the content "FED 123 456 CBA" (where
- * upper case represents RTL characters) will be transformed to
- * "ABC 456 123 DEF", as opposed to "DEF 123 456 ABC"
- * with mode <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
- * When used in conjunction with option
- * <code>OPTION_INSERT_MARKS</code>, this mode generally
- * adds Bidi marks to the output significantly more sparingly than mode
- * <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br> with option
- * <code>INSERT_LRM_FOR_NUMERIC</code> in calls to
- * <code>writeReordered</code>.</li>
- *
- * <li>When the reordering mode is set to
- * <code>REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the Logical to Visual
- * Bidi algorithm used in Windows XP is used as an approximation of an "inverse
- * Bidi" algorithm.
- * <br>
- * For example, an LTR paragraph with the content "abc FED123" (where
- * upper case represents RTL characters) will be transformed to
- * "abc 123DEF.</li>
- * </ul>
- *
- * <p>In all the reordering modes specifying an "inverse Bidi" algorithm
- * (i.e. those with a name starting with <code>REORDER_INVERSE</code>),
- * output runs should be retrieved using <code>getVisualRun()</code>, and
- * the output text with <code>writeReordered()</code>. The caller should
- * keep in mind that in "inverse Bidi" modes the input is actually visually
- * ordered text and reordered output returned by <code>getVisualRun()</code>
- * or <code>writeReordered()</code> are actually runs or character string
- * of logically ordered output.<br>
- * For all the "inverse Bidi" modes, the source text should not contain
- * Bidi control characters other than LRM or RLM.</p>
- *
- * <p>Note that option <code>OUTPUT_REVERSE</code> of
- * <code>writeReordered</code> has no useful meaning and should not be used
- * in conjunction with any value of the reordering mode specifying "inverse
- * Bidi" or with value <code>REORDER_RUNS_ONLY</code>.
- *
- * @param reorderingMode specifies the required variant of the Bidi
- * algorithm.
- *
- * @see #setInverse
- * @see #setPara
- * @see #writeReordered
- * @see #INSERT_LRM_FOR_NUMERIC
- * @see #OUTPUT_REVERSE
- * @see #REORDER_DEFAULT
- * @see #REORDER_NUMBERS_SPECIAL
- * @see #REORDER_GROUP_NUMBERS_WITH_R
- * @see #REORDER_RUNS_ONLY
- * @see #REORDER_INVERSE_NUMBERS_AS_L
- * @see #REORDER_INVERSE_LIKE_DIRECT
- * @see #REORDER_INVERSE_FOR_NUMBERS_SPECIAL
- * @stable ICU 3.8
- */
- public void setReorderingMode(int reorderingMode) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * What is the requested reordering mode for a given Bidi object?
- *
- * @return the current reordering mode of the Bidi object
- *
- * @see #setReorderingMode
- * @stable ICU 3.8
- */
- public int getReorderingMode() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Specify which of the reordering options should be applied during Bidi
- * transformations.
- *
- * @param options A combination of zero or more of the following
- * reordering options:
- * <code>OPTION_DEFAULT</code>, <code>OPTION_INSERT_MARKS</code>,
- * <code>OPTION_REMOVE_CONTROLS</code>, <code>OPTION_STREAMING</code>.
- *
- * @see #getReorderingOptions
- * @see #OPTION_DEFAULT
- * @see #OPTION_INSERT_MARKS
- * @see #OPTION_REMOVE_CONTROLS
- * @see #OPTION_STREAMING
- * @stable ICU 3.8
- */
- public void setReorderingOptions(int options) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * What are the reordering options applied to a given Bidi object?
- *
- * @return the current reordering options of the Bidi object
- *
- * @see #setReorderingOptions
- * @stable ICU 3.8
- */
- public int getReorderingOptions() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Perform the Unicode Bidi algorithm. It is defined in the
- * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
- * version 13,
- * also described in The Unicode Standard, Version 4.0 .<p>
- *
- * This method takes a piece of plain text containing one or more paragraphs,
- * with or without externally specified embedding levels from <i>styled</i>
- * text and computes the left-right-directionality of each character.<p>
- *
- * If the entire text is all of the same directionality, then
- * the method may not perform all the steps described by the algorithm,
- * i.e., some levels may not be the same as if all steps were performed.
- * This is not relevant for unidirectional text.<br>
- * For example, in pure LTR text with numbers the numbers would get
- * a resolved level of 2 higher than the surrounding text according to
- * the algorithm. This implementation may set all resolved levels to
- * the same value in such a case.<p>
- *
- * The text can be composed of multiple paragraphs. Occurrence of a block
- * separator in the text terminates a paragraph, and whatever comes next starts
- * a new paragraph. The exception to this rule is when a Carriage Return (CR)
- * is followed by a Line Feed (LF). Both CR and LF are block separators, but
- * in that case, the pair of characters is considered as terminating the
- * preceding paragraph, and a new paragraph will be started by a character
- * coming after the LF.
- *
- * Although the text is passed here as a <code>String</code>, it is
- * stored internally as an array of characters. Therefore the
- * documentation will refer to indexes of the characters in the text.
- *
- * @param text contains the text that the Bidi algorithm will be performed
- * on. This text can be retrieved with <code>getText()</code> or
- * <code>getTextAsString</code>.<br>
- *
- * @param paraLevel specifies the default level for the text;
- * it is typically 0 (LTR) or 1 (RTL).
- * If the method shall determine the paragraph level from the text,
- * then <code>paraLevel</code> can be set to
- * either <code>LEVEL_DEFAULT_LTR</code>
- * or <code>LEVEL_DEFAULT_RTL</code>; if the text contains multiple
- * paragraphs, the paragraph level shall be determined separately for
- * each paragraph; if a paragraph does not include any strongly typed
- * character, then the desired default is used (0 for LTR or 1 for RTL).
- * Any other value between 0 and <code>MAX_EXPLICIT_LEVEL</code>
- * is also valid, with odd levels indicating RTL.
- *
- * @param embeddingLevels (in) may be used to preset the embedding and override levels,
- * ignoring characters like LRE and PDF in the text.
- * A level overrides the directional property of its corresponding
- * (same index) character if the level has the
- * <code>LEVEL_OVERRIDE</code> bit set.<br><br>
- * Except for that bit, it must be
- * <code>paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL</code>,
- * with one exception: a level of zero may be specified for a
- * paragraph separator even if <code>paraLevel>0</code> when multiple
- * paragraphs are submitted in the same call to <code>setPara()</code>.<br><br>
- * <strong>Caution: </strong>A reference to this array, not a copy
- * of the levels, will be stored in the <code>Bidi</code> object;
- * the <code>embeddingLevels</code>
- * should not be modified to avoid unexpected results on subsequent
- * Bidi operations. However, the <code>setPara()</code> and
- * <code>setLine()</code> methods may modify some or all of the
- * levels.<br><br>
- * <strong>Note:</strong> the <code>embeddingLevels</code> array must
- * have one entry for each character in <code>text</code>.
- *
- * @throws IllegalArgumentException if the values in embeddingLevels are
- * not within the allowed range
- *
- * @see #LEVEL_DEFAULT_LTR
- * @see #LEVEL_DEFAULT_RTL
- * @see #LEVEL_OVERRIDE
- * @see #MAX_EXPLICIT_LEVEL
- * @stable ICU 3.8
- */
- public void setPara(String text, byte paraLevel, byte[] embeddingLevels)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Perform the Unicode Bidi algorithm. It is defined in the
- * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
- * version 13,
- * also described in The Unicode Standard, Version 4.0 .<p>
- *
- * This method takes a piece of plain text containing one or more paragraphs,
- * with or without externally specified embedding levels from <i>styled</i>
- * text and computes the left-right-directionality of each character.<p>
- *
- * If the entire text is all of the same directionality, then
- * the method may not perform all the steps described by the algorithm,
- * i.e., some levels may not be the same as if all steps were performed.
- * This is not relevant for unidirectional text.<br>
- * For example, in pure LTR text with numbers the numbers would get
- * a resolved level of 2 higher than the surrounding text according to
- * the algorithm. This implementation may set all resolved levels to
- * the same value in such a case.<p>
- *
- * The text can be composed of multiple paragraphs. Occurrence of a block
- * separator in the text terminates a paragraph, and whatever comes next starts
- * a new paragraph. The exception to this rule is when a Carriage Return (CR)
- * is followed by a Line Feed (LF). Both CR and LF are block separators, but
- * in that case, the pair of characters is considered as terminating the
- * preceding paragraph, and a new paragraph will be started by a character
- * coming after the LF.
- *
- * The text is stored internally as an array of characters. Therefore the
- * documentation will refer to indexes of the characters in the text.
- *
- * @param chars contains the text that the Bidi algorithm will be performed
- * on. This text can be retrieved with <code>getText()</code> or
- * <code>getTextAsString</code>.<br>
- *
- * @param paraLevel specifies the default level for the text;
- * it is typically 0 (LTR) or 1 (RTL).
- * If the method shall determine the paragraph level from the text,
- * then <code>paraLevel</code> can be set to
- * either <code>LEVEL_DEFAULT_LTR</code>
- * or <code>LEVEL_DEFAULT_RTL</code>; if the text contains multiple
- * paragraphs, the paragraph level shall be determined separately for
- * each paragraph; if a paragraph does not include any strongly typed
- * character, then the desired default is used (0 for LTR or 1 for RTL).
- * Any other value between 0 and <code>MAX_EXPLICIT_LEVEL</code>
- * is also valid, with odd levels indicating RTL.
- *
- * @param embeddingLevels (in) may be used to preset the embedding and
- * override levels, ignoring characters like LRE and PDF in the text.
- * A level overrides the directional property of its corresponding
- * (same index) character if the level has the
- * <code>LEVEL_OVERRIDE</code> bit set.<br><br>
- * Except for that bit, it must be
- * <code>paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL</code>,
- * with one exception: a level of zero may be specified for a
- * paragraph separator even if <code>paraLevel>0</code> when multiple
- * paragraphs are submitted in the same call to <code>setPara()</code>.<br><br>
- * <strong>Caution: </strong>A reference to this array, not a copy
- * of the levels, will be stored in the <code>Bidi</code> object;
- * the <code>embeddingLevels</code>
- * should not be modified to avoid unexpected results on subsequent
- * Bidi operations. However, the <code>setPara()</code> and
- * <code>setLine()</code> methods may modify some or all of the
- * levels.<br><br>
- * <strong>Note:</strong> the <code>embeddingLevels</code> array must
- * have one entry for each character in <code>text</code>.
- *
- * @throws IllegalArgumentException if the values in embeddingLevels are
- * not within the allowed range
- *
- * @see #LEVEL_DEFAULT_LTR
- * @see #LEVEL_DEFAULT_RTL
- * @see #LEVEL_OVERRIDE
- * @see #MAX_EXPLICIT_LEVEL
- * @stable ICU 3.8
- */
- public void setPara(char[] chars, byte paraLevel, byte[] embeddingLevels)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Perform the Unicode Bidi algorithm on a given paragraph, as defined in the
- * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
- * version 13,
- * also described in The Unicode Standard, Version 4.0 .<p>
- *
- * This method takes a paragraph of text and computes the
- * left-right-directionality of each character. The text should not
- * contain any Unicode block separators.<p>
- *
- * The RUN_DIRECTION attribute in the text, if present, determines the base
- * direction (left-to-right or right-to-left). If not present, the base
- * direction is computed using the Unicode Bidirectional Algorithm,
- * defaulting to left-to-right if there are no strong directional characters
- * in the text. This attribute, if present, must be applied to all the text
- * in the paragraph.<p>
- *
- * The BIDI_EMBEDDING attribute in the text, if present, represents
- * embedding level information. Negative values from -1 to -62 indicate
- * overrides at the absolute value of the level. Positive values from 1 to
- * 62 indicate embeddings. Where values are zero or not defined, the base
- * embedding level as determined by the base direction is assumed.<p>
- *
- * The NUMERIC_SHAPING attribute in the text, if present, converts European
- * digits to other decimal digits before running the bidi algorithm. This
- * attribute, if present, must be applied to all the text in the paragraph.
- *
- * If the entire text is all of the same directionality, then
- * the method may not perform all the steps described by the algorithm,
- * i.e., some levels may not be the same as if all steps were performed.
- * This is not relevant for unidirectional text.<br>
- * For example, in pure LTR text with numbers the numbers would get
- * a resolved level of 2 higher than the surrounding text according to
- * the algorithm. This implementation may set all resolved levels to
- * the same value in such a case.<p>
- *
- * @param paragraph a paragraph of text with optional character and
- * paragraph attribute information
- * @stable ICU 3.8
- */
- public void setPara(AttributedCharacterIterator paragraph)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Specify whether block separators must be allocated level zero,
- * so that successive paragraphs will progress from left to right.
- * This method must be called before <code>setPara()</code>.
- * Paragraph separators (B) may appear in the text. Setting them to level zero
- * means that all paragraph separators (including one possibly appearing
- * in the last text position) are kept in the reordered text after the text
- * that they follow in the source text.
- * When this feature is not enabled, a paragraph separator at the last
- * position of the text before reordering will go to the first position
- * of the reordered text when the paragraph level is odd.
- *
- * @param ordarParaLTR specifies whether paragraph separators (B) must
- * receive level 0, so that successive paragraphs progress from left to right.
- *
- * @see #setPara
- * @stable ICU 3.8
- */
- public void orderParagraphsLTR(boolean ordarParaLTR) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Is this <code>Bidi</code> object set to allocate level 0 to block
- * separators so that successive paragraphs progress from left to right?
- *
- * @return <code>true</code> if the <code>Bidi</code> object is set to
- * allocate level 0 to block separators.
- *
- * @stable ICU 3.8
- */
- public boolean isOrderParagraphsLTR() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the directionality of the text.
- *
- * @return a value of <code>LTR</code>, <code>RTL</code> or <code>MIXED</code>
- * that indicates if the entire text
- * represented by this object is unidirectional,
- * and which direction, or if it is mixed-directional.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #LTR
- * @see #RTL
- * @see #MIXED
- * @stable ICU 3.8
- */
- public byte getDirection()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the text.
- *
- * @return A <code>String</code> containing the text that the
- * <code>Bidi</code> object was created for.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #setPara
- * @see #setLine
- * @stable ICU 3.8
- */
- public String getTextAsString()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the text.
- *
- * @return A <code>char</code> array containing the text that the
- * <code>Bidi</code> object was created for.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #setPara
- * @see #setLine
- * @stable ICU 3.8
- */
- public char[] getText()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Allocate a <code>Bidi</code> object.
+// * Such an object is initially empty. It is assigned
+// * the Bidi properties of a piece of text containing one or more paragraphs
+// * by <code>setPara()</code>
+// * or the Bidi properties of a line within a paragraph by
+// * <code>setLine()</code>.<p>
+// * This object can be reused.<p>
+// * <code>setPara()</code> and <code>setLine()</code> will allocate
+// * additional memory for internal structures as necessary.
+// *
+// * @stable ICU 3.8
+// */
+// public Bidi()
+// {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Allocate a <code>Bidi</code> object with preallocated memory
+// * for internal structures.
+// * This method provides a <code>Bidi</code> object like the default constructor
+// * but it also preallocates memory for internal structures
+// * according to the sizings supplied by the caller.<p>
+// * The preallocation can be limited to some of the internal memory
+// * by setting some values to 0 here. That means that if, e.g.,
+// * <code>maxRunCount</code> cannot be reasonably predetermined and should not
+// * be set to <code>maxLength</code> (the only failproof value) to avoid
+// * wasting memory, then <code>maxRunCount</code> could be set to 0 here
+// * and the internal structures that are associated with it will be allocated
+// * on demand, just like with the default constructor.
+// *
+// * @param maxLength is the maximum text or line length that internal memory
+// * will be preallocated for. An attempt to associate this object with a
+// * longer text will fail, unless this value is 0, which leaves the allocation
+// * up to the implementation.
+// *
+// * @param maxRunCount is the maximum anticipated number of same-level runs
+// * that internal memory will be preallocated for. An attempt to access
+// * visual runs on an object that was not preallocated for as many runs
+// * as the text was actually resolved to will fail,
+// * unless this value is 0, which leaves the allocation up to the implementation.<br><br>
+// * The number of runs depends on the actual text and maybe anywhere between
+// * 1 and <code>maxLength</code>. It is typically small.
+// *
+// * @throws IllegalArgumentException if maxLength or maxRunCount is less than 0
+// * @stable ICU 3.8
+// */
+// public Bidi(int maxLength, int maxRunCount)
+// {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Modify the operation of the Bidi algorithm such that it
+// * approximates an "inverse Bidi" algorithm. This method
+// * must be called before <code>setPara()</code>.
+// *
+// * <p>The normal operation of the Bidi algorithm as described
+// * in the Unicode Technical Report is to take text stored in logical
+// * (keyboard, typing) order and to determine the reordering of it for visual
+// * rendering.
+// * Some legacy systems store text in visual order, and for operations
+// * with standard, Unicode-based algorithms, the text needs to be transformed
+// * to logical order. This is effectively the inverse algorithm of the
+// * described Bidi algorithm. Note that there is no standard algorithm for
+// * this "inverse Bidi" and that the current implementation provides only an
+// * approximation of "inverse Bidi".</p>
+// *
+// * <p>With <code>isInversed</code> set to <code>true</code>,
+// * this method changes the behavior of some of the subsequent methods
+// * in a way that they can be used for the inverse Bidi algorithm.
+// * Specifically, runs of text with numeric characters will be treated in a
+// * special way and may need to be surrounded with LRM characters when they are
+// * written in reordered sequence.</p>
+// *
+// * <p>Output runs should be retrieved using <code>getVisualRun()</code>.
+// * Since the actual input for "inverse Bidi" is visually ordered text and
+// * <code>getVisualRun()</code> gets the reordered runs, these are actually
+// * the runs of the logically ordered output.</p>
+// *
+// * <p>Calling this method with argument <code>isInverse</code> set to
+// * <code>true</code> is equivalent to calling <code>setReorderingMode</code>
+// * with argument <code>reorderingMode</code>
+// * set to <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
+// * Calling this method with argument <code>isInverse</code> set to
+// * <code>false</code> is equivalent to calling <code>setReorderingMode</code>
+// * with argument <code>reorderingMode</code>
+// * set to <code>REORDER_DEFAULT</code>.
+// *
+// * @param isInverse specifies "forward" or "inverse" Bidi operation.
+// *
+// * @see #setPara
+// * @see #writeReordered
+// * @see #setReorderingMode
+// * @see #REORDER_INVERSE_NUMBERS_AS_L
+// * @see #REORDER_DEFAULT
+// * @stable ICU 3.8
+// */
+// public void setInverse(boolean isInverse) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Is this <code>Bidi</code> object set to perform the inverse Bidi
+// * algorithm?
+// * <p>Note: calling this method after setting the reordering mode with
+// * <code>setReorderingMode</code> will return <code>true</code> if the
+// * reordering mode was set to
+// * <code>REORDER_INVERSE_NUMBERS_AS_L<code>, <code>false</code>
+// * for all other values.</p>
+// *
+// * @return <code>true</code> if the <code>Bidi</code> object is set to
+// * perform the inverse Bidi algorithm by handling numbers as L.
+// *
+// * @see #setInverse
+// * @see #setReorderingMode
+// * @see #REORDER_INVERSE_NUMBERS_AS_L
+// * @stable ICU 3.8
+// */
+// public boolean isInverse() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Modify the operation of the Bidi algorithm such that it implements some
+// * variant to the basic Bidi algorithm or approximates an "inverse Bidi"
+// * algorithm, depending on different values of the "reordering mode".
+// * This method must be called before <code>setPara()</code>, and stays in
+// * effect until called again with a different argument.
+// *
+// * <p>The normal operation of the Bidi algorithm as described in the Unicode
+// * Standard Annex #9 is to take text stored in logical (keyboard, typing)
+// * order and to determine how to reorder it for visual rendering.</p>
+// *
+// * <p>With the reordering mode set to a value other than
+// * <code>REORDER_DEFAULT</code>, this method changes the behavior of some of
+// * the subsequent methods in a way such that they implement an inverse Bidi
+// * algorithm or some other algorithm variants.</p>
+// *
+// * <p>Some legacy systems store text in visual order, and for operations
+// * with standard, Unicode-based algorithms, the text needs to be transformed
+// * into logical order. This is effectively the inverse algorithm of the
+// * described Bidi algorithm. Note that there is no standard algorithm for
+// * this "inverse Bidi", so a number of variants are implemented here.</p>
+// *
+// * <p>In other cases, it may be desirable to emulate some variant of the
+// * Logical to Visual algorithm (e.g. one used in MS Windows), or perform a
+// * Logical to Logical transformation.</p>
+// *
+// * <ul>
+// * <li>When the Reordering Mode is set to
+// * <code>REORDER_DEFAULT</code>,
+// * the standard Bidi Logical to Visual algorithm is applied.</li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_NUMBERS_SPECIAL</code>,
+// * the algorithm used to perform Bidi transformations when calling
+// * <code>setPara</code> should approximate the algorithm used in Microsoft
+// * Windows XP rather than strictly conform to the Unicode Bidi algorithm.
+// * <br>
+// * The differences between the basic algorithm and the algorithm addressed
+// * by this option are as follows:
+// * <ul>
+// * <li>Within text at an even embedding level, the sequence "123AB"
+// * (where AB represent R or AL letters) is transformed to "123BA" by the
+// * Unicode algorithm and to "BA123" by the Windows algorithm.</li>
+// *
+// * <li>Arabic-Indic numbers (AN) are handled by the Windows algorithm just
+// * like regular numbers (EN).</li>
+// * </ul></li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_GROUP_NUMBERS_WITH_R</code>,
+// * numbers located between LTR text and RTL text are associated with the RTL
+// * text. For instance, an LTR paragraph with content "abc 123 DEF" (where
+// * upper case letters represent RTL characters) will be transformed to
+// * "abc FED 123" (and not "abc 123 FED"), "DEF 123 abc" will be transformed
+// * to "123 FED abc" and "123 FED abc" will be transformed to "DEF 123 abc".
+// * This makes the algorithm reversible and makes it useful when round trip
+// * (from visual to logical and back to visual) must be achieved without
+// * adding LRM characters. However, this is a variation from the standard
+// * Unicode Bidi algorithm.<br>
+// * The source text should not contain Bidi control characters other than LRM
+// * or RLM.</li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_RUNS_ONLY</code>,
+// * a "Logical to Logical" transformation must be performed:
+// * <ul>
+// * <li>If the default text level of the source text (argument
+// * <code>paraLevel</code> in <code>setPara</code>) is even, the source text
+// * will be handled as LTR logical text and will be transformed to the RTL
+// * logical text which has the same LTR visual display.</li>
+// * <li>If the default level of the source text is odd, the source text
+// * will be handled as RTL logical text and will be transformed to the
+// * LTR logical text which has the same LTR visual display.</li>
+// * </ul>
+// * This mode may be needed when logical text which is basically Arabic or
+// * Hebrew, with possible included numbers or phrases in English, has to be
+// * displayed as if it had an even embedding level (this can happen if the
+// * displaying application treats all text as if it was basically LTR).
+// * <br>
+// * This mode may also be needed in the reverse case, when logical text which
+// * is basically English, with possible included phrases in Arabic or Hebrew,
+// * has to be displayed as if it had an odd embedding level.
+// * <br>
+// * Both cases could be handled by adding LRE or RLE at the head of the
+// * text, if the display subsystem supports these formatting controls. If it
+// * does not, the problem may be handled by transforming the source text in
+// * this mode before displaying it, so that it will be displayed properly.
+// * <br>
+// * The source text should not contain Bidi control characters other than LRM
+// * or RLM.</li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_INVERSE_NUMBERS_AS_L</code>, an "inverse Bidi"
+// * algorithm is applied.
+// * Runs of text with numeric characters will be treated like LTR letters and
+// * may need to be surrounded with LRM characters when they are written in
+// * reordered sequence (the option <code>INSERT_LRM_FOR_NUMERIC</code> can
+// * be used with method <code>writeReordered</code> to this end. This mode
+// * is equivalent to calling <code>setInverse()</code> with
+// * argument <code>isInverse</code> set to <code>true</code>.</li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_INVERSE_LIKE_DIRECT</code>, the "direct" Logical to
+// * Visual Bidi algorithm is used as an approximation of an "inverse Bidi"
+// * algorithm. This mode is similar to mode
+// * <code>REORDER_INVERSE_NUMBERS_AS_L</code> but is closer to the
+// * regular Bidi algorithm.
+// * <br>
+// * For example, an LTR paragraph with the content "FED 123 456 CBA" (where
+// * upper case represents RTL characters) will be transformed to
+// * "ABC 456 123 DEF", as opposed to "DEF 123 456 ABC"
+// * with mode <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
+// * When used in conjunction with option
+// * <code>OPTION_INSERT_MARKS</code>, this mode generally
+// * adds Bidi marks to the output significantly more sparingly than mode
+// * <code>REORDER_INVERSE_NUMBERS_AS_L</code>.<br> with option
+// * <code>INSERT_LRM_FOR_NUMERIC</code> in calls to
+// * <code>writeReordered</code>.</li>
+// *
+// * <li>When the reordering mode is set to
+// * <code>REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the Logical to Visual
+// * Bidi algorithm used in Windows XP is used as an approximation of an "inverse
+// * Bidi" algorithm.
+// * <br>
+// * For example, an LTR paragraph with the content "abc FED123" (where
+// * upper case represents RTL characters) will be transformed to
+// * "abc 123DEF.</li>
+// * </ul>
+// *
+// * <p>In all the reordering modes specifying an "inverse Bidi" algorithm
+// * (i.e. those with a name starting with <code>REORDER_INVERSE</code>),
+// * output runs should be retrieved using <code>getVisualRun()</code>, and
+// * the output text with <code>writeReordered()</code>. The caller should
+// * keep in mind that in "inverse Bidi" modes the input is actually visually
+// * ordered text and reordered output returned by <code>getVisualRun()</code>
+// * or <code>writeReordered()</code> are actually runs or character string
+// * of logically ordered output.<br>
+// * For all the "inverse Bidi" modes, the source text should not contain
+// * Bidi control characters other than LRM or RLM.</p>
+// *
+// * <p>Note that option <code>OUTPUT_REVERSE</code> of
+// * <code>writeReordered</code> has no useful meaning and should not be used
+// * in conjunction with any value of the reordering mode specifying "inverse
+// * Bidi" or with value <code>REORDER_RUNS_ONLY</code>.
+// *
+// * @param reorderingMode specifies the required variant of the Bidi
+// * algorithm.
+// *
+// * @see #setInverse
+// * @see #setPara
+// * @see #writeReordered
+// * @see #INSERT_LRM_FOR_NUMERIC
+// * @see #OUTPUT_REVERSE
+// * @see #REORDER_DEFAULT
+// * @see #REORDER_NUMBERS_SPECIAL
+// * @see #REORDER_GROUP_NUMBERS_WITH_R
+// * @see #REORDER_RUNS_ONLY
+// * @see #REORDER_INVERSE_NUMBERS_AS_L
+// * @see #REORDER_INVERSE_LIKE_DIRECT
+// * @see #REORDER_INVERSE_FOR_NUMBERS_SPECIAL
+// * @stable ICU 3.8
+// */
+// public void setReorderingMode(int reorderingMode) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * What is the requested reordering mode for a given Bidi object?
+// *
+// * @return the current reordering mode of the Bidi object
+// *
+// * @see #setReorderingMode
+// * @stable ICU 3.8
+// */
+// public int getReorderingMode() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Specify which of the reordering options should be applied during Bidi
+// * transformations.
+// *
+// * @param options A combination of zero or more of the following
+// * reordering options:
+// * <code>OPTION_DEFAULT</code>, <code>OPTION_INSERT_MARKS</code>,
+// * <code>OPTION_REMOVE_CONTROLS</code>, <code>OPTION_STREAMING</code>.
+// *
+// * @see #getReorderingOptions
+// * @see #OPTION_DEFAULT
+// * @see #OPTION_INSERT_MARKS
+// * @see #OPTION_REMOVE_CONTROLS
+// * @see #OPTION_STREAMING
+// * @stable ICU 3.8
+// */
+// public void setReorderingOptions(int options) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * What are the reordering options applied to a given Bidi object?
+// *
+// * @return the current reordering options of the Bidi object
+// *
+// * @see #setReorderingOptions
+// * @stable ICU 3.8
+// */
+// public int getReorderingOptions() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Perform the Unicode Bidi algorithm. It is defined in the
+// * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
+// * version 13,
+// * also described in The Unicode Standard, Version 4.0 .<p>
+// *
+// * This method takes a piece of plain text containing one or more paragraphs,
+// * with or without externally specified embedding levels from <i>styled</i>
+// * text and computes the left-right-directionality of each character.<p>
+// *
+// * If the entire text is all of the same directionality, then
+// * the method may not perform all the steps described by the algorithm,
+// * i.e., some levels may not be the same as if all steps were performed.
+// * This is not relevant for unidirectional text.<br>
+// * For example, in pure LTR text with numbers the numbers would get
+// * a resolved level of 2 higher than the surrounding text according to
+// * the algorithm. This implementation may set all resolved levels to
+// * the same value in such a case.<p>
+// *
+// * The text can be composed of multiple paragraphs. Occurrence of a block
+// * separator in the text terminates a paragraph, and whatever comes next starts
+// * a new paragraph. The exception to this rule is when a Carriage Return (CR)
+// * is followed by a Line Feed (LF). Both CR and LF are block separators, but
+// * in that case, the pair of characters is considered as terminating the
+// * preceding paragraph, and a new paragraph will be started by a character
+// * coming after the LF.
+// *
+// * Although the text is passed here as a <code>String</code>, it is
+// * stored internally as an array of characters. Therefore the
+// * documentation will refer to indexes of the characters in the text.
+// *
+// * @param text contains the text that the Bidi algorithm will be performed
+// * on. This text can be retrieved with <code>getText()</code> or
+// * <code>getTextAsString</code>.<br>
+// *
+// * @param paraLevel specifies the default level for the text;
+// * it is typically 0 (LTR) or 1 (RTL).
+// * If the method shall determine the paragraph level from the text,
+// * then <code>paraLevel</code> can be set to
+// * either <code>LEVEL_DEFAULT_LTR</code>
+// * or <code>LEVEL_DEFAULT_RTL</code>; if the text contains multiple
+// * paragraphs, the paragraph level shall be determined separately for
+// * each paragraph; if a paragraph does not include any strongly typed
+// * character, then the desired default is used (0 for LTR or 1 for RTL).
+// * Any other value between 0 and <code>MAX_EXPLICIT_LEVEL</code>
+// * is also valid, with odd levels indicating RTL.
+// *
+// * @param embeddingLevels (in) may be used to preset the embedding and override levels,
+// * ignoring characters like LRE and PDF in the text.
+// * A level overrides the directional property of its corresponding
+// * (same index) character if the level has the
+// * <code>LEVEL_OVERRIDE</code> bit set.<br><br>
+// * Except for that bit, it must be
+// * <code>paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL</code>,
+// * with one exception: a level of zero may be specified for a
+// * paragraph separator even if <code>paraLevel>0</code> when multiple
+// * paragraphs are submitted in the same call to <code>setPara()</code>.<br><br>
+// * <strong>Caution: </strong>A reference to this array, not a copy
+// * of the levels, will be stored in the <code>Bidi</code> object;
+// * the <code>embeddingLevels</code>
+// * should not be modified to avoid unexpected results on subsequent
+// * Bidi operations. However, the <code>setPara()</code> and
+// * <code>setLine()</code> methods may modify some or all of the
+// * levels.<br><br>
+// * <strong>Note:</strong> the <code>embeddingLevels</code> array must
+// * have one entry for each character in <code>text</code>.
+// *
+// * @throws IllegalArgumentException if the values in embeddingLevels are
+// * not within the allowed range
+// *
+// * @see #LEVEL_DEFAULT_LTR
+// * @see #LEVEL_DEFAULT_RTL
+// * @see #LEVEL_OVERRIDE
+// * @see #MAX_EXPLICIT_LEVEL
+// * @stable ICU 3.8
+// */
+// public void setPara(String text, byte paraLevel, byte[] embeddingLevels)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Perform the Unicode Bidi algorithm. It is defined in the
+// * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
+// * version 13,
+// * also described in The Unicode Standard, Version 4.0 .<p>
+// *
+// * This method takes a piece of plain text containing one or more paragraphs,
+// * with or without externally specified embedding levels from <i>styled</i>
+// * text and computes the left-right-directionality of each character.<p>
+// *
+// * If the entire text is all of the same directionality, then
+// * the method may not perform all the steps described by the algorithm,
+// * i.e., some levels may not be the same as if all steps were performed.
+// * This is not relevant for unidirectional text.<br>
+// * For example, in pure LTR text with numbers the numbers would get
+// * a resolved level of 2 higher than the surrounding text according to
+// * the algorithm. This implementation may set all resolved levels to
+// * the same value in such a case.<p>
+// *
+// * The text can be composed of multiple paragraphs. Occurrence of a block
+// * separator in the text terminates a paragraph, and whatever comes next starts
+// * a new paragraph. The exception to this rule is when a Carriage Return (CR)
+// * is followed by a Line Feed (LF). Both CR and LF are block separators, but
+// * in that case, the pair of characters is considered as terminating the
+// * preceding paragraph, and a new paragraph will be started by a character
+// * coming after the LF.
+// *
+// * The text is stored internally as an array of characters. Therefore the
+// * documentation will refer to indexes of the characters in the text.
+// *
+// * @param chars contains the text that the Bidi algorithm will be performed
+// * on. This text can be retrieved with <code>getText()</code> or
+// * <code>getTextAsString</code>.<br>
+// *
+// * @param paraLevel specifies the default level for the text;
+// * it is typically 0 (LTR) or 1 (RTL).
+// * If the method shall determine the paragraph level from the text,
+// * then <code>paraLevel</code> can be set to
+// * either <code>LEVEL_DEFAULT_LTR</code>
+// * or <code>LEVEL_DEFAULT_RTL</code>; if the text contains multiple
+// * paragraphs, the paragraph level shall be determined separately for
+// * each paragraph; if a paragraph does not include any strongly typed
+// * character, then the desired default is used (0 for LTR or 1 for RTL).
+// * Any other value between 0 and <code>MAX_EXPLICIT_LEVEL</code>
+// * is also valid, with odd levels indicating RTL.
+// *
+// * @param embeddingLevels (in) may be used to preset the embedding and
+// * override levels, ignoring characters like LRE and PDF in the text.
+// * A level overrides the directional property of its corresponding
+// * (same index) character if the level has the
+// * <code>LEVEL_OVERRIDE</code> bit set.<br><br>
+// * Except for that bit, it must be
+// * <code>paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL</code>,
+// * with one exception: a level of zero may be specified for a
+// * paragraph separator even if <code>paraLevel>0</code> when multiple
+// * paragraphs are submitted in the same call to <code>setPara()</code>.<br><br>
+// * <strong>Caution: </strong>A reference to this array, not a copy
+// * of the levels, will be stored in the <code>Bidi</code> object;
+// * the <code>embeddingLevels</code>
+// * should not be modified to avoid unexpected results on subsequent
+// * Bidi operations. However, the <code>setPara()</code> and
+// * <code>setLine()</code> methods may modify some or all of the
+// * levels.<br><br>
+// * <strong>Note:</strong> the <code>embeddingLevels</code> array must
+// * have one entry for each character in <code>text</code>.
+// *
+// * @throws IllegalArgumentException if the values in embeddingLevels are
+// * not within the allowed range
+// *
+// * @see #LEVEL_DEFAULT_LTR
+// * @see #LEVEL_DEFAULT_RTL
+// * @see #LEVEL_OVERRIDE
+// * @see #MAX_EXPLICIT_LEVEL
+// * @stable ICU 3.8
+// */
+// public void setPara(char[] chars, byte paraLevel, byte[] embeddingLevels)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Perform the Unicode Bidi algorithm on a given paragraph, as defined in the
+// * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
+// * version 13,
+// * also described in The Unicode Standard, Version 4.0 .<p>
+// *
+// * This method takes a paragraph of text and computes the
+// * left-right-directionality of each character. The text should not
+// * contain any Unicode block separators.<p>
+// *
+// * The RUN_DIRECTION attribute in the text, if present, determines the base
+// * direction (left-to-right or right-to-left). If not present, the base
+// * direction is computed using the Unicode Bidirectional Algorithm,
+// * defaulting to left-to-right if there are no strong directional characters
+// * in the text. This attribute, if present, must be applied to all the text
+// * in the paragraph.<p>
+// *
+// * The BIDI_EMBEDDING attribute in the text, if present, represents
+// * embedding level information. Negative values from -1 to -62 indicate
+// * overrides at the absolute value of the level. Positive values from 1 to
+// * 62 indicate embeddings. Where values are zero or not defined, the base
+// * embedding level as determined by the base direction is assumed.<p>
+// *
+// * The NUMERIC_SHAPING attribute in the text, if present, converts European
+// * digits to other decimal digits before running the bidi algorithm. This
+// * attribute, if present, must be applied to all the text in the paragraph.
+// *
+// * If the entire text is all of the same directionality, then
+// * the method may not perform all the steps described by the algorithm,
+// * i.e., some levels may not be the same as if all steps were performed.
+// * This is not relevant for unidirectional text.<br>
+// * For example, in pure LTR text with numbers the numbers would get
+// * a resolved level of 2 higher than the surrounding text according to
+// * the algorithm. This implementation may set all resolved levels to
+// * the same value in such a case.<p>
+// *
+// * @param paragraph a paragraph of text with optional character and
+// * paragraph attribute information
+// * @stable ICU 3.8
+// */
+// public void setPara(AttributedCharacterIterator paragraph)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Specify whether block separators must be allocated level zero,
+// * so that successive paragraphs will progress from left to right.
+// * This method must be called before <code>setPara()</code>.
+// * Paragraph separators (B) may appear in the text. Setting them to level zero
+// * means that all paragraph separators (including one possibly appearing
+// * in the last text position) are kept in the reordered text after the text
+// * that they follow in the source text.
+// * When this feature is not enabled, a paragraph separator at the last
+// * position of the text before reordering will go to the first position
+// * of the reordered text when the paragraph level is odd.
+// *
+// * @param ordarParaLTR specifies whether paragraph separators (B) must
+// * receive level 0, so that successive paragraphs progress from left to right.
+// *
+// * @see #setPara
+// * @stable ICU 3.8
+// */
+// public void orderParagraphsLTR(boolean ordarParaLTR) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Is this <code>Bidi</code> object set to allocate level 0 to block
+// * separators so that successive paragraphs progress from left to right?
+// *
+// * @return <code>true</code> if the <code>Bidi</code> object is set to
+// * allocate level 0 to block separators.
+// *
+// * @stable ICU 3.8
+// */
+// public boolean isOrderParagraphsLTR() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the directionality of the text.
+// *
+// * @return a value of <code>LTR</code>, <code>RTL</code> or <code>MIXED</code>
+// * that indicates if the entire text
+// * represented by this object is unidirectional,
+// * and which direction, or if it is mixed-directional.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #LTR
+// * @see #RTL
+// * @see #MIXED
+// * @stable ICU 3.8
+// */
+// public byte getDirection()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the text.
+// *
+// * @return A <code>String</code> containing the text that the
+// * <code>Bidi</code> object was created for.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #setPara
+// * @see #setLine
+// * @stable ICU 3.8
+// */
+// public String getTextAsString()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the text.
+// *
+// * @return A <code>char</code> array containing the text that the
+// * <code>Bidi</code> object was created for.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #setPara
+// * @see #setLine
+// * @stable ICU 3.8
+// */
+// public char[] getText()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Get the length of the text.
return bidi.getLength();
}
- /**
- * Get the length of the source text processed by the last call to
- * <code>setPara()</code>. This length may be different from the length of
- * the source text if option <code>OPTION_STREAMING</code> has been
- * set.
- * <br>
- * Note that whenever the length of the text affects the execution or the
- * result of a method, it is the processed length which must be considered,
- * except for <code>setPara</code> (which receives unprocessed source text)
- * and <code>getLength</code> (which returns the original length of the
- * source text).<br>
- * In particular, the processed length is the one to consider in the
- * following cases:
- * <ul>
- * <li>maximum value of the <code>limit</code> argument of
- * <code>setLine</code></li>
- * <li>maximum value of the <code>charIndex</code> argument of
- * <code>getParagraph</code></li>
- * <li>maximum value of the <code>charIndex</code> argument of
- * <code>getLevelAt</code></li>
- * <li>number of elements in the array returned by <code>getLevels</code>
- * </li>
- * <li>maximum value of the <code>logicalStart</code> argument of
- * <code>getLogicalRun</code></li>
- * <li>maximum value of the <code>logicalIndex</code> argument of
- * <code>getVisualIndex</code></li>
- * <li>number of elements returned by <code>getLogicalMap</code></li>
- * <li>length of text processed by <code>writeReordered</code></li>
- * </ul>
- *
- * @return The length of the part of the source text processed by
- * the last call to <code>setPara</code>.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #setPara
- * @see #OPTION_STREAMING
- * @stable ICU 3.8
- */
- public int getProcessedLength() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the length of the reordered text resulting from the last call to
- * <code>setPara()</code>. This length may be different from the length
- * of the source text if option <code>OPTION_INSERT_MARKS</code>
- * or option <code>OPTION_REMOVE_CONTROLS</code> has been set.
- * <br>
- * This resulting length is the one to consider in the following cases:
- * <ul>
- * <li>maximum value of the <code>visualIndex</code> argument of
- * <code>getLogicalIndex</code></li>
- * <li>number of elements returned by <code>getVisualMap</code></li>
- * </ul>
- * Note that this length stays identical to the source text length if
- * Bidi marks are inserted or removed using option bits of
- * <code>writeReordered</code>, or if option
- * <code>REORDER_INVERSE_NUMBERS_AS_L</code> has been set.
- *
- * @return The length of the reordered text resulting from
- * the last call to <code>setPara</code>.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #setPara
- * @see #OPTION_INSERT_MARKS
- * @see #OPTION_REMOVE_CONTROLS
- * @see #REORDER_INVERSE_NUMBERS_AS_L
- * @stable ICU 3.8
- */
- public int getResultLength() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Get the length of the source text processed by the last call to
+// * <code>setPara()</code>. This length may be different from the length of
+// * the source text if option <code>OPTION_STREAMING</code> has been
+// * set.
+// * <br>
+// * Note that whenever the length of the text affects the execution or the
+// * result of a method, it is the processed length which must be considered,
+// * except for <code>setPara</code> (which receives unprocessed source text)
+// * and <code>getLength</code> (which returns the original length of the
+// * source text).<br>
+// * In particular, the processed length is the one to consider in the
+// * following cases:
+// * <ul>
+// * <li>maximum value of the <code>limit</code> argument of
+// * <code>setLine</code></li>
+// * <li>maximum value of the <code>charIndex</code> argument of
+// * <code>getParagraph</code></li>
+// * <li>maximum value of the <code>charIndex</code> argument of
+// * <code>getLevelAt</code></li>
+// * <li>number of elements in the array returned by <code>getLevels</code>
+// * </li>
+// * <li>maximum value of the <code>logicalStart</code> argument of
+// * <code>getLogicalRun</code></li>
+// * <li>maximum value of the <code>logicalIndex</code> argument of
+// * <code>getVisualIndex</code></li>
+// * <li>number of elements returned by <code>getLogicalMap</code></li>
+// * <li>length of text processed by <code>writeReordered</code></li>
+// * </ul>
+// *
+// * @return The length of the part of the source text processed by
+// * the last call to <code>setPara</code>.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #setPara
+// * @see #OPTION_STREAMING
+// * @stable ICU 3.8
+// */
+// public int getProcessedLength() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the length of the reordered text resulting from the last call to
+// * <code>setPara()</code>. This length may be different from the length
+// * of the source text if option <code>OPTION_INSERT_MARKS</code>
+// * or option <code>OPTION_REMOVE_CONTROLS</code> has been set.
+// * <br>
+// * This resulting length is the one to consider in the following cases:
+// * <ul>
+// * <li>maximum value of the <code>visualIndex</code> argument of
+// * <code>getLogicalIndex</code></li>
+// * <li>number of elements returned by <code>getVisualMap</code></li>
+// * </ul>
+// * Note that this length stays identical to the source text length if
+// * Bidi marks are inserted or removed using option bits of
+// * <code>writeReordered</code>, or if option
+// * <code>REORDER_INVERSE_NUMBERS_AS_L</code> has been set.
+// *
+// * @return The length of the reordered text resulting from
+// * the last call to <code>setPara</code>.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #setPara
+// * @see #OPTION_INSERT_MARKS
+// * @see #OPTION_REMOVE_CONTROLS
+// * @see #REORDER_INVERSE_NUMBERS_AS_L
+// * @stable ICU 3.8
+// */
+// public int getResultLength() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/* paragraphs API methods ------------------------------------------------- */
- /**
- * Get the paragraph level of the text.
- *
- * @return The paragraph level. If there are multiple paragraphs, their
- * level may vary if the required paraLevel is LEVEL_DEFAULT_LTR or
- * LEVEL_DEFAULT_RTL. In that case, the level of the first paragraph
- * is returned.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #LEVEL_DEFAULT_LTR
- * @see #LEVEL_DEFAULT_RTL
- * @see #getParagraph
- * @see #getParagraphByIndex
- * @stable ICU 3.8
- */
- public byte getParaLevel()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the number of paragraphs.
- *
- * @return The number of paragraphs.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @stable ICU 3.8
- */
- public int countParagraphs()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get a paragraph, given the index of this paragraph.
- *
- * This method returns information about a paragraph.<p>
- *
- * @param paraIndex is the number of the paragraph, in the
- * range <code>[0..countParagraphs()-1]</code>.
- *
- * @return a BidiRun object with the details of the paragraph:<br>
- * <code>start</code> will receive the index of the first character
- * of the paragraph in the text.<br>
- * <code>limit</code> will receive the limit of the paragraph.<br>
- * <code>embeddingLevel</code> will receive the level of the paragraph.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if paraIndex is not in the range
- * <code>[0..countParagraphs()-1]</code>
- *
- * @see com.ibm.icu.text.BidiRun
- * @stable ICU 3.8
- */
- public BidiRun getParagraphByIndex(int paraIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get a paragraph, given a position within the text.
- * This method returns information about a paragraph.<br>
- * Note: if the paragraph index is known, it is more efficient to
- * retrieve the paragraph information using getParagraphByIndex().<p>
- *
- * @param charIndex is the index of a character within the text, in the
- * range <code>[0..getProcessedLength()-1]</code>.
- *
- * @return a BidiRun object with the details of the paragraph:<br>
- * <code>start</code> will receive the index of the first character
- * of the paragraph in the text.<br>
- * <code>limit</code> will receive the limit of the paragraph.<br>
- * <code>embeddingLevel</code> will receive the level of the paragraph.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if charIndex is not within the legal range
- *
- * @see com.ibm.icu.text.BidiRun
- * @see #getParagraphByIndex
- * @see #getProcessedLength
- * @stable ICU 3.8
- */
- public BidiRun getParagraph(int charIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the index of a paragraph, given a position within the text.<p>
- *
- * @param charIndex is the index of a character within the text, in the
- * range <code>[0..getProcessedLength()-1]</code>.
- *
- * @return The index of the paragraph containing the specified position,
- * starting from 0.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if charIndex is not within the legal range
- *
- * @see com.ibm.icu.text.BidiRun
- * @see #getProcessedLength
- * @stable ICU 3.8
- */
- public int getParagraphIndex(int charIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Set a custom Bidi classifier used by the UBA implementation for Bidi
- * class determination.
- *
- * @param classifier A new custom classifier. This can be null.
- *
- * @see #getCustomClassifier
- * @stable ICU 3.8
- */
- public void setCustomClassifier(BidiClassifier classifier) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Gets the current custom class classifier used for Bidi class
- * determination.
- *
- * @return An instance of class <code>BidiClassifier</code>
- *
- * @see #setCustomClassifier
- * @stable ICU 3.8
- */
- public BidiClassifier getCustomClassifier() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Retrieves the Bidi class for a given code point.
- * <p>If a <code>BidiClassifier</code> is defined and returns a value
- * other than <code>CLASS_DEFAULT</code>, that value is used; otherwise
- * the default class determination mechanism is invoked.</p>
- *
- * @param c The code point to get a Bidi class for.
- *
- * @return The Bidi class for the character <code>c</code> that is in effect
- * for this <code>Bidi</code> instance.
- *
- * @see BidiClassifier
- * @stable ICU 3.8
- */
- public int getCustomizedClass(int c) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * <code>setLine()</code> returns a <code>Bidi</code> object to
- * contain the reordering information, especially the resolved levels,
- * for all the characters in a line of text. This line of text is
- * specified by referring to a <code>Bidi</code> object representing
- * this information for a piece of text containing one or more paragraphs,
- * and by specifying a range of indexes in this text.<p>
- * In the new line object, the indexes will range from 0 to <code>limit-start-1</code>.<p>
- *
- * This is used after calling <code>setPara()</code>
- * for a piece of text, and after line-breaking on that text.
- * It is not necessary if each paragraph is treated as a single line.<p>
- *
- * After line-breaking, rules (L1) and (L2) for the treatment of
- * trailing WS and for reordering are performed on
- * a <code>Bidi</code> object that represents a line.<p>
- *
- * <strong>Important: </strong>the line <code>Bidi</code> object may
- * reference data within the global text <code>Bidi</code> object.
- * You should not alter the content of the global text object until
- * you are finished using the line object.
- *
- * @param start is the line's first index into the text.
- *
- * @param limit is just behind the line's last index into the text
- * (its last index +1).
- *
- * @return a <code>Bidi</code> object that will now represent a line of the text.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code>
- * @throws IllegalArgumentException if start and limit are not in the range
- * <code>0<=start<limit<=getProcessedLength()</code>,
- * or if the specified line crosses a paragraph boundary
- *
- * @see #setPara
- * @see #getProcessedLength
- * @stable ICU 3.8
- */
- public Bidi setLine(int start, int limit)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Get the paragraph level of the text.
+// *
+// * @return The paragraph level. If there are multiple paragraphs, their
+// * level may vary if the required paraLevel is LEVEL_DEFAULT_LTR or
+// * LEVEL_DEFAULT_RTL. In that case, the level of the first paragraph
+// * is returned.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #LEVEL_DEFAULT_LTR
+// * @see #LEVEL_DEFAULT_RTL
+// * @see #getParagraph
+// * @see #getParagraphByIndex
+// * @stable ICU 3.8
+// */
+// public byte getParaLevel()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the number of paragraphs.
+// *
+// * @return The number of paragraphs.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @stable ICU 3.8
+// */
+// public int countParagraphs()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get a paragraph, given the index of this paragraph.
+// *
+// * This method returns information about a paragraph.<p>
+// *
+// * @param paraIndex is the number of the paragraph, in the
+// * range <code>[0..countParagraphs()-1]</code>.
+// *
+// * @return a BidiRun object with the details of the paragraph:<br>
+// * <code>start</code> will receive the index of the first character
+// * of the paragraph in the text.<br>
+// * <code>limit</code> will receive the limit of the paragraph.<br>
+// * <code>embeddingLevel</code> will receive the level of the paragraph.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if paraIndex is not in the range
+// * <code>[0..countParagraphs()-1]</code>
+// *
+// * @see com.ibm.icu.text.BidiRun
+// * @stable ICU 3.8
+// */
+// public BidiRun getParagraphByIndex(int paraIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get a paragraph, given a position within the text.
+// * This method returns information about a paragraph.<br>
+// * Note: if the paragraph index is known, it is more efficient to
+// * retrieve the paragraph information using getParagraphByIndex().<p>
+// *
+// * @param charIndex is the index of a character within the text, in the
+// * range <code>[0..getProcessedLength()-1]</code>.
+// *
+// * @return a BidiRun object with the details of the paragraph:<br>
+// * <code>start</code> will receive the index of the first character
+// * of the paragraph in the text.<br>
+// * <code>limit</code> will receive the limit of the paragraph.<br>
+// * <code>embeddingLevel</code> will receive the level of the paragraph.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if charIndex is not within the legal range
+// *
+// * @see com.ibm.icu.text.BidiRun
+// * @see #getParagraphByIndex
+// * @see #getProcessedLength
+// * @stable ICU 3.8
+// */
+// public BidiRun getParagraph(int charIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the index of a paragraph, given a position within the text.<p>
+// *
+// * @param charIndex is the index of a character within the text, in the
+// * range <code>[0..getProcessedLength()-1]</code>.
+// *
+// * @return The index of the paragraph containing the specified position,
+// * starting from 0.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if charIndex is not within the legal range
+// *
+// * @see com.ibm.icu.text.BidiRun
+// * @see #getProcessedLength
+// * @stable ICU 3.8
+// */
+// public int getParagraphIndex(int charIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Set a custom Bidi classifier used by the UBA implementation for Bidi
+// * class determination.
+// *
+// * @param classifier A new custom classifier. This can be null.
+// *
+// * @see #getCustomClassifier
+// * @stable ICU 3.8
+// */
+// public void setCustomClassifier(BidiClassifier classifier) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Gets the current custom class classifier used for Bidi class
+// * determination.
+// *
+// * @return An instance of class <code>BidiClassifier</code>
+// *
+// * @see #setCustomClassifier
+// * @stable ICU 3.8
+// */
+// public BidiClassifier getCustomClassifier() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Retrieves the Bidi class for a given code point.
+// * <p>If a <code>BidiClassifier</code> is defined and returns a value
+// * other than <code>CLASS_DEFAULT</code>, that value is used; otherwise
+// * the default class determination mechanism is invoked.</p>
+// *
+// * @param c The code point to get a Bidi class for.
+// *
+// * @return The Bidi class for the character <code>c</code> that is in effect
+// * for this <code>Bidi</code> instance.
+// *
+// * @see BidiClassifier
+// * @stable ICU 3.8
+// */
+// public int getCustomizedClass(int c) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * <code>setLine()</code> returns a <code>Bidi</code> object to
+// * contain the reordering information, especially the resolved levels,
+// * for all the characters in a line of text. This line of text is
+// * specified by referring to a <code>Bidi</code> object representing
+// * this information for a piece of text containing one or more paragraphs,
+// * and by specifying a range of indexes in this text.<p>
+// * In the new line object, the indexes will range from 0 to <code>limit-start-1</code>.<p>
+// *
+// * This is used after calling <code>setPara()</code>
+// * for a piece of text, and after line-breaking on that text.
+// * It is not necessary if each paragraph is treated as a single line.<p>
+// *
+// * After line-breaking, rules (L1) and (L2) for the treatment of
+// * trailing WS and for reordering are performed on
+// * a <code>Bidi</code> object that represents a line.<p>
+// *
+// * <strong>Important: </strong>the line <code>Bidi</code> object may
+// * reference data within the global text <code>Bidi</code> object.
+// * You should not alter the content of the global text object until
+// * you are finished using the line object.
+// *
+// * @param start is the line's first index into the text.
+// *
+// * @param limit is just behind the line's last index into the text
+// * (its last index +1).
+// *
+// * @return a <code>Bidi</code> object that will now represent a line of the text.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code>
+// * @throws IllegalArgumentException if start and limit are not in the range
+// * <code>0<=start<limit<=getProcessedLength()</code>,
+// * or if the specified line crosses a paragraph boundary
+// *
+// * @see #setPara
+// * @see #getProcessedLength
+// * @stable ICU 3.8
+// */
+// public Bidi setLine(int start, int limit)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Get the level for one character.
return (byte)bidi.getLevelAt(charIndex);
}
- /**
- * Get an array of levels for each character.<p>
- *
- * Note that this method may allocate memory under some
- * circumstances, unlike <code>getLevelAt()</code>.
- *
- * @return The levels array for the text,
- * or <code>null</code> if an error occurs.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @stable ICU 3.8
- */
- public byte[] getLevels()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get a logical run.
- * This method returns information about a run and is used
- * to retrieve runs in logical order.<p>
- * This is especially useful for line-breaking on a paragraph.
- *
- * @param logicalPosition is a logical position within the source text.
- *
- * @return a BidiRun object filled with <code>start</code> containing
- * the first character of the run, <code>limit</code> containing
- * the limit of the run, and <code>embeddingLevel</code> containing
- * the level of the run.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if logicalPosition is not in the range
- * <code>0<=logicalPosition<getProcessedLength()</code>
- *
- * @see com.ibm.icu.text.BidiRun
- * @see com.ibm.icu.text.BidiRun#getStart()
- * @see com.ibm.icu.text.BidiRun#getLimit()
- * @see com.ibm.icu.text.BidiRun#getEmbeddingLevel()
- *
- * @stable ICU 3.8
- */
- public BidiRun getLogicalRun(int logicalPosition)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the number of runs.
- * This method may invoke the actual reordering on the
- * <code>Bidi</code> object, after <code>setPara()</code>
- * may have resolved only the levels of the text. Therefore,
- * <code>countRuns()</code> may have to allocate memory,
- * and may throw an exception if it fails to do so.
- *
- * @return The number of runs.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @stable ICU 3.8
- */
- public int countRuns()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- *
- * Get a <code>BidiRun</code> object according to its index. BidiRun methods
- * may be used to retrieve the run's logical start, length and level,
- * which can be even for an LTR run or odd for an RTL run.
- * In an RTL run, the character at the logical start is
- * visually on the right of the displayed run.
- * The length is the number of characters in the run.<p>
- * <code>countRuns()</code> is normally called
- * before the runs are retrieved.
- *
- * <p>
- * Example:
- * <pre>
- * Bidi bidi = new Bidi();
- * String text = "abc 123 DEFG xyz";
- * bidi.setPara(text, Bidi.RTL, null);
- * int i, count=bidi.countRuns(), logicalStart, visualIndex=0, length;
- * BidiRun run;
- * for (i = 0; i < count; ++i) {
- * run = bidi.getVisualRun(i);
- * logicalStart = run.getStart();
- * length = run.getLength();
- * if (Bidi.LTR == run.getEmbeddingLevel()) {
- * do { // LTR
- * show_char(text.charAt(logicalStart++), visualIndex++);
- * } while (--length > 0);
- * } else {
- * logicalStart += length; // logicalLimit
- * do { // RTL
- * show_char(text.charAt(--logicalStart), visualIndex++);
- * } while (--length > 0);
- * }
- * }
- * </pre>
- * <p>
- * Note that in right-to-left runs, code like this places
- * second surrogates before first ones (which is generally a bad idea)
- * and combining characters before base characters.
- * <p>
- * Use of <code>{@link #writeReordered}</code>, optionally with the
- * <code>{@link #KEEP_BASE_COMBINING}</code> option, can be considered in
- * order to avoid these issues.
- *
- * @param runIndex is the number of the run in visual order, in the
- * range <code>[0..countRuns()-1]</code>.
- *
- * @return a BidiRun object containing the details of the run. The
- * directionality of the run is
- * <code>LTR==0</code> or <code>RTL==1</code>,
- * never <code>MIXED</code>.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if <code>runIndex</code> is not in
- * the range <code>0<=runIndex<countRuns()</code>
- *
- * @see #countRuns()
- * @see com.ibm.icu.text.BidiRun
- * @see com.ibm.icu.text.BidiRun#getStart()
- * @see com.ibm.icu.text.BidiRun#getLength()
- * @see com.ibm.icu.text.BidiRun#getEmbeddingLevel()
- * @stable ICU 3.8
- */
- public BidiRun getVisualRun(int runIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the visual position from a logical text position.
- * If such a mapping is used many times on the same
- * <code>Bidi</code> object, then calling
- * <code>getLogicalMap()</code> is more efficient.
- * <p>
- * The value returned may be <code>MAP_NOWHERE</code> if there is no
- * visual position because the corresponding text character is a Bidi
- * control removed from output by the option
- * <code>OPTION_REMOVE_CONTROLS</code>.
- * <p>
- * When the visual output is altered by using options of
- * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
- * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
- * <code>REMOVE_BIDI_CONTROLS</code>, the visual position returned may not
- * be correct. It is advised to use, when possible, reordering options
- * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
- * <p>
- * Note that in right-to-left runs, this mapping places
- * second surrogates before first ones (which is generally a bad idea)
- * and combining characters before base characters.
- * Use of <code>{@link #writeReordered}</code>, optionally with the
- * <code>{@link #KEEP_BASE_COMBINING}</code> option can be considered instead
- * of using the mapping, in order to avoid these issues.
- *
- * @param logicalIndex is the index of a character in the text.
- *
- * @return The visual position of this character.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if <code>logicalIndex</code> is not in
- * the range <code>0<=logicalIndex<getProcessedLength()</code>
- *
- * @see #getLogicalMap
- * @see #getLogicalIndex
- * @see #getProcessedLength
- * @see #MAP_NOWHERE
- * @see #OPTION_REMOVE_CONTROLS
- * @see #writeReordered
- * @stable ICU 3.8
- */
- public int getVisualIndex(int logicalIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
-
- /**
- * Get the logical text position from a visual position.
- * If such a mapping is used many times on the same
- * <code>Bidi</code> object, then calling
- * <code>getVisualMap()</code> is more efficient.
- * <p>
- * The value returned may be <code>MAP_NOWHERE</code> if there is no
- * logical position because the corresponding text character is a Bidi
- * mark inserted in the output by option
- * <code>OPTION_INSERT_MARKS</code>.
- * <p>
- * This is the inverse method to <code>getVisualIndex()</code>.
- * <p>
- * When the visual output is altered by using options of
- * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
- * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
- * <code>REMOVE_BIDI_CONTROLS</code>, the logical position returned may not
- * be correct. It is advised to use, when possible, reordering options
- * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
- *
- * @param visualIndex is the visual position of a character.
- *
- * @return The index of this character in the text.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- * @throws IllegalArgumentException if <code>visualIndex</code> is not in
- * the range <code>0<=visualIndex<getResultLength()</code>
- *
- * @see #getVisualMap
- * @see #getVisualIndex
- * @see #getResultLength
- * @see #MAP_NOWHERE
- * @see #OPTION_INSERT_MARKS
- * @see #writeReordered
- * @stable ICU 3.8
- */
- public int getLogicalIndex(int visualIndex)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get a logical-to-visual index map (array) for the characters in the
- * <code>Bidi</code> (paragraph or line) object.
- * <p>
- * Some values in the map may be <code>MAP_NOWHERE</code> if the
- * corresponding text characters are Bidi controls removed from the visual
- * output by the option <code>OPTION_REMOVE_CONTROLS</code>.
- * <p>
- * When the visual output is altered by using options of
- * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
- * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
- * <code>REMOVE_BIDI_CONTROLS</code>, the visual positions returned may not
- * be correct. It is advised to use, when possible, reordering options
- * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
- * <p>
- * Note that in right-to-left runs, this mapping places
- * second surrogates before first ones (which is generally a bad idea)
- * and combining characters before base characters.
- * Use of <code>{@link #writeReordered}</code>, optionally with the
- * <code>{@link #KEEP_BASE_COMBINING}</code> option can be considered instead
- * of using the mapping, in order to avoid these issues.
- *
- * @return an array of <code>getProcessedLength()</code>
- * indexes which will reflect the reordering of the characters.<br><br>
- * The index map will result in
- * <code>indexMap[logicalIndex]==visualIndex</code>, where
- * <code>indexMap</code> represents the returned array.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #getVisualMap
- * @see #getVisualIndex
- * @see #getProcessedLength
- * @see #MAP_NOWHERE
- * @see #OPTION_REMOVE_CONTROLS
- * @see #writeReordered
- * @stable ICU 3.8
- */
- public int[] getLogicalMap()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get a visual-to-logical index map (array) for the characters in the
- * <code>Bidi</code> (paragraph or line) object.
- * <p>
- * Some values in the map may be <code>MAP_NOWHERE</code> if the
- * corresponding text characters are Bidi marks inserted in the visual
- * output by the option <code>OPTION_INSERT_MARKS</code>.
- * <p>
- * When the visual output is altered by using options of
- * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
- * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
- * <code>REMOVE_BIDI_CONTROLS</code>, the logical positions returned may not
- * be correct. It is advised to use, when possible, reordering options
- * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
- *
- * @return an array of <code>getResultLength()</code>
- * indexes which will reflect the reordering of the characters.<br><br>
- * The index map will result in
- * <code>indexMap[visualIndex]==logicalIndex</code>, where
- * <code>indexMap</code> represents the returned array.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #getLogicalMap
- * @see #getLogicalIndex
- * @see #getResultLength
- * @see #MAP_NOWHERE
- * @see #OPTION_INSERT_MARKS
- * @see #writeReordered
- * @stable ICU 3.8
- */
- public int[] getVisualMap()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * This is a convenience method that does not use a <code>Bidi</code> object.
- * It is intended to be used for when an application has determined the levels
- * of objects (character sequences) and just needs to have them reordered (L2).
- * This is equivalent to using <code>getLogicalMap()</code> on a
- * <code>Bidi</code> object.
- *
- * @param levels is an array of levels that have been determined by
- * the application.
- *
- * @return an array of <code>levels.length</code>
- * indexes which will reflect the reordering of the characters.<p>
- * The index map will result in
- * <code>indexMap[logicalIndex]==visualIndex</code>, where
- * <code>indexMap</code> represents the returned array.
- *
- * @stable ICU 3.8
- */
- public static int[] reorderLogical(byte[] levels)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * This is a convenience method that does not use a <code>Bidi</code> object.
- * It is intended to be used for when an application has determined the levels
- * of objects (character sequences) and just needs to have them reordered (L2).
- * This is equivalent to using <code>getVisualMap()</code> on a
- * <code>Bidi</code> object.
- *
- * @param levels is an array of levels that have been determined by
- * the application.
- *
- * @return an array of <code>levels.length</code>
- * indexes which will reflect the reordering of the characters.<p>
- * The index map will result in
- * <code>indexMap[visualIndex]==logicalIndex</code>, where
- * <code>indexMap</code> represents the returned array.
- *
- * @stable ICU 3.8
- */
- public static int[] reorderVisual(byte[] levels)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Invert an index map.
- * The index mapping of the argument map is inverted and returned as
- * an array of indexes that we will call the inverse map.
- *
- * @param srcMap is an array whose elements define the original mapping
- * from a source array to a destination array.
- * Some elements of the source array may have no mapping in the
- * destination array. In that case, their value will be
- * the special value <code>MAP_NOWHERE</code>.
- * All elements must be >=0 or equal to <code>MAP_NOWHERE</code>.
- * Some elements in the source map may have a value greater than the
- * srcMap.length if the destination array has more elements than the
- * source array.
- * There must be no duplicate indexes (two or more elements with the
- * same value except <code>MAP_NOWHERE</code>).
- *
- * @return an array representing the inverse map.
- * This array has a number of elements equal to 1 + the highest
- * value in <code>srcMap</code>.
- * For elements of the result array which have no matching elements
- * in the source array, the corresponding elements in the inverse
- * map will receive a value equal to <code>MAP_NOWHERE</code>.
- * If element with index i in <code>srcMap</code> has a value k different
- * from <code>MAP_NOWHERE</code>, this means that element i of
- * the source array maps to element k in the destination array.
- * The inverse map will have value i in its k-th element.
- * For all elements of the destination array which do not map to
- * an element in the source array, the corresponding element in the
- * inverse map will have a value equal to <code>MAP_NOWHERE</code>.
- *
- * @see #MAP_NOWHERE
- * @stable ICU 3.8
- */
- public static int[] invertMap(int[] srcMap)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Get an array of levels for each character.<p>
+// *
+// * Note that this method may allocate memory under some
+// * circumstances, unlike <code>getLevelAt()</code>.
+// *
+// * @return The levels array for the text,
+// * or <code>null</code> if an error occurs.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @stable ICU 3.8
+// */
+// public byte[] getLevels()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get a logical run.
+// * This method returns information about a run and is used
+// * to retrieve runs in logical order.<p>
+// * This is especially useful for line-breaking on a paragraph.
+// *
+// * @param logicalPosition is a logical position within the source text.
+// *
+// * @return a BidiRun object filled with <code>start</code> containing
+// * the first character of the run, <code>limit</code> containing
+// * the limit of the run, and <code>embeddingLevel</code> containing
+// * the level of the run.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if logicalPosition is not in the range
+// * <code>0<=logicalPosition<getProcessedLength()</code>
+// *
+// * @see com.ibm.icu.text.BidiRun
+// * @see com.ibm.icu.text.BidiRun#getStart()
+// * @see com.ibm.icu.text.BidiRun#getLimit()
+// * @see com.ibm.icu.text.BidiRun#getEmbeddingLevel()
+// *
+// * @stable ICU 3.8
+// */
+// public BidiRun getLogicalRun(int logicalPosition)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the number of runs.
+// * This method may invoke the actual reordering on the
+// * <code>Bidi</code> object, after <code>setPara()</code>
+// * may have resolved only the levels of the text. Therefore,
+// * <code>countRuns()</code> may have to allocate memory,
+// * and may throw an exception if it fails to do so.
+// *
+// * @return The number of runs.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @stable ICU 3.8
+// */
+// public int countRuns()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// *
+// * Get a <code>BidiRun</code> object according to its index. BidiRun methods
+// * may be used to retrieve the run's logical start, length and level,
+// * which can be even for an LTR run or odd for an RTL run.
+// * In an RTL run, the character at the logical start is
+// * visually on the right of the displayed run.
+// * The length is the number of characters in the run.<p>
+// * <code>countRuns()</code> is normally called
+// * before the runs are retrieved.
+// *
+// * <p>
+// * Example:
+// * <pre>
+// * Bidi bidi = new Bidi();
+// * String text = "abc 123 DEFG xyz";
+// * bidi.setPara(text, Bidi.RTL, null);
+// * int i, count=bidi.countRuns(), logicalStart, visualIndex=0, length;
+// * BidiRun run;
+// * for (i = 0; i < count; ++i) {
+// * run = bidi.getVisualRun(i);
+// * logicalStart = run.getStart();
+// * length = run.getLength();
+// * if (Bidi.LTR == run.getEmbeddingLevel()) {
+// * do { // LTR
+// * show_char(text.charAt(logicalStart++), visualIndex++);
+// * } while (--length > 0);
+// * } else {
+// * logicalStart += length; // logicalLimit
+// * do { // RTL
+// * show_char(text.charAt(--logicalStart), visualIndex++);
+// * } while (--length > 0);
+// * }
+// * }
+// * </pre>
+// * <p>
+// * Note that in right-to-left runs, code like this places
+// * second surrogates before first ones (which is generally a bad idea)
+// * and combining characters before base characters.
+// * <p>
+// * Use of <code>{@link #writeReordered}</code>, optionally with the
+// * <code>{@link #KEEP_BASE_COMBINING}</code> option, can be considered in
+// * order to avoid these issues.
+// *
+// * @param runIndex is the number of the run in visual order, in the
+// * range <code>[0..countRuns()-1]</code>.
+// *
+// * @return a BidiRun object containing the details of the run. The
+// * directionality of the run is
+// * <code>LTR==0</code> or <code>RTL==1</code>,
+// * never <code>MIXED</code>.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if <code>runIndex</code> is not in
+// * the range <code>0<=runIndex<countRuns()</code>
+// *
+// * @see #countRuns()
+// * @see com.ibm.icu.text.BidiRun
+// * @see com.ibm.icu.text.BidiRun#getStart()
+// * @see com.ibm.icu.text.BidiRun#getLength()
+// * @see com.ibm.icu.text.BidiRun#getEmbeddingLevel()
+// * @stable ICU 3.8
+// */
+// public BidiRun getVisualRun(int runIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the visual position from a logical text position.
+// * If such a mapping is used many times on the same
+// * <code>Bidi</code> object, then calling
+// * <code>getLogicalMap()</code> is more efficient.
+// * <p>
+// * The value returned may be <code>MAP_NOWHERE</code> if there is no
+// * visual position because the corresponding text character is a Bidi
+// * control removed from output by the option
+// * <code>OPTION_REMOVE_CONTROLS</code>.
+// * <p>
+// * When the visual output is altered by using options of
+// * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
+// * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
+// * <code>REMOVE_BIDI_CONTROLS</code>, the visual position returned may not
+// * be correct. It is advised to use, when possible, reordering options
+// * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
+// * <p>
+// * Note that in right-to-left runs, this mapping places
+// * second surrogates before first ones (which is generally a bad idea)
+// * and combining characters before base characters.
+// * Use of <code>{@link #writeReordered}</code>, optionally with the
+// * <code>{@link #KEEP_BASE_COMBINING}</code> option can be considered instead
+// * of using the mapping, in order to avoid these issues.
+// *
+// * @param logicalIndex is the index of a character in the text.
+// *
+// * @return The visual position of this character.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if <code>logicalIndex</code> is not in
+// * the range <code>0<=logicalIndex<getProcessedLength()</code>
+// *
+// * @see #getLogicalMap
+// * @see #getLogicalIndex
+// * @see #getProcessedLength
+// * @see #MAP_NOWHERE
+// * @see #OPTION_REMOVE_CONTROLS
+// * @see #writeReordered
+// * @stable ICU 3.8
+// */
+// public int getVisualIndex(int logicalIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+
+// /**
+// * Get the logical text position from a visual position.
+// * If such a mapping is used many times on the same
+// * <code>Bidi</code> object, then calling
+// * <code>getVisualMap()</code> is more efficient.
+// * <p>
+// * The value returned may be <code>MAP_NOWHERE</code> if there is no
+// * logical position because the corresponding text character is a Bidi
+// * mark inserted in the output by option
+// * <code>OPTION_INSERT_MARKS</code>.
+// * <p>
+// * This is the inverse method to <code>getVisualIndex()</code>.
+// * <p>
+// * When the visual output is altered by using options of
+// * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
+// * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
+// * <code>REMOVE_BIDI_CONTROLS</code>, the logical position returned may not
+// * be correct. It is advised to use, when possible, reordering options
+// * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
+// *
+// * @param visualIndex is the visual position of a character.
+// *
+// * @return The index of this character in the text.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// * @throws IllegalArgumentException if <code>visualIndex</code> is not in
+// * the range <code>0<=visualIndex<getResultLength()</code>
+// *
+// * @see #getVisualMap
+// * @see #getVisualIndex
+// * @see #getResultLength
+// * @see #MAP_NOWHERE
+// * @see #OPTION_INSERT_MARKS
+// * @see #writeReordered
+// * @stable ICU 3.8
+// */
+// public int getLogicalIndex(int visualIndex)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get a logical-to-visual index map (array) for the characters in the
+// * <code>Bidi</code> (paragraph or line) object.
+// * <p>
+// * Some values in the map may be <code>MAP_NOWHERE</code> if the
+// * corresponding text characters are Bidi controls removed from the visual
+// * output by the option <code>OPTION_REMOVE_CONTROLS</code>.
+// * <p>
+// * When the visual output is altered by using options of
+// * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
+// * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
+// * <code>REMOVE_BIDI_CONTROLS</code>, the visual positions returned may not
+// * be correct. It is advised to use, when possible, reordering options
+// * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
+// * <p>
+// * Note that in right-to-left runs, this mapping places
+// * second surrogates before first ones (which is generally a bad idea)
+// * and combining characters before base characters.
+// * Use of <code>{@link #writeReordered}</code>, optionally with the
+// * <code>{@link #KEEP_BASE_COMBINING}</code> option can be considered instead
+// * of using the mapping, in order to avoid these issues.
+// *
+// * @return an array of <code>getProcessedLength()</code>
+// * indexes which will reflect the reordering of the characters.<br><br>
+// * The index map will result in
+// * <code>indexMap[logicalIndex]==visualIndex</code>, where
+// * <code>indexMap</code> represents the returned array.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #getVisualMap
+// * @see #getVisualIndex
+// * @see #getProcessedLength
+// * @see #MAP_NOWHERE
+// * @see #OPTION_REMOVE_CONTROLS
+// * @see #writeReordered
+// * @stable ICU 3.8
+// */
+// public int[] getLogicalMap()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get a visual-to-logical index map (array) for the characters in the
+// * <code>Bidi</code> (paragraph or line) object.
+// * <p>
+// * Some values in the map may be <code>MAP_NOWHERE</code> if the
+// * corresponding text characters are Bidi marks inserted in the visual
+// * output by the option <code>OPTION_INSERT_MARKS</code>.
+// * <p>
+// * When the visual output is altered by using options of
+// * <code>writeReordered()</code> such as <code>INSERT_LRM_FOR_NUMERIC</code>,
+// * <code>KEEP_BASE_COMBINING</code>, <code>OUTPUT_REVERSE</code>,
+// * <code>REMOVE_BIDI_CONTROLS</code>, the logical positions returned may not
+// * be correct. It is advised to use, when possible, reordering options
+// * such as {@link #OPTION_INSERT_MARKS} and {@link #OPTION_REMOVE_CONTROLS}.
+// *
+// * @return an array of <code>getResultLength()</code>
+// * indexes which will reflect the reordering of the characters.<br><br>
+// * The index map will result in
+// * <code>indexMap[visualIndex]==logicalIndex</code>, where
+// * <code>indexMap</code> represents the returned array.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #getLogicalMap
+// * @see #getLogicalIndex
+// * @see #getResultLength
+// * @see #MAP_NOWHERE
+// * @see #OPTION_INSERT_MARKS
+// * @see #writeReordered
+// * @stable ICU 3.8
+// */
+// public int[] getVisualMap()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * This is a convenience method that does not use a <code>Bidi</code> object.
+// * It is intended to be used for when an application has determined the levels
+// * of objects (character sequences) and just needs to have them reordered (L2).
+// * This is equivalent to using <code>getLogicalMap()</code> on a
+// * <code>Bidi</code> object.
+// *
+// * @param levels is an array of levels that have been determined by
+// * the application.
+// *
+// * @return an array of <code>levels.length</code>
+// * indexes which will reflect the reordering of the characters.<p>
+// * The index map will result in
+// * <code>indexMap[logicalIndex]==visualIndex</code>, where
+// * <code>indexMap</code> represents the returned array.
+// *
+// * @stable ICU 3.8
+// */
+// public static int[] reorderLogical(byte[] levels)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * This is a convenience method that does not use a <code>Bidi</code> object.
+// * It is intended to be used for when an application has determined the levels
+// * of objects (character sequences) and just needs to have them reordered (L2).
+// * This is equivalent to using <code>getVisualMap()</code> on a
+// * <code>Bidi</code> object.
+// *
+// * @param levels is an array of levels that have been determined by
+// * the application.
+// *
+// * @return an array of <code>levels.length</code>
+// * indexes which will reflect the reordering of the characters.<p>
+// * The index map will result in
+// * <code>indexMap[visualIndex]==logicalIndex</code>, where
+// * <code>indexMap</code> represents the returned array.
+// *
+// * @stable ICU 3.8
+// */
+// public static int[] reorderVisual(byte[] levels)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Invert an index map.
+// * The index mapping of the argument map is inverted and returned as
+// * an array of indexes that we will call the inverse map.
+// *
+// * @param srcMap is an array whose elements define the original mapping
+// * from a source array to a destination array.
+// * Some elements of the source array may have no mapping in the
+// * destination array. In that case, their value will be
+// * the special value <code>MAP_NOWHERE</code>.
+// * All elements must be >=0 or equal to <code>MAP_NOWHERE</code>.
+// * Some elements in the source map may have a value greater than the
+// * srcMap.length if the destination array has more elements than the
+// * source array.
+// * There must be no duplicate indexes (two or more elements with the
+// * same value except <code>MAP_NOWHERE</code>).
+// *
+// * @return an array representing the inverse map.
+// * This array has a number of elements equal to 1 + the highest
+// * value in <code>srcMap</code>.
+// * For elements of the result array which have no matching elements
+// * in the source array, the corresponding elements in the inverse
+// * map will receive a value equal to <code>MAP_NOWHERE</code>.
+// * If element with index i in <code>srcMap</code> has a value k different
+// * from <code>MAP_NOWHERE</code>, this means that element i of
+// * the source array maps to element k in the destination array.
+// * The inverse map will have value i in its k-th element.
+// * For all elements of the destination array which do not map to
+// * an element in the source array, the corresponding element in the
+// * inverse map will have a value equal to <code>MAP_NOWHERE</code>.
+// *
+// * @see #MAP_NOWHERE
+// * @stable ICU 3.8
+// */
+// public static int[] invertMap(int[] srcMap)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/*
* Fields and methods for compatibility with java.text.bidi (Sun implementation)
java.text.Bidi.reorderVisually(levels, levelStart, objects, objectStart, count);
}
- /**
- * Take a <code>Bidi</code> object containing the reordering
- * information for a piece of text (one or more paragraphs) set by
- * <code>setPara()</code> or for a line of text set by <code>setLine()</code>
- * and return a string containing the reordered text.
- *
- * <p>The text may have been aliased (only a reference was stored
- * without copying the contents), thus it must not have been modified
- * since the <code>setPara()</code> call.</p>
- *
- * This method preserves the integrity of characters with multiple
- * code units and (optionally) combining characters.
- * Characters in RTL runs can be replaced by mirror-image characters
- * in the returned string. Note that "real" mirroring has to be done in a
- * rendering engine by glyph selection and that for many "mirrored"
- * characters there are no Unicode characters as mirror-image equivalents.
- * There are also options to insert or remove Bidi control
- * characters; see the descriptions of the return value and the
- * <code>options</code> parameter, and of the option bit flags.
- *
- * @param options A bit set of options for the reordering that control
- * how the reordered text is written.
- * The options include mirroring the characters on a code
- * point basis and inserting LRM characters, which is used
- * especially for transforming visually stored text
- * to logically stored text (although this is still an
- * imperfect implementation of an "inverse Bidi" algorithm
- * because it uses the "forward Bidi" algorithm at its core).
- * The available options are:
- * <code>DO_MIRRORING</code>,
- * <code>INSERT_LRM_FOR_NUMERIC</code>,
- * <code>KEEP_BASE_COMBINING</code>,
- * <code>OUTPUT_REVERSE</code>,
- * <code>REMOVE_BIDI_CONTROLS</code>,
- * <code>STREAMING</code>
- *
- * @return The reordered text.
- * If the <code>INSERT_LRM_FOR_NUMERIC</code> option is set, then
- * the length of the returned string could be as large as
- * <code>getLength()+2*countRuns()</code>.<br>
- * If the <code>REMOVE_BIDI_CONTROLS</code> option is set, then the
- * length of the returned string may be less than
- * <code>getLength()</code>.<br>
- * If none of these options is set, then the length of the returned
- * string will be exactly <code>getProcessedLength()</code>.
- *
- * @throws IllegalStateException if this call is not preceded by a successful
- * call to <code>setPara</code> or <code>setLine</code>
- *
- * @see #DO_MIRRORING
- * @see #INSERT_LRM_FOR_NUMERIC
- * @see #KEEP_BASE_COMBINING
- * @see #OUTPUT_REVERSE
- * @see #REMOVE_BIDI_CONTROLS
- * @see #OPTION_STREAMING
- * @see #getProcessedLength
- * @stable ICU 3.8
- */
- public String writeReordered(int options)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Reverse a Right-To-Left run of Unicode text.
- *
- * This method preserves the integrity of characters with multiple
- * code units and (optionally) combining characters.
- * Characters can be replaced by mirror-image characters
- * in the destination buffer. Note that "real" mirroring has
- * to be done in a rendering engine by glyph selection
- * and that for many "mirrored" characters there are no
- * Unicode characters as mirror-image equivalents.
- * There are also options to insert or remove Bidi control
- * characters.
- *
- * This method is the implementation for reversing RTL runs as part
- * of <code>writeReordered()</code>. For detailed descriptions
- * of the parameters, see there.
- * Since no Bidi controls are inserted here, the output string length
- * will never exceed <code>src.length()</code>.
- *
- * @see #writeReordered
- *
- * @param src The RTL run text.
- *
- * @param options A bit set of options for the reordering that control
- * how the reordered text is written.
- * See the <code>options</code> parameter in <code>writeReordered()</code>.
- *
- * @return The reordered text.
- * If the <code>REMOVE_BIDI_CONTROLS</code> option
- * is set, then the length of the returned string may be less than
- * <code>src.length()</code>. If this option is not set,
- * then the length of the returned string will be exactly
- * <code>src.length()</code>.
- *
- * @throws IllegalArgumentException if <code>src</code> is null.
- * @stable ICU 3.8
- */
- public static String writeReverse(String src, int options)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Get the base direction of the text provided according to the Unicode
- * Bidirectional Algorithm. The base direction is derived from the first
- * character in the string with bidirectional character type L, R, or AL.
- * If the first such character has type L, LTR is returned. If the first
- * such character has type R or AL, RTL is returned. If the string does
- * not contain any character of these types, then NEUTRAL is returned.
- * This is a lightweight function for use when only the base direction is
- * needed and no further bidi processing of the text is needed.
- * @param paragraph the text whose paragraph level direction is needed.
- * @return LTR, RTL, NEUTRAL
- * @see #LTR
- * @see #RTL
- * @see #NEUTRAL
- * @draft ICU 4.6
- * @provisional This API might change or be removed in a future release.
- */
- public static byte getBaseDirection(CharSequence paragraph) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Set the context before a call to setPara().<p>
- *
- * setPara() computes the left-right directionality for a given piece
- * of text which is supplied as one of its arguments. Sometimes this piece
- * of text (the "main text") should be considered in context, because text
- * appearing before ("prologue") and/or after ("epilogue") the main text
- * may affect the result of this computation.<p>
- *
- * This function specifies the prologue and/or the epilogue for the next
- * call to setPara(). If successive calls to setPara()
- * all need specification of a context, setContext() must be called
- * before each call to setPara(). In other words, a context is not
- * "remembered" after the following successful call to setPara().<p>
- *
- * If a call to setPara() specifies DEFAULT_LTR or
- * DEFAULT_RTL as paraLevel and is preceded by a call to
- * setContext() which specifies a prologue, the paragraph level will
- * be computed taking in consideration the text in the prologue.<p>
- *
- * When setPara() is called without a previous call to
- * setContext, the main text is handled as if preceded and followed
- * by strong directional characters at the current paragraph level.
- * Calling setContext() with specification of a prologue will change
- * this behavior by handling the main text as if preceded by the last
- * strong character appearing in the prologue, if any.
- * Calling setContext() with specification of an epilogue will change
- * the behavior of setPara() by handling the main text as if followed
- * by the first strong character or digit appearing in the epilogue, if any.<p>
- *
- * Note 1: if <code>setContext</code> is called repeatedly without
- * calling <code>setPara</code>, the earlier calls have no effect,
- * only the last call will be remembered for the next call to
- * <code>setPara</code>.<p>
- *
- * Note 2: calling <code>setContext(null, null)</code>
- * cancels any previous setting of non-empty prologue or epilogue.
- * The next call to <code>setPara()</code> will process no
- * prologue or epilogue.<p>
- *
- * Note 3: users must be aware that even after setting the context
- * before a call to setPara() to perform e.g. a logical to visual
- * transformation, the resulting string may not be identical to what it
- * would have been if all the text, including prologue and epilogue, had
- * been processed together.<br>
- * Example (upper case letters represent RTL characters):<br>
- * prologue = "<code>abc DE</code>"<br>
- * epilogue = none<br>
- * main text = "<code>FGH xyz</code>"<br>
- * paraLevel = LTR<br>
- * display without prologue = "<code>HGF xyz</code>"
- * ("HGF" is adjacent to "xyz")<br>
- * display with prologue = "<code>abc HGFED xyz</code>"
- * ("HGF" is not adjacent to "xyz")<br>
- *
- * @param prologue is the text which precedes the text that
- * will be specified in a coming call to setPara().
- * If there is no prologue to consider,
- * this parameter can be <code>null</code>.
- *
- * @param epilogue is the text which follows the text that
- * will be specified in a coming call to setPara().
- * If there is no epilogue to consider,
- * this parameter can be <code>null</code>.
- *
- * @see #setPara
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public void setContext(String prologue, String epilogue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Take a <code>Bidi</code> object containing the reordering
+// * information for a piece of text (one or more paragraphs) set by
+// * <code>setPara()</code> or for a line of text set by <code>setLine()</code>
+// * and return a string containing the reordered text.
+// *
+// * <p>The text may have been aliased (only a reference was stored
+// * without copying the contents), thus it must not have been modified
+// * since the <code>setPara()</code> call.</p>
+// *
+// * This method preserves the integrity of characters with multiple
+// * code units and (optionally) combining characters.
+// * Characters in RTL runs can be replaced by mirror-image characters
+// * in the returned string. Note that "real" mirroring has to be done in a
+// * rendering engine by glyph selection and that for many "mirrored"
+// * characters there are no Unicode characters as mirror-image equivalents.
+// * There are also options to insert or remove Bidi control
+// * characters; see the descriptions of the return value and the
+// * <code>options</code> parameter, and of the option bit flags.
+// *
+// * @param options A bit set of options for the reordering that control
+// * how the reordered text is written.
+// * The options include mirroring the characters on a code
+// * point basis and inserting LRM characters, which is used
+// * especially for transforming visually stored text
+// * to logically stored text (although this is still an
+// * imperfect implementation of an "inverse Bidi" algorithm
+// * because it uses the "forward Bidi" algorithm at its core).
+// * The available options are:
+// * <code>DO_MIRRORING</code>,
+// * <code>INSERT_LRM_FOR_NUMERIC</code>,
+// * <code>KEEP_BASE_COMBINING</code>,
+// * <code>OUTPUT_REVERSE</code>,
+// * <code>REMOVE_BIDI_CONTROLS</code>,
+// * <code>STREAMING</code>
+// *
+// * @return The reordered text.
+// * If the <code>INSERT_LRM_FOR_NUMERIC</code> option is set, then
+// * the length of the returned string could be as large as
+// * <code>getLength()+2*countRuns()</code>.<br>
+// * If the <code>REMOVE_BIDI_CONTROLS</code> option is set, then the
+// * length of the returned string may be less than
+// * <code>getLength()</code>.<br>
+// * If none of these options is set, then the length of the returned
+// * string will be exactly <code>getProcessedLength()</code>.
+// *
+// * @throws IllegalStateException if this call is not preceded by a successful
+// * call to <code>setPara</code> or <code>setLine</code>
+// *
+// * @see #DO_MIRRORING
+// * @see #INSERT_LRM_FOR_NUMERIC
+// * @see #KEEP_BASE_COMBINING
+// * @see #OUTPUT_REVERSE
+// * @see #REMOVE_BIDI_CONTROLS
+// * @see #OPTION_STREAMING
+// * @see #getProcessedLength
+// * @stable ICU 3.8
+// */
+// public String writeReordered(int options)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Reverse a Right-To-Left run of Unicode text.
+// *
+// * This method preserves the integrity of characters with multiple
+// * code units and (optionally) combining characters.
+// * Characters can be replaced by mirror-image characters
+// * in the destination buffer. Note that "real" mirroring has
+// * to be done in a rendering engine by glyph selection
+// * and that for many "mirrored" characters there are no
+// * Unicode characters as mirror-image equivalents.
+// * There are also options to insert or remove Bidi control
+// * characters.
+// *
+// * This method is the implementation for reversing RTL runs as part
+// * of <code>writeReordered()</code>. For detailed descriptions
+// * of the parameters, see there.
+// * Since no Bidi controls are inserted here, the output string length
+// * will never exceed <code>src.length()</code>.
+// *
+// * @see #writeReordered
+// *
+// * @param src The RTL run text.
+// *
+// * @param options A bit set of options for the reordering that control
+// * how the reordered text is written.
+// * See the <code>options</code> parameter in <code>writeReordered()</code>.
+// *
+// * @return The reordered text.
+// * If the <code>REMOVE_BIDI_CONTROLS</code> option
+// * is set, then the length of the returned string may be less than
+// * <code>src.length()</code>. If this option is not set,
+// * then the length of the returned string will be exactly
+// * <code>src.length()</code>.
+// *
+// * @throws IllegalArgumentException if <code>src</code> is null.
+// * @stable ICU 3.8
+// */
+// public static String writeReverse(String src, int options)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Get the base direction of the text provided according to the Unicode
+// * Bidirectional Algorithm. The base direction is derived from the first
+// * character in the string with bidirectional character type L, R, or AL.
+// * If the first such character has type L, LTR is returned. If the first
+// * such character has type R or AL, RTL is returned. If the string does
+// * not contain any character of these types, then NEUTRAL is returned.
+// * This is a lightweight function for use when only the base direction is
+// * needed and no further bidi processing of the text is needed.
+// * @param paragraph the text whose paragraph level direction is needed.
+// * @return LTR, RTL, NEUTRAL
+// * @see #LTR
+// * @see #RTL
+// * @see #NEUTRAL
+// * @draft ICU 4.6
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static byte getBaseDirection(CharSequence paragraph) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Set the context before a call to setPara().<p>
+// *
+// * setPara() computes the left-right directionality for a given piece
+// * of text which is supplied as one of its arguments. Sometimes this piece
+// * of text (the "main text") should be considered in context, because text
+// * appearing before ("prologue") and/or after ("epilogue") the main text
+// * may affect the result of this computation.<p>
+// *
+// * This function specifies the prologue and/or the epilogue for the next
+// * call to setPara(). If successive calls to setPara()
+// * all need specification of a context, setContext() must be called
+// * before each call to setPara(). In other words, a context is not
+// * "remembered" after the following successful call to setPara().<p>
+// *
+// * If a call to setPara() specifies DEFAULT_LTR or
+// * DEFAULT_RTL as paraLevel and is preceded by a call to
+// * setContext() which specifies a prologue, the paragraph level will
+// * be computed taking in consideration the text in the prologue.<p>
+// *
+// * When setPara() is called without a previous call to
+// * setContext, the main text is handled as if preceded and followed
+// * by strong directional characters at the current paragraph level.
+// * Calling setContext() with specification of a prologue will change
+// * this behavior by handling the main text as if preceded by the last
+// * strong character appearing in the prologue, if any.
+// * Calling setContext() with specification of an epilogue will change
+// * the behavior of setPara() by handling the main text as if followed
+// * by the first strong character or digit appearing in the epilogue, if any.<p>
+// *
+// * Note 1: if <code>setContext</code> is called repeatedly without
+// * calling <code>setPara</code>, the earlier calls have no effect,
+// * only the last call will be remembered for the next call to
+// * <code>setPara</code>.<p>
+// *
+// * Note 2: calling <code>setContext(null, null)</code>
+// * cancels any previous setting of non-empty prologue or epilogue.
+// * The next call to <code>setPara()</code> will process no
+// * prologue or epilogue.<p>
+// *
+// * Note 3: users must be aware that even after setting the context
+// * before a call to setPara() to perform e.g. a logical to visual
+// * transformation, the resulting string may not be identical to what it
+// * would have been if all the text, including prologue and epilogue, had
+// * been processed together.<br>
+// * Example (upper case letters represent RTL characters):<br>
+// * prologue = "<code>abc DE</code>"<br>
+// * epilogue = none<br>
+// * main text = "<code>FGH xyz</code>"<br>
+// * paraLevel = LTR<br>
+// * display without prologue = "<code>HGF xyz</code>"
+// * ("HGF" is adjacent to "xyz")<br>
+// * display with prologue = "<code>abc HGFED xyz</code>"
+// * ("HGF" is not adjacent to "xyz")<br>
+// *
+// * @param prologue is the text which precedes the text that
+// * will be specified in a coming call to setPara().
+// * If there is no prologue to consider,
+// * this parameter can be <code>null</code>.
+// *
+// * @param epilogue is the text which follows the text that
+// * will be specified in a coming call to setPara().
+// * If there is no epilogue to consider,
+// * this parameter can be <code>null</code>.
+// *
+// * @see #setPara
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// public void setContext(String prologue, String epilogue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
}
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class BidiClassifier {
- private BidiClassifier() {}
-}
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class BidiRun {
- private BidiRun() {}
-}
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
* @stable ICU 2.4
*/
public static final int KIND_SENTENCE = 3;
- /**
- * {@icu}
- * @stable ICU 2.4
- */
- public static final int KIND_TITLE = 4;
+// /**
+// * {@icu}
+// * @stable ICU 2.4
+// */
+// public static final int KIND_TITLE = 4;
/**
* Returns a new instance of BreakIterator that locates word boundaries.
return getBreakInstance(where.toLocale(), KIND_SENTENCE);
}
- /**
- * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
- * This function assumes the text being analyzed is in the default locale's
- * language. The iterator returned locates title boundaries as described for
- * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
- * please use a word boundary iterator. {@link #getWordInstance}
- * @return A new instance of BreakIterator that locates title boundaries.
- * @stable ICU 2.0
- */
- public static BreakIterator getTitleInstance()
- {
- return getTitleInstance(Locale.getDefault());
- }
-
- /**
- * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
- * The iterator returned locates title boundaries as described for
- * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
- * please use Word Boundary iterator.{@link #getWordInstance}
- * @param where A Locale specifying the language of the text being analyzed.
- * @return A new instance of BreakIterator that locates title boundaries.
- * @stable ICU 2.0
- */
- public static BreakIterator getTitleInstance(Locale where)
- {
- return getBreakInstance(where, KIND_TITLE);
- }
-
- /**
- * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
- * The iterator returned locates title boundaries as described for
- * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
- * please use Word Boundary iterator.{@link #getWordInstance}
- * @param where A Locale specifying the language of the text being analyzed.
- * @return A new instance of BreakIterator that locates title boundaries.
- * @stable ICU 3.2
-s */
- public static BreakIterator getTitleInstance(ULocale where)
- {
- return getBreakInstance(where.toLocale(), KIND_TITLE);
- }
-
- /**
- * {@icu} Registers a new break iterator of the indicated kind, to use in the given
- * locale. Clones of the iterator will be returned if a request for a break iterator
- * of the given kind matches or falls back to this locale.
- * @param iter the BreakIterator instance to adopt.
- * @param locale the Locale for which this instance is to be registered
- * @param kind the type of iterator for which this instance is to be registered
- * @return a registry key that can be used to unregister this instance
- * @stable ICU 2.4
- */
- public static Object registerInstance(BreakIterator iter, Locale locale, int kind) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Registers a new break iterator of the indicated kind, to use in the given
- * locale. Clones of the iterator will be returned if a request for a break iterator
- * of the given kind matches or falls back to this locale.
- * @param iter the BreakIterator instance to adopt.
- * @param locale the Locale for which this instance is to be registered
- * @param kind the type of iterator for which this instance is to be registered
- * @return a registry key that can be used to unregister this instance
- * @stable ICU 3.2
- */
- public static Object registerInstance(BreakIterator iter, ULocale locale, int kind) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Unregisters a previously-registered BreakIterator using the key returned
- * from the register call. Key becomes invalid after this call and should not be used
- * again.
- * @param key the registry key returned by a previous call to registerInstance
- * @return true if the iterator for the key was successfully unregistered
- * @stable ICU 2.4
- */
- public static boolean unregister(Object key) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
+// * This function assumes the text being analyzed is in the default locale's
+// * language. The iterator returned locates title boundaries as described for
+// * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
+// * please use a word boundary iterator. {@link #getWordInstance}
+// * @return A new instance of BreakIterator that locates title boundaries.
+// * @stable ICU 2.0
+// */
+// public static BreakIterator getTitleInstance()
+// {
+// return getTitleInstance(Locale.getDefault());
+// }
+
+// /**
+// * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
+// * The iterator returned locates title boundaries as described for
+// * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
+// * please use Word Boundary iterator.{@link #getWordInstance}
+// * @param where A Locale specifying the language of the text being analyzed.
+// * @return A new instance of BreakIterator that locates title boundaries.
+// * @stable ICU 2.0
+// */
+// public static BreakIterator getTitleInstance(Locale where)
+// {
+// return getBreakInstance(where, KIND_TITLE);
+// }
+
+// /**
+// * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
+// * The iterator returned locates title boundaries as described for
+// * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
+// * please use Word Boundary iterator.{@link #getWordInstance}
+// * @param where A Locale specifying the language of the text being analyzed.
+// * @return A new instance of BreakIterator that locates title boundaries.
+// * @stable ICU 3.2
+//s */
+// public static BreakIterator getTitleInstance(ULocale where)
+// {
+// return getBreakInstance(where.toLocale(), KIND_TITLE);
+// }
+
+// /**
+// * {@icu} Registers a new break iterator of the indicated kind, to use in the given
+// * locale. Clones of the iterator will be returned if a request for a break iterator
+// * of the given kind matches or falls back to this locale.
+// * @param iter the BreakIterator instance to adopt.
+// * @param locale the Locale for which this instance is to be registered
+// * @param kind the type of iterator for which this instance is to be registered
+// * @return a registry key that can be used to unregister this instance
+// * @stable ICU 2.4
+// */
+// public static Object registerInstance(BreakIterator iter, Locale locale, int kind) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Registers a new break iterator of the indicated kind, to use in the given
+// * locale. Clones of the iterator will be returned if a request for a break iterator
+// * of the given kind matches or falls back to this locale.
+// * @param iter the BreakIterator instance to adopt.
+// * @param locale the Locale for which this instance is to be registered
+// * @param kind the type of iterator for which this instance is to be registered
+// * @return a registry key that can be used to unregister this instance
+// * @stable ICU 3.2
+// */
+// public static Object registerInstance(BreakIterator iter, ULocale locale, int kind) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Unregisters a previously-registered BreakIterator using the key returned
+// * from the register call. Key becomes invalid after this call and should not be used
+// * again.
+// * @param key the registry key returned by a previous call to registerInstance
+// * @return true if the iterator for the key was successfully unregistered
+// * @stable ICU 2.4
+// */
+// public static boolean unregister(Object key) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
// end of registration
case KIND_WORD: br = java.text.BreakIterator.getWordInstance(where); break;
case KIND_LINE: br = java.text.BreakIterator.getLineInstance(where); break;
case KIND_SENTENCE: br = java.text.BreakIterator.getSentenceInstance(where); break;
- case KIND_TITLE: throw new UnsupportedOperationException("Title break is not supported by com.ibm.icu.base");
+// case KIND_TITLE: throw new UnsupportedOperationException("Title break is not supported by com.ibm.icu.base");
}
return new BreakIteratorHandle(br);
}
return ulocales;
}
- /**
- * {@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) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
// forwarding implementation class
static final class BreakIteratorHandle extends BreakIterator {
/**
*******************************************************************************
-* Copyright (C) 1996-2011, International Business Machines Corporation and *
+* Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
// public inner classes -------------------------------------------------
- /**
- * Options that used in the API CollationKey.getBound() for getting a
- * CollationKey based on the bound mode requested.
- * @stable ICU 2.6
- */
- public static final class BoundMode
- {
- /*
- * do not change the values assigned to the members of this enum.
- * Underlying code depends on them having these numbers
- */
-
- /**
- * Lower bound
- * @stable ICU 2.6
- */
- public static final int LOWER = 0;
-
- /**
- * Upper bound that will match strings of exact size
- * @stable ICU 2.6
- */
- public static final int UPPER = 1;
-
- /**
- * Upper bound that will match all the strings that have the same
- * initial substring as the given string
- * @stable ICU 2.6
- */
- public static final int UPPER_LONG = 2;
-
- /**
- * Number of bound mode
- * @stable ICU 2.6
- */
- public static final int COUNT = 3;
-
- /**
- * Private Constructor
- */
- ///CLOVER:OFF
- private BoundMode(){}
- ///CLOVER:ON
- }
+// /**
+// * Options that used in the API CollationKey.getBound() for getting a
+// * CollationKey based on the bound mode requested.
+// * @stable ICU 2.6
+// */
+// public static final class BoundMode
+// {
+// /*
+// * do not change the values assigned to the members of this enum.
+// * Underlying code depends on them having these numbers
+// */
+//
+// /**
+// * Lower bound
+// * @stable ICU 2.6
+// */
+// public static final int LOWER = 0;
+//
+// /**
+// * Upper bound that will match strings of exact size
+// * @stable ICU 2.6
+// */
+// public static final int UPPER = 1;
+//
+// /**
+// * Upper bound that will match all the strings that have the same
+// * initial substring as the given string
+// * @stable ICU 2.6
+// */
+// public static final int UPPER_LONG = 2;
+//
+// /**
+// * Number of bound mode
+// * @stable ICU 2.6
+// */
+// public static final int COUNT = 3;
+//
+// /**
+// * Private Constructor
+// */
+// ///CLOVER:OFF
+// private BoundMode(){}
+// ///CLOVER:ON
+// }
// public constructor ---------------------------------------------------
- /**
- * CollationKey constructor.
- * This constructor is given public access, unlike the JDK version, to
- * allow access to users extending the Collator class. See
- * {@link Collator#getCollationKey(String)}.
- * @param source string this CollationKey is to represent
- * @param key array of bytes that represent the collation order of argument
- * source terminated by a null
- * @see Collator
- * @stable ICU 2.8
- */
- public CollationKey(String source, byte key[])
- {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
+// /**
+// * CollationKey constructor.
+// * This constructor is given public access, unlike the JDK version, to
+// * allow access to users extending the Collator class. See
+// * {@link Collator#getCollationKey(String)}.
+// * @param source string this CollationKey is to represent
+// * @param key array of bytes that represent the collation order of argument
+// * source terminated by a null
+// * @see Collator
+// * @stable ICU 2.8
+// */
+// public CollationKey(String source, byte key[])
+// {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
- /**
- * CollationKey constructor that forces key to release its internal byte
- * array for adoption. key will have a null byte array after this
- * construction.
- * @param source string this CollationKey is to represent
- * @param key RawCollationKey object that represents the collation order of
- * argument source.
- * @see Collator
- * @see RawCollationKey
- * @stable ICU 2.8
- */
- public CollationKey(String source, RawCollationKey key)
- {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
+// /**
+// * CollationKey constructor that forces key to release its internal byte
+// * array for adoption. key will have a null byte array after this
+// * construction.
+// * @param source string this CollationKey is to represent
+// * @param key RawCollationKey object that represents the collation order of
+// * argument source.
+// * @see Collator
+// * @see RawCollationKey
+// * @stable ICU 2.8
+// */
+// public CollationKey(String source, RawCollationKey key)
+// {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
// public getters -------------------------------------------------------
return key.hashCode();
}
- /**
- * <p>
- * Produce a bound for the sort order of a given collation key and a
- * strength level. This API does not attempt to find a bound for the
- * CollationKey String representation, hence null will be returned in its
- * place.
- * </p>
- * <p>
- * Resulting bounds can be used to produce a range of strings that are
- * between upper and lower bounds. For example, if bounds are produced
- * for a sortkey of string "smith", strings between upper and lower
- * bounds with primary strength would include "Smith", "SMITH", "sMiTh".
- * </p>
- * <p>
- * There are two upper bounds that can be produced. If BoundMode.UPPER
- * is produced, strings matched would be as above. However, if a bound
- * is produced using BoundMode.UPPER_LONG is used, the above example will
- * also match "Smithsonian" and similar.
- * </p>
- * <p>
- * For more on usage, see example in test procedure
- * <a href="http://source.icu-project.org/repos/icu/icu4j/trunk/src/com/ibm/icu/dev/test/collator/CollationAPITest.java">
- * src/com/ibm/icu/dev/test/collator/CollationAPITest/TestBounds.
- * </a>
- * </p>
- * <p>
- * Collation keys produced may be compared using the <TT>compare</TT> API.
- * </p>
- * @param boundType Mode of bound required. It can be BoundMode.LOWER, which
- * produces a lower inclusive bound, BoundMode.UPPER, that
- * produces upper bound that matches strings of the same
- * length or BoundMode.UPPER_LONG that matches strings that
- * have the same starting substring as the source string.
- * @param noOfLevels Strength levels required in the resulting bound
- * (for most uses, the recommended value is PRIMARY). This
- * strength should be less than the maximum strength of
- * this CollationKey.
- * See users guide for explanation on the strength levels a
- * collation key can have.
- * @return the result bounded CollationKey with a valid sort order but
- * a null String representation.
- * @exception IllegalArgumentException thrown when the strength level
- * requested is higher than or equal to the strength in this
- * CollationKey.
- * In the case of an Exception, information
- * about the maximum strength to use will be returned in the
- * Exception. The user can then call getBound() again with the
- * appropriate strength.
- * @see CollationKey
- * @see CollationKey.BoundMode
- * @see Collator#PRIMARY
- * @see Collator#SECONDARY
- * @see Collator#TERTIARY
- * @see Collator#QUATERNARY
- * @see Collator#IDENTICAL
- * @stable ICU 2.6
- */
- public CollationKey getBound(int boundType, int noOfLevels)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * <p>
+// * Produce a bound for the sort order of a given collation key and a
+// * strength level. This API does not attempt to find a bound for the
+// * CollationKey String representation, hence null will be returned in its
+// * place.
+// * </p>
+// * <p>
+// * Resulting bounds can be used to produce a range of strings that are
+// * between upper and lower bounds. For example, if bounds are produced
+// * for a sortkey of string "smith", strings between upper and lower
+// * bounds with primary strength would include "Smith", "SMITH", "sMiTh".
+// * </p>
+// * <p>
+// * There are two upper bounds that can be produced. If BoundMode.UPPER
+// * is produced, strings matched would be as above. However, if a bound
+// * is produced using BoundMode.UPPER_LONG is used, the above example will
+// * also match "Smithsonian" and similar.
+// * </p>
+// * <p>
+// * For more on usage, see example in test procedure
+// * <a href="http://source.icu-project.org/repos/icu/icu4j/trunk/src/com/ibm/icu/dev/test/collator/CollationAPITest.java">
+// * src/com/ibm/icu/dev/test/collator/CollationAPITest/TestBounds.
+// * </a>
+// * </p>
+// * <p>
+// * Collation keys produced may be compared using the <TT>compare</TT> API.
+// * </p>
+// * @param boundType Mode of bound required. It can be BoundMode.LOWER, which
+// * produces a lower inclusive bound, BoundMode.UPPER, that
+// * produces upper bound that matches strings of the same
+// * length or BoundMode.UPPER_LONG that matches strings that
+// * have the same starting substring as the source string.
+// * @param noOfLevels Strength levels required in the resulting bound
+// * (for most uses, the recommended value is PRIMARY). This
+// * strength should be less than the maximum strength of
+// * this CollationKey.
+// * See users guide for explanation on the strength levels a
+// * collation key can have.
+// * @return the result bounded CollationKey with a valid sort order but
+// * a null String representation.
+// * @exception IllegalArgumentException thrown when the strength level
+// * requested is higher than or equal to the strength in this
+// * CollationKey.
+// * In the case of an Exception, information
+// * about the maximum strength to use will be returned in the
+// * Exception. The user can then call getBound() again with the
+// * appropriate strength.
+// * @see CollationKey
+// * @see CollationKey.BoundMode
+// * @see Collator#PRIMARY
+// * @see Collator#SECONDARY
+// * @see Collator#TERTIARY
+// * @see Collator#QUATERNARY
+// * @see Collator#IDENTICAL
+// * @stable ICU 2.6
+// */
+// public CollationKey getBound(int boundType, int noOfLevels)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* <p>
*/
package com.ibm.icu.text;
+import java.text.RuleBasedCollator;
import java.util.Comparator;
import java.util.Locale;
-import java.util.Set;
import com.ibm.icu.util.ULocale;
-import com.ibm.icu.util.VersionInfo;
/**
* {@icuenhanced java.text.Collator}.{@icu _usage_}
*/
public void setStrength(int newStrength)
{
+ if (isFrozen) {
+ throw new UnsupportedOperationException("Attempt to modify a frozen Collator instance.");
+ }
collator.setStrength(newStrength);
}
*/
public void setDecomposition(int decomposition)
{
+ if (isFrozen) {
+ throw new UnsupportedOperationException("Attempt to modify a frozen Collator instance.");
+ }
collator.setDecomposition(decomposition);
}
}
// Freezable interface implementation -------------------------------------------------
-
+
+ private transient boolean isFrozen = false;
+
/**
* Determines whether the object has been frozen or not.
* @draft ICU 4.8
*/
public boolean isFrozen() {
- return false;
+ return isFrozen;
}
/**
* @draft ICU 4.8
*/
public Collator freeze() {
- throw new UnsupportedOperationException("Needs to be implemented by the subclass.");
+ isFrozen = true;
+ return this;
}
/**
* @draft ICU 4.8
*/
public Collator cloneAsThawed() {
- throw new UnsupportedOperationException("Needs to be implemented by the subclass.");
- }
-
- // begin registry stuff
-
- /**
- * A factory used with registerFactory to register multiple collators and provide
- * display names for them. If standard locale display names are sufficient,
- * Collator instances may be registered instead.
- * <p><b>Note:</b> as of ICU4J 3.2, the default API for CollatorFactory uses
- * ULocale instead of Locale. Instead of overriding createCollator(Locale),
- * new implementations should override createCollator(ULocale). Note that
- * one of these two methods <b>MUST</b> be overridden or else an infinite
- * loop will occur.
- * @stable ICU 2.6
- */
- public static abstract class CollatorFactory {
- /**
- * Return true if this factory will be visible. Default is true.
- * If not visible, the locales supported by this factory will not
- * be listed by getAvailableLocales.
- *
- * @return true if this factory is visible
- * @stable ICU 2.6
- */
- public boolean visible() {
- return true;
- }
-
- /**
- * Return an instance of the appropriate collator. If the locale
- * is not supported, return null.
- * <b>Note:</b> as of ICU4J 3.2, implementations should override
- * this method instead of createCollator(Locale).
- * @param loc the locale for which this collator is to be created.
- * @return the newly created collator.
- * @stable ICU 3.2
- */
- public Collator createCollator(ULocale loc) {
- return createCollator(loc.toLocale());
- }
-
- /**
- * Return an instance of the appropriate collator. If the locale
- * is not supported, return null.
- * <p><b>Note:</b> as of ICU4J 3.2, implementations should override
- * createCollator(ULocale) instead of this method, and inherit this
- * method's implementation. This method is no longer abstract
- * and instead delegates to createCollator(ULocale).
- * @param loc the locale for which this collator is to be created.
- * @return the newly created collator.
- * @stable ICU 2.6
- */
- public Collator createCollator(Locale loc) {
- return createCollator(ULocale.forLocale(loc));
- }
-
- /**
- * Return the name of the collator for the objectLocale, localized for the displayLocale.
- * If objectLocale is not visible or not defined by the factory, return null.
- * @param objectLocale the locale identifying the collator
- * @param displayLocale the locale for which the display name of the collator should be localized
- * @return the display name
- * @stable ICU 2.6
- */
- public String getDisplayName(Locale objectLocale, Locale displayLocale) {
- return getDisplayName(ULocale.forLocale(objectLocale), ULocale.forLocale(displayLocale));
+ try {
+ Collator other = (Collator) super.clone();
+ other.isFrozen = false;
+ return other;
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeException(e);
}
+ }
- /**
- * Return the name of the collator for the objectLocale, localized for the displayLocale.
- * If objectLocale is not visible or not defined by the factory, return null.
- * @param objectLocale the locale identifying the collator
- * @param displayLocale the locale for which the display name of the collator should be localized
- * @return the display name
- * @stable ICU 3.2
- */
- public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
- if (visible()) {
- Set<String> supported = getSupportedLocaleIDs();
- String name = objectLocale.getBaseName();
- if (supported.contains(name)) {
- return objectLocale.getDisplayName(displayLocale);
- }
- }
- return null;
- }
+ // begin registry stuff
- /**
- * Return an unmodifiable collection of the locale names directly
- * supported by this factory.
- *
- * @return the set of supported locale IDs.
- * @stable ICU 2.6
- */
- public abstract Set<String> getSupportedLocaleIDs();
-
- /**
- * Empty default constructor.
- * @stable ICU 2.6
- */
- protected CollatorFactory() {
- }
- }
+// /**
+// * A factory used with registerFactory to register multiple collators and provide
+// * display names for them. If standard locale display names are sufficient,
+// * Collator instances may be registered instead.
+// * <p><b>Note:</b> as of ICU4J 3.2, the default API for CollatorFactory uses
+// * ULocale instead of Locale. Instead of overriding createCollator(Locale),
+// * new implementations should override createCollator(ULocale). Note that
+// * one of these two methods <b>MUST</b> be overridden or else an infinite
+// * loop will occur.
+// * @stable ICU 2.6
+// */
+// public static abstract class CollatorFactory {
+// /**
+// * Return true if this factory will be visible. Default is true.
+// * If not visible, the locales supported by this factory will not
+// * be listed by getAvailableLocales.
+// *
+// * @return true if this factory is visible
+// * @stable ICU 2.6
+// */
+// public boolean visible() {
+// return true;
+// }
+//
+// /**
+// * Return an instance of the appropriate collator. If the locale
+// * is not supported, return null.
+// * <b>Note:</b> as of ICU4J 3.2, implementations should override
+// * this method instead of createCollator(Locale).
+// * @param loc the locale for which this collator is to be created.
+// * @return the newly created collator.
+// * @stable ICU 3.2
+// */
+// public Collator createCollator(ULocale loc) {
+// return createCollator(loc.toLocale());
+// }
+//
+// /**
+// * Return an instance of the appropriate collator. If the locale
+// * is not supported, return null.
+// * <p><b>Note:</b> as of ICU4J 3.2, implementations should override
+// * createCollator(ULocale) instead of this method, and inherit this
+// * method's implementation. This method is no longer abstract
+// * and instead delegates to createCollator(ULocale).
+// * @param loc the locale for which this collator is to be created.
+// * @return the newly created collator.
+// * @stable ICU 2.6
+// */
+// public Collator createCollator(Locale loc) {
+// return createCollator(ULocale.forLocale(loc));
+// }
+//
+// /**
+// * Return the name of the collator for the objectLocale, localized for the displayLocale.
+// * If objectLocale is not visible or not defined by the factory, return null.
+// * @param objectLocale the locale identifying the collator
+// * @param displayLocale the locale for which the display name of the collator should be localized
+// * @return the display name
+// * @stable ICU 2.6
+// */
+// public String getDisplayName(Locale objectLocale, Locale displayLocale) {
+// return getDisplayName(ULocale.forLocale(objectLocale), ULocale.forLocale(displayLocale));
+// }
+//
+// /**
+// * Return the name of the collator for the objectLocale, localized for the displayLocale.
+// * If objectLocale is not visible or not defined by the factory, return null.
+// * @param objectLocale the locale identifying the collator
+// * @param displayLocale the locale for which the display name of the collator should be localized
+// * @return the display name
+// * @stable ICU 3.2
+// */
+// public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
+// if (visible()) {
+// Set<String> supported = getSupportedLocaleIDs();
+// String name = objectLocale.getBaseName();
+// if (supported.contains(name)) {
+// return objectLocale.getDisplayName(displayLocale);
+// }
+// }
+// return null;
+// }
+//
+// /**
+// * Return an unmodifiable collection of the locale names directly
+// * supported by this factory.
+// *
+// * @return the set of supported locale IDs.
+// * @stable ICU 2.6
+// */
+// public abstract Set<String> getSupportedLocaleIDs();
+//
+// /**
+// * Empty default constructor.
+// * @stable ICU 2.6
+// */
+// protected CollatorFactory() {
+// }
+// }
/**
* {@icu} Returns the Collator for the desired locale.
return new Collator(java.text.Collator.getInstance(locale));
}
- /**
- * {@icu} Registers a collator as the default collator for the provided locale. The
- * collator should not be modified after it is registered.
- *
- * @param collator the collator to register
- * @param locale the locale for which this is the default collator
- * @return an object that can be used to unregister the registered collator.
- *
- * @stable ICU 3.2
- */
- public static final Object registerInstance(Collator collator, ULocale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Registers a collator factory.
- *
- * @param factory the factory to register
- * @return an object that can be used to unregister the registered factory.
- *
- * @stable ICU 2.6
- */
- public static final Object registerFactory(CollatorFactory factory) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Unregisters a collator previously registered using registerInstance.
- * @param registryKey the object previously returned by registerInstance.
- * @return true if the collator was successfully unregistered.
- * @stable ICU 2.6
- */
- public static final boolean unregister(Object registryKey) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Registers a collator as the default collator for the provided locale. The
+// * collator should not be modified after it is registered.
+// *
+// * @param collator the collator to register
+// * @param locale the locale for which this is the default collator
+// * @return an object that can be used to unregister the registered collator.
+// *
+// * @stable ICU 3.2
+// */
+// public static final Object registerInstance(Collator collator, ULocale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Registers a collator factory.
+// *
+// * @param factory the factory to register
+// * @return an object that can be used to unregister the registered factory.
+// *
+// * @stable ICU 2.6
+// */
+// public static final Object registerFactory(CollatorFactory factory) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Unregisters a collator previously registered using registerInstance.
+// * @param registryKey the object previously returned by registerInstance.
+// * @return true if the collator was successfully unregistered.
+// * @stable ICU 2.6
+// */
+// public static final boolean unregister(Object registryKey) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns the set of locales, as Locale objects, for which collators
return new String[0];
}
- /**
- * {@icu} Given a key and a locale, returns an array of string values in a preferred
- * order that would make a difference. These are all and only those values where
- * the open (creation) of the service with the locale formed from the input locale
- * plus input keyword and that value has different behavior than creation with the
- * input locale alone.
- * @param key one of the keys supported by this service. For now, only
- * "collation" is supported.
- * @param locale the locale
- * @param commonlyUsed if set to true it will return only commonly used values
- * with the given locale in preferred order. Otherwise,
- * it will return all the available values for the locale.
- * @return an array of string values for the given key and the locale.
- * @stable ICU 4.2
- */
- public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
- boolean commonlyUsed) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the functionally equivalent locale for the given
- * requested locale, with respect to given keyword, for the
- * collation service. If two locales return the same result, then
- * collators instantiated for these locales will behave
- * equivalently. The converse is not always true; two collators
- * may in fact be equivalent, but return different results, due to
- * internal details. The return result has no other meaning than
- * that stated above, and implies nothing as to the relationship
- * between the two locales. This is intended for use by
- * applications who wish to cache collators, or otherwise reuse
- * collators when possible. The functional equivalent may change
- * over time. For more information, please see the <a
- * href="http://www.icu-project.org/userguide/locale.html#services">
- * Locales and Services</a> section of the ICU User Guide.
- * @param keyword a particular keyword as enumerated by
- * getKeywords.
- * @param locID The requested locale
- * @param isAvailable If non-null, isAvailable[0] will receive and
- * output boolean that indicates whether the requested locale was
- * 'available' to the collation service. If non-null, isAvailable
- * must have length >= 1.
- * @return the locale
- * @stable ICU 3.0
- */
- public static final ULocale getFunctionalEquivalent(String keyword,
- ULocale locID,
- boolean isAvailable[]) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the functionally equivalent locale for the given
- * requested locale, with respect to given keyword, for the
- * collation service.
- * @param keyword a particular keyword as enumerated by
- * getKeywords.
- * @param locID The requested locale
- * @return the locale
- * @see #getFunctionalEquivalent(String,ULocale,boolean[])
- * @stable ICU 3.0
- */
- public static final ULocale getFunctionalEquivalent(String keyword,
- ULocale locID) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the name of the collator for the objectLocale, localized for the
- * displayLocale.
- * @param objectLocale the locale of the collator
- * @param displayLocale the locale for the collator's display name
- * @return the display name
- * @stable ICU 2.6
- */
- static public String getDisplayName(Locale objectLocale, Locale displayLocale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the name of the collator for the objectLocale, localized for the
- * displayLocale.
- * @param objectLocale the locale of the collator
- * @param displayLocale the locale for the collator's display name
- * @return the display name
- * @stable ICU 3.2
- */
- static public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the name of the collator for the objectLocale, localized for the
- * current locale.
- * @param objectLocale the locale of the collator
- * @return the display name
- * @stable ICU 2.6
- */
- static public String getDisplayName(Locale objectLocale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the name of the collator for the objectLocale, localized for the
- * current locale.
- * @param objectLocale the locale of the collator
- * @return the display name
- * @stable ICU 3.2
- */
- static public String getDisplayName(ULocale objectLocale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Given a key and a locale, returns an array of string values in a preferred
+// * order that would make a difference. These are all and only those values where
+// * the open (creation) of the service with the locale formed from the input locale
+// * plus input keyword and that value has different behavior than creation with the
+// * input locale alone.
+// * @param key one of the keys supported by this service. For now, only
+// * "collation" is supported.
+// * @param locale the locale
+// * @param commonlyUsed if set to true it will return only commonly used values
+// * with the given locale in preferred order. Otherwise,
+// * it will return all the available values for the locale.
+// * @return an array of string values for the given key and the locale.
+// * @stable ICU 4.2
+// */
+// public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
+// boolean commonlyUsed) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the functionally equivalent locale for the given
+// * requested locale, with respect to given keyword, for the
+// * collation service. If two locales return the same result, then
+// * collators instantiated for these locales will behave
+// * equivalently. The converse is not always true; two collators
+// * may in fact be equivalent, but return different results, due to
+// * internal details. The return result has no other meaning than
+// * that stated above, and implies nothing as to the relationship
+// * between the two locales. This is intended for use by
+// * applications who wish to cache collators, or otherwise reuse
+// * collators when possible. The functional equivalent may change
+// * over time. For more information, please see the <a
+// * href="http://www.icu-project.org/userguide/locale.html#services">
+// * Locales and Services</a> section of the ICU User Guide.
+// * @param keyword a particular keyword as enumerated by
+// * getKeywords.
+// * @param locID The requested locale
+// * @param isAvailable If non-null, isAvailable[0] will receive and
+// * output boolean that indicates whether the requested locale was
+// * 'available' to the collation service. If non-null, isAvailable
+// * must have length >= 1.
+// * @return the locale
+// * @stable ICU 3.0
+// */
+// public static final ULocale getFunctionalEquivalent(String keyword,
+// ULocale locID,
+// boolean isAvailable[]) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the functionally equivalent locale for the given
+// * requested locale, with respect to given keyword, for the
+// * collation service.
+// * @param keyword a particular keyword as enumerated by
+// * getKeywords.
+// * @param locID The requested locale
+// * @return the locale
+// * @see #getFunctionalEquivalent(String,ULocale,boolean[])
+// * @stable ICU 3.0
+// */
+// public static final ULocale getFunctionalEquivalent(String keyword,
+// ULocale locID) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the name of the collator for the objectLocale, localized for the
+// * displayLocale.
+// * @param objectLocale the locale of the collator
+// * @param displayLocale the locale for the collator's display name
+// * @return the display name
+// * @stable ICU 2.6
+// */
+// static public String getDisplayName(Locale objectLocale, Locale displayLocale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the name of the collator for the objectLocale, localized for the
+// * displayLocale.
+// * @param objectLocale the locale of the collator
+// * @param displayLocale the locale for the collator's display name
+// * @return the display name
+// * @stable ICU 3.2
+// */
+// static public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the name of the collator for the objectLocale, localized for the
+// * current locale.
+// * @param objectLocale the locale of the collator
+// * @return the display name
+// * @stable ICU 2.6
+// */
+// static public String getDisplayName(Locale objectLocale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the name of the collator for the objectLocale, localized for the
+// * current locale.
+// * @param objectLocale the locale of the collator
+// * @return the display name
+// * @stable ICU 3.2
+// */
+// static public String getDisplayName(ULocale objectLocale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns this Collator's strength property. The strength property
return (compare(source, target) == 0);
}
- /**
- * {@icu} Returns a UnicodeSet that contains all the characters and sequences tailored
- * in this collator.
- * @return a pointer to a UnicodeSet object containing all the
- * code points and sequences that may sort differently than
- * in the UCA.
- * @stable ICU 2.4
- */
- public UnicodeSet getTailoredSet()
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns a UnicodeSet that contains all the characters and sequences tailored
+// * in this collator.
+// * @return a pointer to a UnicodeSet object containing all the
+// * code points and sequences that may sort differently than
+// * in the UCA.
+// * @stable ICU 2.4
+// */
+// public UnicodeSet getTailoredSet()
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Compares the source text String to the target text String according to
return new CollationKey(collator.getCollationKey(source));
}
- /**
- * {@icu} Returns the simpler form of a CollationKey for the String source following
- * the rules of this Collator and stores the result into the user provided argument
- * key. If key has a internal byte array of length that's too small for the result,
- * the internal byte array will be grown to the exact required size.
- * @param source the text String to be transformed into a RawCollationKey
- * @return If key is null, a new instance of RawCollationKey will be
- * created and returned, otherwise the user provided key will be
- * returned.
- * @see #compare(String, String)
- * @see #getCollationKey
- * @see RawCollationKey
- * @stable ICU 2.8
- */
- public RawCollationKey getRawCollationKey(String source, RawCollationKey key) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Variable top is a two byte primary value which causes all the codepoints
- * with primary values that are less or equal than the variable top to be
- * shifted when alternate handling is set to SHIFTED.
- * </p>
- * <p>
- * Sets the variable top to a collation element value of a string supplied.
- * </p>
- * @param varTop one or more (if contraction) characters to which the
- * variable top should be set
- * @return a int value containing the value of the variable top in upper 16
- * bits. Lower 16 bits are undefined.
- * @throws IllegalArgumentException is thrown if varTop argument is not
- * a valid variable top element. A variable top element is
- * invalid when it is a contraction that does not exist in the
- * Collation order or when the PRIMARY strength collation
- * element for the variable top has more than two bytes
- * @see #getVariableTop
- * @see RuleBasedCollator#setAlternateHandlingShifted
- * @stable ICU 2.6
- */
- public int setVariableTop(String varTop) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the variable top value of a Collator.
- * Lower 16 bits are undefined and should be ignored.
- * @return the variable top value of a Collator.
- * @see #setVariableTop
- * @stable ICU 2.6
- */
- public int getVariableTop() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the variable top to a collation element value supplied.
- * Variable top is set to the upper 16 bits.
- * Lower 16 bits are ignored.
- * @param varTop Collation element value, as returned by setVariableTop or
- * getVariableTop
- * @see #getVariableTop
- * @see #setVariableTop
- * @stable ICU 2.6
- */
- public void setVariableTop(int varTop) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the version of this collator object.
- * @return the version object associated with this collator
- * @stable ICU 2.8
- */
- public VersionInfo getVersion() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the UCA version of this collator object.
- * @return the version object associated with this collator
- * @stable ICU 2.8
- */
- public VersionInfo getUCAVersion() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Retrieves the reordering codes for this collator.
- * These reordering codes are a combination of UScript codes and ReorderCodes.
- * @return a copy of the reordering codes for this collator;
- * if none are set then returns an empty array
- * @see #setReorderCodes
- * @see #getEquivalentReorderCodes
- * @draft ICU 4.8
- */
- public int[] getReorderCodes()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Sets the reordering codes for this collator.
- * Reordering codes allow the collation ordering for groups of characters to be changed.
- * The reordering codes are a combination of UScript codes and ReorderCodes.
- * These allow the ordering of characters belonging to these groups to be changed as a group.
- * @param order the reordering codes to apply to this collator; if this is null or an empty array
- * then this clears any existing reordering
- * @see #getReorderCodes
- * @see #getEquivalentReorderCodes
- * @draft ICU 4.8
- */
- public void setReorderCodes(int... order)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Retrieves all the reorder codes that are grouped with the given reorder code. Some reorder
- * codes are grouped and must reorder together.
- *
- * @param reorderCode code for which equivalents to be retrieved
- * @return the set of all reorder codes in the same group as the given reorder code.
- * @see #setReorderCodes
- * @see #getReorderCodes
- * @draft ICU 4.8
- */
- public static int[] getEquivalentReorderCodes(int reorderCode)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@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.
- * @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) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the simpler form of a CollationKey for the String source following
+// * the rules of this Collator and stores the result into the user provided argument
+// * key. If key has a internal byte array of length that's too small for the result,
+// * the internal byte array will be grown to the exact required size.
+// * @param source the text String to be transformed into a RawCollationKey
+// * @return If key is null, a new instance of RawCollationKey will be
+// * created and returned, otherwise the user provided key will be
+// * returned.
+// * @see #compare(String, String)
+// * @see #getCollationKey
+// * @see RawCollationKey
+// * @stable ICU 2.8
+// */
+// public RawCollationKey getRawCollationKey(String source, RawCollationKey key) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Variable top is a two byte primary value which causes all the codepoints
+// * with primary values that are less or equal than the variable top to be
+// * shifted when alternate handling is set to SHIFTED.
+// * </p>
+// * <p>
+// * Sets the variable top to a collation element value of a string supplied.
+// * </p>
+// * @param varTop one or more (if contraction) characters to which the
+// * variable top should be set
+// * @return a int value containing the value of the variable top in upper 16
+// * bits. Lower 16 bits are undefined.
+// * @throws IllegalArgumentException is thrown if varTop argument is not
+// * a valid variable top element. A variable top element is
+// * invalid when it is a contraction that does not exist in the
+// * Collation order or when the PRIMARY strength collation
+// * element for the variable top has more than two bytes
+// * @see #getVariableTop
+// * @see RuleBasedCollator#setAlternateHandlingShifted
+// * @stable ICU 2.6
+// */
+// public int setVariableTop(String varTop) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the variable top value of a Collator.
+// * Lower 16 bits are undefined and should be ignored.
+// * @return the variable top value of a Collator.
+// * @see #setVariableTop
+// * @stable ICU 2.6
+// */
+// public int getVariableTop() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the variable top to a collation element value supplied.
+// * Variable top is set to the upper 16 bits.
+// * Lower 16 bits are ignored.
+// * @param varTop Collation element value, as returned by setVariableTop or
+// * getVariableTop
+// * @see #getVariableTop
+// * @see #setVariableTop
+// * @stable ICU 2.6
+// */
+// public void setVariableTop(int varTop) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the version of this collator object.
+// * @return the version object associated with this collator
+// * @stable ICU 2.8
+// */
+// public VersionInfo getVersion() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the UCA version of this collator object.
+// * @return the version object associated with this collator
+// * @stable ICU 2.8
+// */
+// public VersionInfo getUCAVersion() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Retrieves the reordering codes for this collator.
+// * These reordering codes are a combination of UScript codes and ReorderCodes.
+// * @return a copy of the reordering codes for this collator;
+// * if none are set then returns an empty array
+// * @see #setReorderCodes
+// * @see #getEquivalentReorderCodes
+// * @draft ICU 4.8
+// */
+// public int[] getReorderCodes()
+// {
+// throw new UnsupportedOperationException();
+// }
+
+// /**
+// * Sets the reordering codes for this collator.
+// * Reordering codes allow the collation ordering for groups of characters to be changed.
+// * The reordering codes are a combination of UScript codes and ReorderCodes.
+// * These allow the ordering of characters belonging to these groups to be changed as a group.
+// * @param order the reordering codes to apply to this collator; if this is null or an empty array
+// * then this clears any existing reordering
+// * @see #getReorderCodes
+// * @see #getEquivalentReorderCodes
+// * @draft ICU 4.8
+// */
+// public void setReorderCodes(int... order)
+// {
+// throw new UnsupportedOperationException();
+// }
+
+// /**
+// * Retrieves all the reorder codes that are grouped with the given reorder code. Some reorder
+// * codes are grouped and must reorder together.
+// *
+// * @param reorderCode code for which equivalents to be retrieved
+// * @return the set of all reorder codes in the same group as the given reorder code.
+// * @see #setReorderCodes
+// * @see #getReorderCodes
+// * @draft ICU 4.8
+// */
+// public static int[] getEquivalentReorderCodes(int reorderCode)
+// {
+// throw new UnsupportedOperationException();
+// }
+
+// /**
+// * {@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.
+// * @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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
// com.ibm.icu.base specific overrides
public String toString() {
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class CurrencyPluralInfo {
- private CurrencyPluralInfo() {}
-}
*/
public static final int RELATIVE_DEFAULT = RELATIVE | DEFAULT;
- /* Below are pre-defined skeletons
- *
- * <P>
- * A skeleton
- * <ul>
- * <li>
- * 1. only keeps the field pattern letter and ignores all other parts
- * in a pattern, such as space, punctuations, and string literals.
- * <li>
- * 2. hides the order of fields.
- * <li>
- * 3. might hide a field's pattern letter length.
- *
- * For those non-digit calendar fields, the pattern letter length is
- * important, such as MMM, MMMM, and MMMMM; E and EEEE,
- * and the field's pattern letter length is honored.
- *
- * For the digit calendar fields, such as M or MM, d or dd, yy or yyyy,
- * the field pattern length is ignored and the best match, which is
- * defined in date time patterns, will be returned without honor
- * the field pattern letter length in skeleton.
- * </ul>
+ /*
+ * DATES
*/
+
/**
- * {@icu} Constant for date pattern with minute and second.
+ * {@icu} Constant for date skeleton with year.
* @stable ICU 4.0
*/
- public static final String MINUTE_SECOND = "ms";
+ public static final String YEAR = "y";
/**
- * {@icu} Constant for date pattern with hour and minute in 24-hour presentation.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with quarter.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String HOUR24_MINUTE = "Hm";
+ public static final String QUARTER = "QQQQ";
/**
- * {@icu} Constant for date pattern with hour, minute, and second in
- * 24-hour presentation.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with abbreviated quarter.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String HOUR24_MINUTE_SECOND = "Hms";
+ public static final String ABBR_QUARTER = "QQQ";
/**
- * {@icu} Constant for date pattern with hour, minute, and second.
+ * {@icu} Constant for date skeleton with year and quarter.
* @stable ICU 4.0
*/
- public static final String HOUR_MINUTE_SECOND = "hms";
+ public static final String YEAR_QUARTER = "yQQQQ";
/**
- * {@icu} Constant for date pattern with standalone month.
+ * {@icu} Constant for date skeleton with year and abbreviated quarter.
* @stable ICU 4.0
*/
- public static final String STANDALONE_MONTH = "LLLL";
+ public static final String YEAR_ABBR_QUARTER = "yQQQ";
/**
- * {@icu} Constant for date pattern with standalone abbreviated month.
+ * {@icu} Constant for date skeleton with month.
* @stable ICU 4.0
*/
- public static final String ABBR_STANDALONE_MONTH = "LLL";
+ public static final String MONTH = "MMMM";
/**
- * {@icu} Constant for date pattern with year and quarter.
+ * {@icu} Constant for date skeleton with abbreviated month.
* @stable ICU 4.0
*/
- public static final String YEAR_QUARTER = "yQQQ";
+ public static final String ABBR_MONTH = "MMM";
/**
- * {@icu} Constant for date pattern with year and abbreviated quarter.
+ * {@icu} Constant for date skeleton with numeric month.
* @stable ICU 4.0
*/
- public static final String YEAR_ABBR_QUARTER = "yQ";
-
+ public static final String NUM_MONTH = "M";
- /* Below are skeletons that date interval pre-defined in resource file.
- * Users are encouraged to use them in date interval format factory methods.
+ /**
+ * {@icu} Constant for date skeleton with year and month.
+ * @stable ICU 4.0
*/
+ public static final String YEAR_MONTH = "yMMMM";
+
/**
- * {@icu} Constant for date pattern with hour and minute.
+ * {@icu} Constant for date skeleton with year and abbreviated month.
* @stable ICU 4.0
*/
- public static final String HOUR_MINUTE = "hm";
+ public static final String YEAR_ABBR_MONTH = "yMMM";
/**
- * {@icu} Constant for date pattern with year.
+ * {@icu} Constant for date skeleton with year and numeric month.
* @stable ICU 4.0
*/
- public static final String YEAR = "y";
+ public static final String YEAR_NUM_MONTH = "yM";
/**
- * {@icu} Constant for date pattern with day.
+ * {@icu} Constant for date skeleton with day.
* @stable ICU 4.0
*/
public static final String DAY = "d";
/**
- * {@icu} Constant for date pattern with numeric month, weekday, and day.
+ * {@icu} Constant for date skeleton with year, month, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String NUM_MONTH_WEEKDAY_DAY = "MEd";
+ public static final String YEAR_MONTH_DAY = "yMMMMd";
/**
- * {@icu} Constant for date pattern with year and numeric month.
+ * {@icu} Constant for date skeleton with year, abbreviated month, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_NUM_MONTH = "yM";
+ public static final String YEAR_ABBR_MONTH_DAY = "yMMMd";
/**
- * {@icu} Constant for date pattern with numeric month and day.
+ * {@icu} Constant for date skeleton with year, numeric month, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String NUM_MONTH_DAY = "Md";
+ public static final String YEAR_NUM_MONTH_DAY = "yMd";
/**
- * {@icu} Constant for date pattern with year, numeric month, weekday, and day.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with weekday.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
+ public static final String WEEKDAY = "EEEE";
+
+ /**
+ * {@icu} Constant for date skeleton with abbreviated weekday.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String ABBR_WEEKDAY = "E";
/**
- * {@icu} Constant for date pattern with abbreviated month, weekday, and day.
+ * {@icu} Constant for date skeleton with year, month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
+ public static final String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
/**
- * {@icu} Constant for date pattern with year and month.
+ * {@icu} Constant for date skeleton with year, abbreviated month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_MONTH = "yMMMM";
+ public static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
/**
- * {@icu} Constant for date pattern with year and abbreviated month.
+ * {@icu} Constant for date skeleton with year, numeric month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_ABBR_MONTH = "yMMM";
+ public static final String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
/**
- * {@icu} Constant for date pattern having month and day.
+ * {@icu} Constant for date skeleton with long month and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
public static final String MONTH_DAY = "MMMMd";
/**
- * {@icu} Constant for date pattern with abbreviated month and day.
+ * {@icu} Constant for date skeleton with abbreviated month and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
public static final String ABBR_MONTH_DAY = "MMMd";
/**
- * {@icu} Constant for date pattern with month, weekday, and day.
+ * {@icu} Constant for date skeleton with numeric month and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
+ public static final String NUM_MONTH_DAY = "Md";
/**
- * {@icu} Constant for date pattern with year, abbreviated month, weekday,
- * and day.
+ * {@icu} Constant for date skeleton with month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
+ public static final String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
/**
- * {@icu} Constant for date pattern with year, month, weekday, and day.
+ * {@icu} Constant for date skeleton with abbreviated month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
+ public static final String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
/**
- * {@icu} Constant for date pattern with year, month, and day.
+ * {@icu} Constant for date skeleton with numeric month, weekday, and day.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String YEAR_MONTH_DAY = "yMMMMd";
+ public static final String NUM_MONTH_WEEKDAY_DAY = "MEd";
+
+ /*
+ * TIMES
+ */
/**
- * {@icu} Constant for date pattern with year, abbreviated month, and day.
+ * {@icu} Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24).
* @stable ICU 4.0
*/
- public static final String YEAR_ABBR_MONTH_DAY = "yMMMd";
+ public static final String HOUR = "j";
/**
- * {@icu} Constant for date pattern with year, numeric month, and day.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with hour in 24-hour presentation.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String YEAR_NUM_MONTH_DAY = "yMd";
+ public static final String HOUR24 = "H";
/**
- * {@icu} Constant for date pattern with numeric month.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with minute.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String NUM_MONTH = "M";
+ public static final String MINUTE = "m";
/**
- * {@icu} Constant for date pattern with abbreviated month.
+ * {@icu} Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24).
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String ABBR_MONTH = "MMM";
+ public static final String HOUR_MINUTE = "jm";
/**
- * {@icu} Constant for date pattern with month.
+ * {@icu} Constant for date skeleton with hour and minute in 24-hour presentation.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String MONTH = "MMMM";
+ public static final String HOUR24_MINUTE = "Hm";
/**
- * {@icu} Constant for date pattern with hour, minute, and generic timezone.
- * @stable ICU 4.0
+ * {@icu} Constant for date skeleton with second.
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String HOUR_MINUTE_GENERIC_TZ = "hmv";
+ public static final String SECOND = "s";
/**
- * {@icu} Constant for date pattern with hour, minute, and timezone.
+ * {@icu} Constant for date skeleton with hour, minute, and second,
+ * with the locale's preferred hour format (12 or 24).
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String HOUR_MINUTE_TZ = "hmz";
+ public static final String HOUR_MINUTE_SECOND = "jms";
/**
- * {@icu} Constant for date pattern with hour.
+ * {@icu} Constant for date skeleton with hour, minute, and second in
+ * 24-hour presentation.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String HOUR = "h";
+ public static final String HOUR24_MINUTE_SECOND = "Hms";
/**
- * {@icu} Constant for date pattern with hour and generic timezone.
+ * {@icu} Constant for date skeleton with minute and second.
+ * Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
- public static final String HOUR_GENERIC_TZ = "hv";
+ public static final String MINUTE_SECOND = "ms";
+
+ /*
+ * TIMEZONES
+ */
/**
- * {@icu} Constant for date pattern with hour and timezone.
- * @stable ICU 4.0
+ * {@icu} Constant for <i>generic location format</i>, such as Los Angeles Time;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String LOCATION_TZ = "VVVV";
+
+ /**
+ * {@icu} Constant for <i>generic non-location format</i>, such as Pacific Time;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String GENERIC_TZ = "vvvv";
+
+ /**
+ * {@icu} Constant for <i>generic non-location format</i>, abbreviated if possible, such as PT;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String ABBR_GENERIC_TZ = "v";
+
+ /**
+ * {@icu} Constant for <i>specific non-location format</i>, such as Pacific Daylight Time;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String SPECIFIC_TZ = "zzzz";
+
+ /**
+ * {@icu} Constant for <i>specific non-location format</i>, abbreviated if possible, such as PDT;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
*/
- public static final String HOUR_TZ = "hz";
+ public static final String ABBR_SPECIFIC_TZ = "z";
+
+ /**
+ * {@icu} Constant for <i>localized GMT/UTC format</i>, such as GMT+8:00 or HPG-8:00;
+ * used in combinations date + time + zone, or time + zone.
+ * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a>
+ * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a>
+ * @draft ICU 50
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final String ABBR_UTC_TZ = "ZZZZ";
+
+ /*
+ * deprecated skeleton constants
+ */
+
+ /**
+ * {@icu} Constant for date skeleton with standalone month.
+ * @deprecated ICU 50 Use {@link #MONTH} instead.
+ */
+ public static final String STANDALONE_MONTH = "LLLL";
+
+ /**
+ * {@icu} Constant for date skeleton with standalone abbreviated month.
+ * @deprecated ICU 50 Use {@link #ABBR_MONTH} instead.
+ */
+ public static final String ABBR_STANDALONE_MONTH = "LLL";
+
+ /**
+ * {@icu} Constant for date skeleton with hour, minute, and generic timezone.
+ * @deprecated ICU 50 Use instead {@link #HOUR_MINUTE}+{@link #ABBR_GENERIC_TZ} or some other timezone presentation.
+ */
+ public static final String HOUR_MINUTE_GENERIC_TZ = "jmv";
+
+ /**
+ * {@icu} Constant for date skeleton with hour, minute, and timezone.
+ * @deprecated ICU 50 Use instead {@link #HOUR_MINUTE}+{@link #ABBR_SPECIFIC_TZ} or some other timezone presentation.
+ */
+ public static final String HOUR_MINUTE_TZ = "jmz";
+
+ /**
+ * {@icu} Constant for date skeleton with hour and generic timezone.
+ * @deprecated ICU 50 Use instead {@link #HOUR}+{@link #ABBR_GENERIC_TZ} or some other timezone presentation.
+ */
+ public static final String HOUR_GENERIC_TZ = "jv";
+ /**
+ * {@icu} Constant for date skeleton with hour and timezone.
+ * @deprecated ICU 50 Use instead {@link #HOUR}+{@link #ABBR_SPECIFIC_TZ} or some other timezone presentation.
+ */
+ public static final String HOUR_TZ = "jz";
/**
* Gets the time formatter with the default formatting style
* for the default locale.
return getDateTimeInstance(cal, dateStyle, timeStyle, ULocale.getDefault(Category.FORMAT));
}
- /**
- * {@icu} Convenience overload.
- * @stable ICU 4.0
- */
- public final static DateFormat getPatternInstance(String pattern) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Convenience overload.
- * @stable ICU 4.0
- */
- public final static DateFormat getPatternInstance(String pattern, Locale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns a {@link DateFormat} object that can be used to format dates and times in
- * the given locale.
- * <p>
- * <b>Note:</b> When this functionality is moved into the core JDK, this method
- * will probably be replaced by a new overload of {@link DateFormat#getInstance}.
- * <p>
- *
- * @param pattern The pattern that selects the fields to be formatted. (Uses the
- * {@link DateTimePatternGenerator}.) This can be {@link DateFormat#ABBR_MONTH},
- * {@link DateFormat#MONTH_WEEKDAY_DAY}, etc.
- *
- * @param locale The locale for which the date/time format is desired.
- *
- * @stable ICU 4.0
- */
- public final static DateFormat getPatternInstance(String pattern, ULocale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Convenience overload.
- * @stable ICU 4.0
- */
- public final static DateFormat getPatternInstance(Calendar cal, String pattern, Locale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Creates a {@link DateFormat} object that can be used to format dates and
- * times in the calendar system specified by <code>cal</code>.
- *
- * <p><b>Note:</b> When this functionality is moved into the core JDK, this method
- * will probably be replaced by a new overload of {@link DateFormat#getInstance}.
- *
- * @param cal The calendar system for which a date/time format is desired.
- *
- * @param pattern The pattern that selects the fields to be formatted. (Uses the
- * {@link DateTimePatternGenerator}.) This can be
- * {@link DateFormat#ABBR_MONTH}, {@link DateFormat#MONTH_WEEKDAY_DAY},
- * etc.
- *
- * @param locale The locale for which the date/time format is desired.
- *
- * @stable ICU 4.0
- */
- public final static DateFormat getPatternInstance(
- Calendar cal, String pattern, ULocale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Convenience overload.
+// * @stable ICU 4.0
+// */
+// public final static DateFormat getPatternInstance(String pattern) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Convenience overload.
+// * @stable ICU 4.0
+// */
+// public final static DateFormat getPatternInstance(String pattern, Locale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns a {@link DateFormat} object that can be used to format dates and times in
+// * the given locale.
+// * <p>
+// * <b>Note:</b> When this functionality is moved into the core JDK, this method
+// * will probably be replaced by a new overload of {@link DateFormat#getInstance}.
+// * <p>
+// *
+// * @param pattern The pattern that selects the fields to be formatted. (Uses the
+// * {@link DateTimePatternGenerator}.) This can be {@link DateFormat#ABBR_MONTH},
+// * {@link DateFormat#MONTH_WEEKDAY_DAY}, etc.
+// *
+// * @param locale The locale for which the date/time format is desired.
+// *
+// * @stable ICU 4.0
+// */
+// public final static DateFormat getPatternInstance(String pattern, ULocale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Convenience overload.
+// * @stable ICU 4.0
+// */
+// public final static DateFormat getPatternInstance(Calendar cal, String pattern, Locale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Creates a {@link DateFormat} object that can be used to format dates and
+// * times in the calendar system specified by <code>cal</code>.
+// *
+// * <p><b>Note:</b> When this functionality is moved into the core JDK, this method
+// * will probably be replaced by a new overload of {@link DateFormat#getInstance}.
+// *
+// * @param cal The calendar system for which a date/time format is desired.
+// *
+// * @param pattern The pattern that selects the fields to be formatted. (Uses the
+// * {@link DateTimePatternGenerator}.) This can be
+// * {@link DateFormat#ABBR_MONTH}, {@link DateFormat#MONTH_WEEKDAY_DAY},
+// * etc.
+// *
+// * @param locale The locale for which the date/time format is desired.
+// *
+// * @stable ICU 4.0
+// */
+// public final static DateFormat getPatternInstance(
+// Calendar cal, String pattern, ULocale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* The instances of this inner class are used as attribute keys and values
// ICU only fields -------------------
- /**
- * Constant identifying the local day of week field.
- * @stable ICU 3.8
- */
- public static final Field DOW_LOCAL = new Field("local day of week", Calendar.DOW_LOCAL);
-
- /**
- * Constant identifying the extended year field.
- * @stable ICU 3.8
- */
- public static final Field EXTENDED_YEAR = new Field("extended year",
- Calendar.EXTENDED_YEAR);
-
- /**
- * Constant identifying the Julian day field.
- * @stable ICU 3.8
- */
- public static final Field JULIAN_DAY = new Field("Julian day", Calendar.JULIAN_DAY);
-
- /**
- * Constant identifying the milliseconds in day field.
- * @stable ICU 3.8
- */
- public static final Field MILLISECONDS_IN_DAY =
- new Field("milliseconds in day", Calendar.MILLISECONDS_IN_DAY);
-
- /**
- * Constant identifying the year used with week of year field.
- * @stable ICU 3.8
- */
- public static final Field YEAR_WOY = new Field("year for week of year", Calendar.YEAR_WOY);
-
- /**
- * Constant identifying the quarter field.
- * @stable ICU 3.8
- */
- public static final Field QUARTER = new Field("quarter", -1);
+// /**
+// * Constant identifying the local day of week field.
+// * @stable ICU 3.8
+// */
+// public static final Field DOW_LOCAL = new Field("local day of week", Calendar.DOW_LOCAL);
+
+// /**
+// * Constant identifying the extended year field.
+// * @stable ICU 3.8
+// */
+// public static final Field EXTENDED_YEAR = new Field("extended year",
+// Calendar.EXTENDED_YEAR);
+
+// /**
+// * Constant identifying the Julian day field.
+// * @stable ICU 3.8
+// */
+// public static final Field JULIAN_DAY = new Field("Julian day", Calendar.JULIAN_DAY);
+
+// /**
+// * Constant identifying the milliseconds in day field.
+// * @stable ICU 3.8
+// */
+// public static final Field MILLISECONDS_IN_DAY =
+// new Field("milliseconds in day", Calendar.MILLISECONDS_IN_DAY);
+
+// /**
+// * Constant identifying the year used with week of year field.
+// * @stable ICU 3.8
+// */
+// public static final Field YEAR_WOY = new Field("year for week of year", Calendar.YEAR_WOY);
+
+// /**
+// * Constant identifying the quarter field.
+// * @stable ICU 3.8
+// */
+// public static final Field QUARTER = new Field("quarter", -1);
// Stand alone types are variants for its base types. So we do not define Field for
// them.
fieldAttribute = java.text.DateFormat.Field.WEEK_OF_YEAR;
} else if (fieldAttribute.equals(Field.YEAR)) {
fieldAttribute = java.text.DateFormat.Field.YEAR;
- } else if (fieldAttribute.equals(Field.DOW_LOCAL)
- || fieldAttribute.equals(Field.EXTENDED_YEAR)
- || fieldAttribute.equals(Field.JULIAN_DAY)
- || fieldAttribute.equals(Field.MILLISECONDS_IN_DAY)
- || fieldAttribute.equals(Field.YEAR_WOY)
- || fieldAttribute.equals(Field.QUARTER)) {
- // Not supported
- throw new UnsupportedOperationException("Format Field not supported by com.ibm.icu.base");
}
+// else if (fieldAttribute.equals(Field.DOW_LOCAL)
+// || fieldAttribute.equals(Field.EXTENDED_YEAR)
+// || fieldAttribute.equals(Field.JULIAN_DAY)
+// || fieldAttribute.equals(Field.MILLISECONDS_IN_DAY)
+// || fieldAttribute.equals(Field.YEAR_WOY)
+// || fieldAttribute.equals(Field.QUARTER)) {
+// // Not supported
+// throw new UnsupportedOperationException("Format Field not supported by com.ibm.icu.base");
+// }
jdkPos = new FieldPosition(fieldAttribute, fieldID);
} else {
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.text;
import java.io.Serializable;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
* @stable ICU 3.8
*/
public static Locale[] getAvailableLocales() {
- Locale[] avlocs = null;
- boolean isJava5 = true;
- try {
- Method mGetAvailableLocales = java.text.DateFormatSymbols.class.getMethod("getAvailableLocales", (Class[])null);
- avlocs = (Locale[]) mGetAvailableLocales.invoke(null, (Object[]) null);
- isJava5 = false;
- } catch (NoSuchMethodException nsme) {
- // fall through
- } catch (InvocationTargetException ite) {
- // fall through
- } catch (IllegalAccessException iae) {
- // fall through
- }
-
- if (isJava5) {
- // Use DateFormat's getAvailableLocales as fallback
- avlocs = DateFormat.getAvailableLocales();
- }
-
- return avlocs;
+ return java.text.DateFormat.getAvailableLocales();
}
/**
public void setShortWeekdays(String[] newShortWeekdays) {
dfs.setShortWeekdays(newShortWeekdays);
}
- /**
- * {@icu} Returns quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
- * @param context The quarter context, FORMAT or STANDALONE.
- * @param width The width or the returned quarter string,
- * either WIDE or ABBREVIATED. There are no NARROW quarters.
- * @return the quarter strings.
- * @stable ICU 3.6
- */
- public String[] getQuarters(int context, int width) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
- /**
- * {@icu} Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
- * @param newQuarters the new quarter strings.
- * @param context The formatting context, FORMAT or STANDALONE.
- * @param width The width of the quarter string,
- * either WIDE or ABBREVIATED. There are no NARROW quarters.
- * @stable ICU 3.8
- */
- public void setQuarters(String[] newQuarters, int context, int width) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
+// * @param context The quarter context, FORMAT or STANDALONE.
+// * @param width The width or the returned quarter string,
+// * either WIDE or ABBREVIATED. There are no NARROW quarters.
+// * @return the quarter strings.
+// * @stable ICU 3.6
+// */
+// public String[] getQuarters(int context, int width) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
+// * @param newQuarters the new quarter strings.
+// * @param context The formatting context, FORMAT or STANDALONE.
+// * @param width The width of the quarter string,
+// * either WIDE or ABBREVIATED. There are no NARROW quarters.
+// * @stable ICU 3.8
+// */
+// public void setQuarters(String[] newQuarters, int context, int width) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns am/pm strings. For example: "AM" and "PM".
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- /**
- * Returns the {@link DateFormatSymbols} object that should be used to format a
- * calendar system's dates in the given locale.
- * <p>
- * <b>Subclassing:</b><br>
- * When creating a new Calendar subclass, you must create the
- * {@link ResourceBundle ResourceBundle}
- * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
- * The resource bundle name is based on the calendar's fully-specified
- * class name, with ".resources" inserted at the end of the package name
- * (just before the class name) and "Symbols" appended to the end.
- * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
- * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
- * <p>
- * Within the ResourceBundle, this method searches for five keys:
- * <ul>
- * <li><b>DayNames</b> -
- * An array of strings corresponding to each possible
- * value of the <code>DAY_OF_WEEK</code> field. Even though
- * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
- * This array is 0-based; the name for Sunday goes in the
- * first position, at index 0. If this key is not found
- * in the bundle, the day names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- *
- * <li><b>DayAbbreviations</b> -
- * An array of abbreviated day names corresponding
- * to the values in the "DayNames" array. If this key
- * is not found in the resource bundle, the "DayNames"
- * values are used instead. If neither key is found,
- * the day abbreviations are inherited from the default
- * <code>DateFormatSymbols</code> for the locale.
- *
- * <li><b>MonthNames</b> -
- * An array of strings corresponding to each possible
- * value of the <code>MONTH</code> field. If this key is not found
- * in the bundle, the month names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- *
- * <li><b>MonthAbbreviations</b> -
- * An array of abbreviated day names corresponding
- * to the values in the "MonthNames" array. If this key
- * is not found in the resource bundle, the "MonthNames"
- * values are used instead. If neither key is found,
- * the day abbreviations are inherited from the default
- * <code>DateFormatSymbols</code> for the locale.
- *
- * <li><b>Eras</b> -
- * An array of strings corresponding to each possible
- * value of the <code>ERA</code> field. If this key is not found
- * in the bundle, the era names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- * </ul>
- * <p>
- * @param cal The calendar system whose date format symbols are desired.
- * @param locale The locale whose symbols are desired.
- *
- * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
- * @stable ICU 2.0
- */
- public DateFormatSymbols(Calendar cal, Locale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the {@link DateFormatSymbols} object that should be used to format a
- * calendar system's dates in the given locale.
- * <p>
- * <b>Subclassing:</b><br>
- * When creating a new Calendar subclass, you must create the
- * {@link ResourceBundle ResourceBundle}
- * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
- * The resource bundle name is based on the calendar's fully-specified
- * class name, with ".resources" inserted at the end of the package name
- * (just before the class name) and "Symbols" appended to the end.
- * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
- * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
- * <p>
- * Within the ResourceBundle, this method searches for five keys:
- * <ul>
- * <li><b>DayNames</b> -
- * An array of strings corresponding to each possible
- * value of the <code>DAY_OF_WEEK</code> field. Even though
- * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
- * This array is 0-based; the name for Sunday goes in the
- * first position, at index 0. If this key is not found
- * in the bundle, the day names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- *
- * <li><b>DayAbbreviations</b> -
- * An array of abbreviated day names corresponding
- * to the values in the "DayNames" array. If this key
- * is not found in the resource bundle, the "DayNames"
- * values are used instead. If neither key is found,
- * the day abbreviations are inherited from the default
- * <code>DateFormatSymbols</code> for the locale.
- *
- * <li><b>MonthNames</b> -
- * An array of strings corresponding to each possible
- * value of the <code>MONTH</code> field. If this key is not found
- * in the bundle, the month names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- *
- * <li><b>MonthAbbreviations</b> -
- * An array of abbreviated day names corresponding
- * to the values in the "MonthNames" array. If this key
- * is not found in the resource bundle, the "MonthNames"
- * values are used instead. If neither key is found,
- * the day abbreviations are inherited from the default
- * <code>DateFormatSymbols</code> for the locale.
- *
- * <li><b>Eras</b> -
- * An array of strings corresponding to each possible
- * value of the <code>ERA</code> field. If this key is not found
- * in the bundle, the era names are inherited from the
- * default <code>DateFormatSymbols</code> for the requested locale.
- * </ul>
- * <p>
- * @param cal The calendar system whose date format symbols are desired.
- * @param locale The ulocale whose symbols are desired.
- *
- * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
- * @stable ICU 3.2
- */
- public DateFormatSymbols(Calendar cal, ULocale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class
- * instead of a Calandar instance.
- * @see #DateFormatSymbols(Calendar, Locale)
- * @stable ICU 2.2
- */
- public DateFormatSymbols(Class<? extends Calendar> calendarClass, Locale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class
- * instead of a Calandar instance.
- * @see #DateFormatSymbols(Calendar, Locale)
- * @stable ICU 3.2
- */
- public DateFormatSymbols(Class<? extends Calendar> calendarClass, ULocale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Fetches a custom calendar's DateFormatSymbols out of the given resource
- * bundle. Symbols that are not overridden are inherited from the
- * default DateFormatSymbols for the locale.
- * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
- * @stable ICU 2.0
- */
- public DateFormatSymbols(ResourceBundle bundle, Locale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Fetches a custom calendar's DateFormatSymbols out of the given resource
- * bundle. Symbols that are not overridden are inherited from the
- * default DateFormatSymbols for the locale.
- * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
- * @stable ICU 3.2
- */
- public DateFormatSymbols(ResourceBundle bundle, ULocale locale) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
-
- /**
- * Finds the ResourceBundle containing the date format information for
- * a specified calendar subclass in a given locale.
- * <p>
- * The resource bundle name is based on the calendar's fully-specified
- * class name, with ".resources" inserted at the end of the package name
- * (just before the class name) and "Symbols" appended to the end.
- * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
- * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
- * <p>
- * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
- * this API no longer works as described. This method always returns null.
- * @deprecated ICU 4.0
- */
- // This API was formerly @stable ICU 2.0
- static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
- Locale locale) throws MissingResourceException {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base"); }
-
- /**
- * Finds the ResourceBundle containing the date format information for
- * a specified calendar subclass in a given locale.
- * <p>
- * The resource bundle name is based on the calendar's fully-specified
- * class name, with ".resources" inserted at the end of the package name
- * (just before the class name) and "Symbols" appended to the end.
- * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
- * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
- * <p>
- * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
- * this API no longer works as described. This method always returns null.
- * @deprecated ICU 4.0
- */
- // This API was formerly @stable ICU 3.2
- static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
- ULocale locale) throws MissingResourceException {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base"); }
-
- /**
- * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
- * a Calendar instance instead of a Calendar class.
- * <p>
- * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
- * this API no longer works as described. This method always returns null.
- * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
- * @deprecated ICU 4.0
- */
- // This API was formerly @stable ICU 2.2
- public static ResourceBundle getDateFormatBundle(Calendar cal, Locale locale) throws MissingResourceException {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base"); }
-
- /**
- * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
- * a Calendar instance instead of a Calendar class.
- * <p>
- * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
- * this API no longer works as described. This method always returns null.
- * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
- * @deprecated ICU 4.0
- */
- // This API was formerly @stable ICU 3.2
- public static ResourceBundle getDateFormatBundle(Calendar cal, ULocale locale) throws MissingResourceException {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base"); }
-
- /**
- * 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) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Returns the {@link DateFormatSymbols} object that should be used to format a
+// * calendar system's dates in the given locale.
+// * <p>
+// * <b>Subclassing:</b><br>
+// * When creating a new Calendar subclass, you must create the
+// * {@link ResourceBundle ResourceBundle}
+// * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
+// * The resource bundle name is based on the calendar's fully-specified
+// * class name, with ".resources" inserted at the end of the package name
+// * (just before the class name) and "Symbols" appended to the end.
+// * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
+// * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
+// * <p>
+// * Within the ResourceBundle, this method searches for five keys:
+// * <ul>
+// * <li><b>DayNames</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>DAY_OF_WEEK</code> field. Even though
+// * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
+// * This array is 0-based; the name for Sunday goes in the
+// * first position, at index 0. If this key is not found
+// * in the bundle, the day names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// *
+// * <li><b>DayAbbreviations</b> -
+// * An array of abbreviated day names corresponding
+// * to the values in the "DayNames" array. If this key
+// * is not found in the resource bundle, the "DayNames"
+// * values are used instead. If neither key is found,
+// * the day abbreviations are inherited from the default
+// * <code>DateFormatSymbols</code> for the locale.
+// *
+// * <li><b>MonthNames</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>MONTH</code> field. If this key is not found
+// * in the bundle, the month names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// *
+// * <li><b>MonthAbbreviations</b> -
+// * An array of abbreviated day names corresponding
+// * to the values in the "MonthNames" array. If this key
+// * is not found in the resource bundle, the "MonthNames"
+// * values are used instead. If neither key is found,
+// * the day abbreviations are inherited from the default
+// * <code>DateFormatSymbols</code> for the locale.
+// *
+// * <li><b>Eras</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>ERA</code> field. If this key is not found
+// * in the bundle, the era names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// * </ul>
+// * <p>
+// * @param cal The calendar system whose date format symbols are desired.
+// * @param locale The locale whose symbols are desired.
+// *
+// * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
+// * @stable ICU 2.0
+// */
+// public DateFormatSymbols(Calendar cal, Locale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the {@link DateFormatSymbols} object that should be used to format a
+// * calendar system's dates in the given locale.
+// * <p>
+// * <b>Subclassing:</b><br>
+// * When creating a new Calendar subclass, you must create the
+// * {@link ResourceBundle ResourceBundle}
+// * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
+// * The resource bundle name is based on the calendar's fully-specified
+// * class name, with ".resources" inserted at the end of the package name
+// * (just before the class name) and "Symbols" appended to the end.
+// * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
+// * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
+// * <p>
+// * Within the ResourceBundle, this method searches for five keys:
+// * <ul>
+// * <li><b>DayNames</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>DAY_OF_WEEK</code> field. Even though
+// * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
+// * This array is 0-based; the name for Sunday goes in the
+// * first position, at index 0. If this key is not found
+// * in the bundle, the day names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// *
+// * <li><b>DayAbbreviations</b> -
+// * An array of abbreviated day names corresponding
+// * to the values in the "DayNames" array. If this key
+// * is not found in the resource bundle, the "DayNames"
+// * values are used instead. If neither key is found,
+// * the day abbreviations are inherited from the default
+// * <code>DateFormatSymbols</code> for the locale.
+// *
+// * <li><b>MonthNames</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>MONTH</code> field. If this key is not found
+// * in the bundle, the month names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// *
+// * <li><b>MonthAbbreviations</b> -
+// * An array of abbreviated day names corresponding
+// * to the values in the "MonthNames" array. If this key
+// * is not found in the resource bundle, the "MonthNames"
+// * values are used instead. If neither key is found,
+// * the day abbreviations are inherited from the default
+// * <code>DateFormatSymbols</code> for the locale.
+// *
+// * <li><b>Eras</b> -
+// * An array of strings corresponding to each possible
+// * value of the <code>ERA</code> field. If this key is not found
+// * in the bundle, the era names are inherited from the
+// * default <code>DateFormatSymbols</code> for the requested locale.
+// * </ul>
+// * <p>
+// * @param cal The calendar system whose date format symbols are desired.
+// * @param locale The ulocale whose symbols are desired.
+// *
+// * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
+// * @stable ICU 3.2
+// */
+// public DateFormatSymbols(Calendar cal, ULocale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class
+// * instead of a Calandar instance.
+// * @see #DateFormatSymbols(Calendar, Locale)
+// * @stable ICU 2.2
+// */
+// public DateFormatSymbols(Class<? extends Calendar> calendarClass, Locale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class
+// * instead of a Calandar instance.
+// * @see #DateFormatSymbols(Calendar, Locale)
+// * @stable ICU 3.2
+// */
+// public DateFormatSymbols(Class<? extends Calendar> calendarClass, ULocale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Fetches a custom calendar's DateFormatSymbols out of the given resource
+// * bundle. Symbols that are not overridden are inherited from the
+// * default DateFormatSymbols for the locale.
+// * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
+// * @stable ICU 2.0
+// */
+// public DateFormatSymbols(ResourceBundle bundle, Locale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Fetches a custom calendar's DateFormatSymbols out of the given resource
+// * bundle. Symbols that are not overridden are inherited from the
+// * default DateFormatSymbols for the locale.
+// * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
+// * @stable ICU 3.2
+// */
+// public DateFormatSymbols(ResourceBundle bundle, ULocale locale) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Finds the ResourceBundle containing the date format information for
+// * a specified calendar subclass in a given locale.
+// * <p>
+// * The resource bundle name is based on the calendar's fully-specified
+// * class name, with ".resources" inserted at the end of the package name
+// * (just before the class name) and "Symbols" appended to the end.
+// * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
+// * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
+// * <p>
+// * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
+// * this API no longer works as described. This method always returns null.
+// * @deprecated ICU 4.0
+// */
+// // This API was formerly @stable ICU 2.0
+// static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
+// Locale locale) throws MissingResourceException {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Finds the ResourceBundle containing the date format information for
+// * a specified calendar subclass in a given locale.
+// * <p>
+// * The resource bundle name is based on the calendar's fully-specified
+// * class name, with ".resources" inserted at the end of the package name
+// * (just before the class name) and "Symbols" appended to the end.
+// * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
+// * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
+// * <p>
+// * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
+// * this API no longer works as described. This method always returns null.
+// * @deprecated ICU 4.0
+// */
+// // This API was formerly @stable ICU 3.2
+// static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
+// ULocale locale) throws MissingResourceException {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
+// * a Calendar instance instead of a Calendar class.
+// * <p>
+// * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
+// * this API no longer works as described. This method always returns null.
+// * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
+// * @deprecated ICU 4.0
+// */
+// // This API was formerly @stable ICU 2.2
+// public static ResourceBundle getDateFormatBundle(Calendar cal, Locale locale) throws MissingResourceException {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
+// * a Calendar instance instead of a Calendar class.
+// * <p>
+// * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
+// * this API no longer works as described. This method always returns null.
+// * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
+// * @deprecated ICU 4.0
+// */
+// // This API was formerly @stable ICU 3.2
+// public static ResourceBundle getDateFormatBundle(Calendar cal, ULocale locale) throws MissingResourceException {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * 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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
}
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
import java.util.Map.Entry;
import com.ibm.icu.math.BigDecimal;
-import com.ibm.icu.math.MathContext;
import com.ibm.icu.util.Currency;
-import com.ibm.icu.util.CurrencyAmount;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
this(new java.text.DecimalFormat(pattern, symbols.dfs));
}
- /**
- * Creates a DecimalFormat from the given pattern, symbols, information used for
- * currency plural format, and format style. Use this constructor when you need to
- * completely customize the behavior of the format.
- *
- * <p>To obtain standard formats for a given locale, use the factory methods on
- * NumberFormat such as getInstance or getCurrencyInstance.
- *
- * <p>If you need only minor adjustments to a standard format, you can modify the
- * format returned by a NumberFormat factory method using the setters.
- *
- * <p>If you want to completely customize a decimal format, using your own
- * DecimalFormatSymbols (such as group separators) and your own information for
- * currency plural formatting (such as plural rule and currency plural patterns), you
- * can use this constructor.
- *
- * @param pattern a non-localized pattern string
- * @param symbols the set of symbols to be used
- * @param infoInput the information used for currency plural format, including
- * currency plural patterns and plural rules.
- * @param style the decimal formatting style, it is one of the following values:
- * NumberFormat.NUMBERSTYLE; NumberFormat.CURRENCYSTYLE; NumberFormat.PERCENTSTYLE;
- * NumberFormat.SCIENTIFICSTYLE; NumberFormat.INTEGERSTYLE;
- * NumberFormat.ISOCURRENCYSTYLE; NumberFormat.PLURALCURRENCYSTYLE;
- * @stable ICU 4.2
- */
- public DecimalFormat(String pattern, DecimalFormatSymbols symbols, CurrencyPluralInfo infoInput,
- int style) {
- throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
- }
+// /**
+// * Creates a DecimalFormat from the given pattern, symbols, information used for
+// * currency plural format, and format style. Use this constructor when you need to
+// * completely customize the behavior of the format.
+// *
+// * <p>To obtain standard formats for a given locale, use the factory methods on
+// * NumberFormat such as getInstance or getCurrencyInstance.
+// *
+// * <p>If you need only minor adjustments to a standard format, you can modify the
+// * format returned by a NumberFormat factory method using the setters.
+// *
+// * <p>If you want to completely customize a decimal format, using your own
+// * DecimalFormatSymbols (such as group separators) and your own information for
+// * currency plural formatting (such as plural rule and currency plural patterns), you
+// * can use this constructor.
+// *
+// * @param pattern a non-localized pattern string
+// * @param symbols the set of symbols to be used
+// * @param infoInput the information used for currency plural format, including
+// * currency plural patterns and plural rules.
+// * @param style the decimal formatting style, it is one of the following values:
+// * NumberFormat.NUMBERSTYLE; NumberFormat.CURRENCYSTYLE; NumberFormat.PERCENTSTYLE;
+// * NumberFormat.SCIENTIFICSTYLE; NumberFormat.INTEGERSTYLE;
+// * NumberFormat.ISOCURRENCYSTYLE; NumberFormat.PLURALCURRENCYSTYLE;
+// * @stable ICU 4.2
+// */
+// public DecimalFormat(String pattern, DecimalFormatSymbols symbols, CurrencyPluralInfo infoInput,
+// int style) {
+// throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
+// }
/**
* {@inheritDoc}
return super.parse(text, parsePosition);
}
- /**
- * Parses text from the given string as a CurrencyAmount. Unlike the parse() method,
- * this method will attempt to parse a generic currency name, searching for a match of
- * this object's locale's currency display names, or for a 3-letter ISO currency
- * code. This method will fail if this format is not a currency format, that is, if it
- * does not contain the currency pattern symbol (U+00A4) in its prefix or suffix.
- *
- * @param text the string to parse
- * @param pos input-output position; on input, the position within text to match; must
- * have 0 <= pos.getIndex() < text.length(); on output, the position after the last
- * matched character. If the parse fails, the position in unchanged upon output.
- * @return a CurrencyAmount, or null upon failure
- */
- CurrencyAmount parseCurrency(String text, ParsePosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Parses text from the given string as a CurrencyAmount. Unlike the parse() method,
+// * this method will attempt to parse a generic currency name, searching for a match of
+// * this object's locale's currency display names, or for a 3-letter ISO currency
+// * code. This method will fail if this format is not a currency format, that is, if it
+// * does not contain the currency pattern symbol (U+00A4) in its prefix or suffix.
+// *
+// * @param text the string to parse
+// * @param pos input-output position; on input, the position within text to match; must
+// * have 0 <= pos.getIndex() < text.length(); on output, the position after the last
+// * matched character. If the parse fails, the position in unchanged upon output.
+// * @return a CurrencyAmount, or null upon failure
+// */
+// CurrencyAmount parseCurrency(String text, ParsePosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns a copy of the decimal format symbols used by this format.
((java.text.DecimalFormat)numberFormat).setMultiplier(newValue);
}
- /**
- * {@icu} Returns the rounding increment.
- *
- * @return A positive rounding increment, or <code>null</code> if rounding is not in
- * effect.
- * @see #setRoundingIncrement
- * @see #getRoundingMode
- * @see #setRoundingMode
- * @stable ICU 2.0
- */
- public BigDecimal getRoundingIncrement() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the rounding increment. This method also controls whether rounding is
- * enabled.
- *
- * @param newValue A positive rounding increment, or <code>null</code> or
- * <code>BigDecimal(0.0)</code> to disable rounding.
- * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
- * @see #getRoundingIncrement
- * @see #getRoundingMode
- * @see #setRoundingMode
- * @stable ICU 2.0
- */
- public void setRoundingIncrement(java.math.BigDecimal newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the rounding increment. This method also controls whether rounding is
- * enabled.
- *
- * @param newValue A positive rounding increment, or <code>null</code> or
- * <code>BigDecimal(0.0)</code> to disable rounding.
- * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
- * @see #getRoundingIncrement
- * @see #getRoundingMode
- * @see #setRoundingMode
- * @stable ICU 3.6
- */
- public void setRoundingIncrement(BigDecimal newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the rounding increment. This method also controls whether rounding is
- * enabled.
- *
- * @param newValue A positive rounding increment, or 0.0 to disable rounding.
- * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
- * @see #getRoundingIncrement
- * @see #getRoundingMode
- * @see #setRoundingMode
- * @stable ICU 2.0
- */
- public void setRoundingIncrement(double newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the rounding mode.
- *
- * @return A rounding mode, between <code>BigDecimal.ROUND_UP</code> and
- * <code>BigDecimal.ROUND_UNNECESSARY</code>.
- * @see #setRoundingIncrement
- * @see #getRoundingIncrement
- * @see #setRoundingMode
- * @see java.math.BigDecimal
- * @stable ICU 2.0
- */
- public int getRoundingMode() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Sets the rounding mode. This has no effect unless the rounding increment is greater
- * than zero.
- *
- * @param roundingMode A rounding mode, between <code>BigDecimal.ROUND_UP</code> and
- * <code>BigDecimal.ROUND_UNNECESSARY</code>.
- * @exception IllegalArgumentException if <code>roundingMode</code> is unrecognized.
- * @see #setRoundingIncrement
- * @see #getRoundingIncrement
- * @see #getRoundingMode
- * @see java.math.BigDecimal
- * @stable ICU 2.0
- */
- public void setRoundingMode(int roundingMode) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the width to which the output of <code>format()</code> is padded. The width is
- * counted in 16-bit code units.
- *
- * @return the format width, or zero if no padding is in effect
- * @see #setFormatWidth
- * @see #getPadCharacter
- * @see #setPadCharacter
- * @see #getPadPosition
- * @see #setPadPosition
- * @stable ICU 2.0
- */
- public int getFormatWidth() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Sets the width to which the output of <code>format()</code> is
- * padded. The width is counted in 16-bit code units. This method
- * also controls whether padding is enabled.
- *
- * @param width the width to which to pad the result of
- * <code>format()</code>, or zero to disable padding
- * @exception IllegalArgumentException if <code>width</code> is < 0
- * @see #getFormatWidth
- * @see #getPadCharacter
- * @see #setPadCharacter
- * @see #getPadPosition
- * @see #setPadPosition
- * @stable ICU 2.0
- */
- public void setFormatWidth(int width) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the character used to pad to the format width. The default is ' '.
- *
- * @return the pad character
- * @see #setFormatWidth
- * @see #getFormatWidth
- * @see #setPadCharacter
- * @see #getPadPosition
- * @see #setPadPosition
- * @stable ICU 2.0
- */
- public char getPadCharacter() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the character used to pad to the format width. If padding is not
- * enabled, then this will take effect if padding is later enabled.
- *
- * @param padChar the pad character
- * @see #setFormatWidth
- * @see #getFormatWidth
- * @see #getPadCharacter
- * @see #getPadPosition
- * @see #setPadPosition
- * @stable ICU 2.0
- */
- public void setPadCharacter(char padChar) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the position at which padding will take place. This is the location at
- * which padding will be inserted if the result of <code>format()</code> is shorter
- * than the format width.
- *
- * @return the pad position, one of <code>PAD_BEFORE_PREFIX</code>,
- * <code>PAD_AFTER_PREFIX</code>, <code>PAD_BEFORE_SUFFIX</code>, or
- * <code>PAD_AFTER_SUFFIX</code>.
- * @see #setFormatWidth
- * @see #getFormatWidth
- * @see #setPadCharacter
- * @see #getPadCharacter
- * @see #setPadPosition
- * @see #PAD_BEFORE_PREFIX
- * @see #PAD_AFTER_PREFIX
- * @see #PAD_BEFORE_SUFFIX
- * @see #PAD_AFTER_SUFFIX
- * @stable ICU 2.0
- */
- public int getPadPosition() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the position at which padding will take place. This is the location at
- * which padding will be inserted if the result of <code>format()</code> is shorter
- * than the format width. This has no effect unless padding is enabled.
- *
- * @param padPos the pad position, one of <code>PAD_BEFORE_PREFIX</code>,
- * <code>PAD_AFTER_PREFIX</code>, <code>PAD_BEFORE_SUFFIX</code>, or
- * <code>PAD_AFTER_SUFFIX</code>.
- * @exception IllegalArgumentException if the pad position in unrecognized
- * @see #setFormatWidth
- * @see #getFormatWidth
- * @see #setPadCharacter
- * @see #getPadCharacter
- * @see #getPadPosition
- * @see #PAD_BEFORE_PREFIX
- * @see #PAD_AFTER_PREFIX
- * @see #PAD_BEFORE_SUFFIX
- * @see #PAD_AFTER_SUFFIX
- * @stable ICU 2.0
- */
- public void setPadPosition(int padPos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns whether or not scientific notation is used.
- *
- * @return true if this object formats and parses scientific notation
- * @see #setScientificNotation
- * @see #getMinimumExponentDigits
- * @see #setMinimumExponentDigits
- * @see #isExponentSignAlwaysShown
- * @see #setExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public boolean isScientificNotation() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets whether or not scientific notation is used. When scientific notation is
- * used, the effective maximum number of integer digits is <= 8. If the maximum number
- * of integer digits is set to more than 8, the effective maximum will be 1. This
- * allows this call to generate a 'default' scientific number format without
- * additional changes.
- *
- * @param useScientific true if this object formats and parses scientific notation
- * @see #isScientificNotation
- * @see #getMinimumExponentDigits
- * @see #setMinimumExponentDigits
- * @see #isExponentSignAlwaysShown
- * @see #setExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public void setScientificNotation(boolean useScientific) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the minimum exponent digits that will be shown.
- *
- * @return the minimum exponent digits that will be shown
- * @see #setScientificNotation
- * @see #isScientificNotation
- * @see #setMinimumExponentDigits
- * @see #isExponentSignAlwaysShown
- * @see #setExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public byte getMinimumExponentDigits() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the minimum exponent digits that will be shown. This has no effect
- * unless scientific notation is in use.
- *
- * @param minExpDig a value >= 1 indicating the fewest exponent
- * digits that will be shown
- * @exception IllegalArgumentException if <code>minExpDig</code> < 1
- * @see #setScientificNotation
- * @see #isScientificNotation
- * @see #getMinimumExponentDigits
- * @see #isExponentSignAlwaysShown
- * @see #setExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public void setMinimumExponentDigits(byte minExpDig) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns whether the exponent sign is always shown.
- *
- * @return true if the exponent is always prefixed with either the localized minus
- * sign or the localized plus sign, false if only negative exponents are prefixed with
- * the localized minus sign.
- * @see #setScientificNotation
- * @see #isScientificNotation
- * @see #setMinimumExponentDigits
- * @see #getMinimumExponentDigits
- * @see #setExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public boolean isExponentSignAlwaysShown() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets whether the exponent sign is always shown. This has no effect unless
- * scientific notation is in use.
- *
- * @param expSignAlways true if the exponent is always prefixed with either the
- * localized minus sign or the localized plus sign, false if only negative exponents
- * are prefixed with the localized minus sign.
- * @see #setScientificNotation
- * @see #isScientificNotation
- * @see #setMinimumExponentDigits
- * @see #getMinimumExponentDigits
- * @see #isExponentSignAlwaysShown
- * @stable ICU 2.0
- */
- public void setExponentSignAlwaysShown(boolean expSignAlways) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the rounding increment.
+// *
+// * @return A positive rounding increment, or <code>null</code> if rounding is not in
+// * effect.
+// * @see #setRoundingIncrement
+// * @see #getRoundingMode
+// * @see #setRoundingMode
+// * @stable ICU 2.0
+// */
+// public BigDecimal getRoundingIncrement() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the rounding increment. This method also controls whether rounding is
+// * enabled.
+// *
+// * @param newValue A positive rounding increment, or <code>null</code> or
+// * <code>BigDecimal(0.0)</code> to disable rounding.
+// * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
+// * @see #getRoundingIncrement
+// * @see #getRoundingMode
+// * @see #setRoundingMode
+// * @stable ICU 2.0
+// */
+// public void setRoundingIncrement(java.math.BigDecimal newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the rounding increment. This method also controls whether rounding is
+// * enabled.
+// *
+// * @param newValue A positive rounding increment, or <code>null</code> or
+// * <code>BigDecimal(0.0)</code> to disable rounding.
+// * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
+// * @see #getRoundingIncrement
+// * @see #getRoundingMode
+// * @see #setRoundingMode
+// * @stable ICU 3.6
+// */
+// public void setRoundingIncrement(BigDecimal newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the rounding increment. This method also controls whether rounding is
+// * enabled.
+// *
+// * @param newValue A positive rounding increment, or 0.0 to disable rounding.
+// * @throws IllegalArgumentException if <code>newValue</code> is < 0.0
+// * @see #getRoundingIncrement
+// * @see #getRoundingMode
+// * @see #setRoundingMode
+// * @stable ICU 2.0
+// */
+// public void setRoundingIncrement(double newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the rounding mode.
+// *
+// * @return A rounding mode, between <code>BigDecimal.ROUND_UP</code> and
+// * <code>BigDecimal.ROUND_UNNECESSARY</code>.
+// * @see #setRoundingIncrement
+// * @see #getRoundingIncrement
+// * @see #setRoundingMode
+// * @see java.math.BigDecimal
+// * @stable ICU 2.0
+// */
+// public int getRoundingMode() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Sets the rounding mode. This has no effect unless the rounding increment is greater
+// * than zero.
+// *
+// * @param roundingMode A rounding mode, between <code>BigDecimal.ROUND_UP</code> and
+// * <code>BigDecimal.ROUND_UNNECESSARY</code>.
+// * @exception IllegalArgumentException if <code>roundingMode</code> is unrecognized.
+// * @see #setRoundingIncrement
+// * @see #getRoundingIncrement
+// * @see #getRoundingMode
+// * @see java.math.BigDecimal
+// * @stable ICU 2.0
+// */
+// public void setRoundingMode(int roundingMode) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the width to which the output of <code>format()</code> is padded. The width is
+// * counted in 16-bit code units.
+// *
+// * @return the format width, or zero if no padding is in effect
+// * @see #setFormatWidth
+// * @see #getPadCharacter
+// * @see #setPadCharacter
+// * @see #getPadPosition
+// * @see #setPadPosition
+// * @stable ICU 2.0
+// */
+// public int getFormatWidth() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Sets the width to which the output of <code>format()</code> is
+// * padded. The width is counted in 16-bit code units. This method
+// * also controls whether padding is enabled.
+// *
+// * @param width the width to which to pad the result of
+// * <code>format()</code>, or zero to disable padding
+// * @exception IllegalArgumentException if <code>width</code> is < 0
+// * @see #getFormatWidth
+// * @see #getPadCharacter
+// * @see #setPadCharacter
+// * @see #getPadPosition
+// * @see #setPadPosition
+// * @stable ICU 2.0
+// */
+// public void setFormatWidth(int width) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the character used to pad to the format width. The default is ' '.
+// *
+// * @return the pad character
+// * @see #setFormatWidth
+// * @see #getFormatWidth
+// * @see #setPadCharacter
+// * @see #getPadPosition
+// * @see #setPadPosition
+// * @stable ICU 2.0
+// */
+// public char getPadCharacter() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the character used to pad to the format width. If padding is not
+// * enabled, then this will take effect if padding is later enabled.
+// *
+// * @param padChar the pad character
+// * @see #setFormatWidth
+// * @see #getFormatWidth
+// * @see #getPadCharacter
+// * @see #getPadPosition
+// * @see #setPadPosition
+// * @stable ICU 2.0
+// */
+// public void setPadCharacter(char padChar) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the position at which padding will take place. This is the location at
+// * which padding will be inserted if the result of <code>format()</code> is shorter
+// * than the format width.
+// *
+// * @return the pad position, one of <code>PAD_BEFORE_PREFIX</code>,
+// * <code>PAD_AFTER_PREFIX</code>, <code>PAD_BEFORE_SUFFIX</code>, or
+// * <code>PAD_AFTER_SUFFIX</code>.
+// * @see #setFormatWidth
+// * @see #getFormatWidth
+// * @see #setPadCharacter
+// * @see #getPadCharacter
+// * @see #setPadPosition
+// * @see #PAD_BEFORE_PREFIX
+// * @see #PAD_AFTER_PREFIX
+// * @see #PAD_BEFORE_SUFFIX
+// * @see #PAD_AFTER_SUFFIX
+// * @stable ICU 2.0
+// */
+// public int getPadPosition() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the position at which padding will take place. This is the location at
+// * which padding will be inserted if the result of <code>format()</code> is shorter
+// * than the format width. This has no effect unless padding is enabled.
+// *
+// * @param padPos the pad position, one of <code>PAD_BEFORE_PREFIX</code>,
+// * <code>PAD_AFTER_PREFIX</code>, <code>PAD_BEFORE_SUFFIX</code>, or
+// * <code>PAD_AFTER_SUFFIX</code>.
+// * @exception IllegalArgumentException if the pad position in unrecognized
+// * @see #setFormatWidth
+// * @see #getFormatWidth
+// * @see #setPadCharacter
+// * @see #getPadCharacter
+// * @see #getPadPosition
+// * @see #PAD_BEFORE_PREFIX
+// * @see #PAD_AFTER_PREFIX
+// * @see #PAD_BEFORE_SUFFIX
+// * @see #PAD_AFTER_SUFFIX
+// * @stable ICU 2.0
+// */
+// public void setPadPosition(int padPos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns whether or not scientific notation is used.
+// *
+// * @return true if this object formats and parses scientific notation
+// * @see #setScientificNotation
+// * @see #getMinimumExponentDigits
+// * @see #setMinimumExponentDigits
+// * @see #isExponentSignAlwaysShown
+// * @see #setExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public boolean isScientificNotation() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets whether or not scientific notation is used. When scientific notation is
+// * used, the effective maximum number of integer digits is <= 8. If the maximum number
+// * of integer digits is set to more than 8, the effective maximum will be 1. This
+// * allows this call to generate a 'default' scientific number format without
+// * additional changes.
+// *
+// * @param useScientific true if this object formats and parses scientific notation
+// * @see #isScientificNotation
+// * @see #getMinimumExponentDigits
+// * @see #setMinimumExponentDigits
+// * @see #isExponentSignAlwaysShown
+// * @see #setExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public void setScientificNotation(boolean useScientific) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the minimum exponent digits that will be shown.
+// *
+// * @return the minimum exponent digits that will be shown
+// * @see #setScientificNotation
+// * @see #isScientificNotation
+// * @see #setMinimumExponentDigits
+// * @see #isExponentSignAlwaysShown
+// * @see #setExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public byte getMinimumExponentDigits() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the minimum exponent digits that will be shown. This has no effect
+// * unless scientific notation is in use.
+// *
+// * @param minExpDig a value >= 1 indicating the fewest exponent
+// * digits that will be shown
+// * @exception IllegalArgumentException if <code>minExpDig</code> < 1
+// * @see #setScientificNotation
+// * @see #isScientificNotation
+// * @see #getMinimumExponentDigits
+// * @see #isExponentSignAlwaysShown
+// * @see #setExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public void setMinimumExponentDigits(byte minExpDig) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns whether the exponent sign is always shown.
+// *
+// * @return true if the exponent is always prefixed with either the localized minus
+// * sign or the localized plus sign, false if only negative exponents are prefixed with
+// * the localized minus sign.
+// * @see #setScientificNotation
+// * @see #isScientificNotation
+// * @see #setMinimumExponentDigits
+// * @see #getMinimumExponentDigits
+// * @see #setExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public boolean isExponentSignAlwaysShown() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets whether the exponent sign is always shown. This has no effect unless
+// * scientific notation is in use.
+// *
+// * @param expSignAlways true if the exponent is always prefixed with either the
+// * localized minus sign or the localized plus sign, false if only negative exponents
+// * are prefixed with the localized minus sign.
+// * @see #setScientificNotation
+// * @see #isScientificNotation
+// * @see #setMinimumExponentDigits
+// * @see #getMinimumExponentDigits
+// * @see #isExponentSignAlwaysShown
+// * @stable ICU 2.0
+// */
+// public void setExponentSignAlwaysShown(boolean expSignAlways) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns the grouping size. Grouping size is the number of digits between grouping
((java.text.DecimalFormat)numberFormat).setGroupingSize(newValue);
}
- /**
- * {@icu} Returns the secondary grouping size. In some locales one grouping interval
- * is used for the least significant integer digits (the primary grouping size), and
- * another is used for all others (the secondary grouping size). A formatter
- * supporting a secondary grouping size will return a positive integer unequal to the
- * primary grouping size returned by <code>getGroupingSize()</code>. For example, if
- * the primary grouping size is 4, and the secondary grouping size is 2, then the
- * number 123456789 formats as "1,23,45,6789", and the pattern appears as "#,##,###0".
- *
- * @return the secondary grouping size, or a value less than one if there is none
- * @see #setSecondaryGroupingSize
- * @see NumberFormat#isGroupingUsed
- * @see DecimalFormatSymbols#getGroupingSeparator
- * @stable ICU 2.0
- */
- public int getSecondaryGroupingSize() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the secondary grouping size. If set to a value less than 1, then
- * secondary grouping is turned off, and the primary grouping size is used for all
- * intervals, not just the least significant.
- *
- * @see #getSecondaryGroupingSize
- * @see NumberFormat#setGroupingUsed
- * @see DecimalFormatSymbols#setGroupingSeparator
- * @stable ICU 2.0
- */
- public void setSecondaryGroupingSize(int newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the MathContext used by this format.
- *
- * @return desired MathContext
- * @see #getMathContext
- * @stable ICU 4.2
- */
- public MathContext getMathContextICU() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the MathContext used by this format.
- *
- * @return desired MathContext
- * @see #getMathContext
- * @stable ICU 4.2
- */
- public java.math.MathContext getMathContext() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the MathContext used by this format.
- *
- * @param newValue desired MathContext
- * @see #getMathContext
- * @stable ICU 4.2
- */
- public void setMathContextICU(MathContext newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the MathContext used by this format.
- *
- * @param newValue desired MathContext
- * @see #getMathContext
- * @stable ICU 4.2
- */
- public void setMathContext(java.math.MathContext newValue) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the secondary grouping size. In some locales one grouping interval
+// * is used for the least significant integer digits (the primary grouping size), and
+// * another is used for all others (the secondary grouping size). A formatter
+// * supporting a secondary grouping size will return a positive integer unequal to the
+// * primary grouping size returned by <code>getGroupingSize()</code>. For example, if
+// * the primary grouping size is 4, and the secondary grouping size is 2, then the
+// * number 123456789 formats as "1,23,45,6789", and the pattern appears as "#,##,###0".
+// *
+// * @return the secondary grouping size, or a value less than one if there is none
+// * @see #setSecondaryGroupingSize
+// * @see NumberFormat#isGroupingUsed
+// * @see DecimalFormatSymbols#getGroupingSeparator
+// * @stable ICU 2.0
+// */
+// public int getSecondaryGroupingSize() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the secondary grouping size. If set to a value less than 1, then
+// * secondary grouping is turned off, and the primary grouping size is used for all
+// * intervals, not just the least significant.
+// *
+// * @see #getSecondaryGroupingSize
+// * @see NumberFormat#setGroupingUsed
+// * @see DecimalFormatSymbols#setGroupingSeparator
+// * @stable ICU 2.0
+// */
+// public void setSecondaryGroupingSize(int newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the MathContext used by this format.
+// *
+// * @return desired MathContext
+// * @see #getMathContext
+// * @stable ICU 4.2
+// */
+// public MathContext getMathContextICU() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the MathContext used by this format.
+// *
+// * @return desired MathContext
+// * @see #getMathContext
+// * @stable ICU 4.2
+// */
+// public java.math.MathContext getMathContext() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the MathContext used by this format.
+// *
+// * @param newValue desired MathContext
+// * @see #getMathContext
+// * @stable ICU 4.2
+// */
+// public void setMathContextICU(MathContext newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the MathContext used by this format.
+// *
+// * @param newValue desired MathContext
+// * @see #getMathContext
+// * @stable ICU 4.2
+// */
+// public void setMathContext(java.math.MathContext newValue) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns the behavior of the decimal separator with integers. (The decimal
((java.text.DecimalFormat)numberFormat).setDecimalSeparatorAlwaysShown(newValue);
}
- /**
- * {@icu} Returns a copy of the CurrencyPluralInfo used by this format. It might
- * return null if the decimal format is not a plural type currency decimal
- * format. Plural type currency decimal format means either the pattern in the decimal
- * format contains 3 currency signs, or the decimal format is initialized with
- * PLURALCURRENCYSTYLE.
- *
- * @return desired CurrencyPluralInfo
- * @see CurrencyPluralInfo
- * @stable ICU 4.2
- */
- public CurrencyPluralInfo getCurrencyPluralInfo() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the CurrencyPluralInfo used by this format. The format uses a copy of
- * the provided information.
- *
- * @param newInfo desired CurrencyPluralInfo
- * @see CurrencyPluralInfo
- * @stable ICU 4.2
- */
- public void setCurrencyPluralInfo(CurrencyPluralInfo newInfo) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns a copy of the CurrencyPluralInfo used by this format. It might
+// * return null if the decimal format is not a plural type currency decimal
+// * format. Plural type currency decimal format means either the pattern in the decimal
+// * format contains 3 currency signs, or the decimal format is initialized with
+// * PLURALCURRENCYSTYLE.
+// *
+// * @return desired CurrencyPluralInfo
+// * @see CurrencyPluralInfo
+// * @stable ICU 4.2
+// */
+// public CurrencyPluralInfo getCurrencyPluralInfo() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the CurrencyPluralInfo used by this format. The format uses a copy of
+// * the provided information.
+// *
+// * @param newInfo desired CurrencyPluralInfo
+// * @see CurrencyPluralInfo
+// * @stable ICU 4.2
+// */
+// public void setCurrencyPluralInfo(CurrencyPluralInfo newInfo) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Overrides clone.
super.setMinimumIntegerDigits(newValue);
}
- /**
- * {@icu} Returns the minimum number of significant digits that will be
- * displayed. This value has no effect unless {@link #areSignificantDigitsUsed()}
- * returns true.
- *
- * @return the fewest significant digits that will be shown
- * @stable ICU 3.0
- */
- public int getMinimumSignificantDigits() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the maximum number of significant digits that will be
- * displayed. This value has no effect unless {@link #areSignificantDigitsUsed()}
- * returns true.
- *
- * @return the most significant digits that will be shown
- * @stable ICU 3.0
- */
- public int getMaximumSignificantDigits() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the minimum number of significant digits that will be displayed. If
- * <code>min</code> is less than one then it is set to one. If the maximum significant
- * digits count is less than <code>min</code>, then it is set to
- * <code>min</code>. This value has no effect unless {@link #areSignificantDigitsUsed()}
- * returns true.
- *
- * @param min the fewest significant digits to be shown
- * @stable ICU 3.0
- */
- public void setMinimumSignificantDigits(int min) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets the maximum number of significant digits that will be displayed. If
- * <code>max</code> is less than one then it is set to one. If the minimum significant
- * digits count is greater than <code>max</code>, then it is set to
- * <code>max</code>. This value has no effect unless {@link #areSignificantDigitsUsed()}
- * returns true.
- *
- * @param max the most significant digits to be shown
- * @stable ICU 3.0
- */
- public void setMaximumSignificantDigits(int max) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns true if significant digits are in use or false if integer and
- * fraction digit counts are in use.
- *
- * @return true if significant digits are in use
- * @stable ICU 3.0
- */
- public boolean areSignificantDigitsUsed() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Sets whether significant digits are in use, or integer and fraction digit
- * counts are in use.
- *
- * @param useSignificantDigits true to use significant digits, or false to use integer
- * and fraction digit counts
- * @stable ICU 3.0
- */
- public void setSignificantDigitsUsed(boolean useSignificantDigits) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the minimum number of significant digits that will be
+// * displayed. This value has no effect unless {@link #areSignificantDigitsUsed()}
+// * returns true.
+// *
+// * @return the fewest significant digits that will be shown
+// * @stable ICU 3.0
+// */
+// public int getMinimumSignificantDigits() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the maximum number of significant digits that will be
+// * displayed. This value has no effect unless {@link #areSignificantDigitsUsed()}
+// * returns true.
+// *
+// * @return the most significant digits that will be shown
+// * @stable ICU 3.0
+// */
+// public int getMaximumSignificantDigits() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the minimum number of significant digits that will be displayed. If
+// * <code>min</code> is less than one then it is set to one. If the maximum significant
+// * digits count is less than <code>min</code>, then it is set to
+// * <code>min</code>. This value has no effect unless {@link #areSignificantDigitsUsed()}
+// * returns true.
+// *
+// * @param min the fewest significant digits to be shown
+// * @stable ICU 3.0
+// */
+// public void setMinimumSignificantDigits(int min) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the maximum number of significant digits that will be displayed. If
+// * <code>max</code> is less than one then it is set to one. If the minimum significant
+// * digits count is greater than <code>max</code>, then it is set to
+// * <code>max</code>. This value has no effect unless {@link #areSignificantDigitsUsed()}
+// * returns true.
+// *
+// * @param max the most significant digits to be shown
+// * @stable ICU 3.0
+// */
+// public void setMaximumSignificantDigits(int max) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns true if significant digits are in use or false if integer and
+// * fraction digit counts are in use.
+// *
+// * @return true if significant digits are in use
+// * @stable ICU 3.0
+// */
+// public boolean areSignificantDigitsUsed() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets whether significant digits are in use, or integer and fraction digit
+// * counts are in use.
+// *
+// * @param useSignificantDigits true to use significant digits, or false to use integer
+// * and fraction digit counts
+// * @stable ICU 3.0
+// */
+// public void setSignificantDigitsUsed(boolean useSignificantDigits) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Sets the <tt>Currency</tt> object used to display currency amounts. This takes
import java.io.Serializable;
import java.util.Locale;
+import com.ibm.icu.util.Currency;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
public DecimalFormatSymbols(ULocale locale) {
this(new java.text.DecimalFormatSymbols(locale.toLocale()));
}
-
+
+ /**
+ * Returns a DecimalFormatSymbols instance for the default locale.
+ *
+ * <p><strong>Note:</strong> Unlike
+ * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns
+ * <code>new com.ibm.icu.text.DecimalFormatSymbols()</code>. ICU currently does not
+ * support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java 6.
+ *
+ * @return A DecimalFormatSymbols instance.
+ * @stable ICU 3.8
+ */
+ public static DecimalFormatSymbols getInstance() {
+ return new DecimalFormatSymbols();
+ }
+
+ /**
+ * Returns a DecimalFormatSymbols instance for the given locale.
+ *
+ * <p><strong>Note:</strong> Unlike
+ * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns
+ * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does
+ * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java
+ * 6.
+ *
+ * @param locale the locale.
+ * @return A DecimalFormatSymbols instance.
+ * @stable ICU 3.8
+ */
+ public static DecimalFormatSymbols getInstance(Locale locale) {
+ return new DecimalFormatSymbols(locale);
+ }
+
+ /**
+ * Returns a DecimalFormatSymbols instance for the given locale.
+ *
+ * <p><strong>Note:</strong> Unlike
+ * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns
+ * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does
+ * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java
+ * 6.
+ *
+ * @param locale the locale.
+ * @return A DecimalFormatSymbols instance.
+ * @stable ICU 3.8
+ */
+ public static DecimalFormatSymbols getInstance(ULocale locale) {
+ return new DecimalFormatSymbols(locale);
+ }
+
+// /**
+// * Returns an array of all locales for which the <code>getInstance</code> methods of
+// * this class can return localized instances.
+// *
+// * <p><strong>Note:</strong> Unlike
+// * <code>java.text.DecimalFormatSymbols#getAvailableLocales</code>, this method simply
+// * returns the array of <code>Locale</code>s available for this class. ICU currently
+// * does not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in
+// * Java 6.
+// *
+// * @return An array of <code>Locale</code>s for which localized
+// * <code>DecimalFormatSymbols</code> instances are available.
+// * @stable ICU 3.8
+// */
+// public static Locale[] getAvailableLocales() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns an array of all locales for which the <code>getInstance</code>
+// * methods of this class can return localized instances.
+// *
+// * <p><strong>Note:</strong> Unlike
+// * <code>java.text.DecimalFormatSymbols#getAvailableLocales</code>, this method simply
+// * returns the array of <code>ULocale</code>s available in this class. ICU currently
+// * does not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in
+// * Java 6.
+// *
+// * @return An array of <code>ULocale</code>s for which localized
+// * <code>DecimalFormatSymbols</code> instances are available.
+// * @stable ICU 3.8 (retain)
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static ULocale[] getAvailableULocales() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
/**
* Return the character used for zero. Different for Arabic, etc.
* @return the character
public void setZeroDigit(char zeroDigit) {
dfs.setZeroDigit(zeroDigit);
}
-
+
+// /**
+// * Returns the character used to represent a significant digit in a pattern.
+// * @return the significant digit pattern character
+// * @stable ICU 3.0
+// */
+// public char getSignificantDigit() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Sets the character used to represent a significant digit in a pattern.
+// * @param sigDigit the significant digit pattern character
+// * @stable ICU 3.0
+// */
+// public void setSignificantDigit(char sigDigit) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
/**
* Return the character used for thousands separator. Different for French, etc.
* @return the thousands character
public void setCurrencySymbol(String currency) {
dfs.setCurrencySymbol(currency);
}
-
+
+ /**
+ * Returns the currency symbol, for JDK 1.4 compatibility only.
+ * ICU clients should use the Currency API directly.
+ * @return the currency used, or null
+ * @stable ICU 3.4
+ */
+ public Currency getCurrency() {
+ return new Currency(dfs.getCurrency());
+ }
+
+ /**
+ * Sets the currency.
+ *
+ * <p><strong>Note:</strong> ICU does not use the DecimalFormatSymbols for the currency
+ * any more. This API is present for API compatibility only.
+ *
+ * <p>This also sets the currency symbol attribute to the currency's symbol
+ * in the DecimalFormatSymbols' locale, and the international currency
+ * symbol attribute to the currency's ISO 4217 currency code.
+ *
+ * @param currency the new currency to be used
+ * @throws NullPointerException if <code>currency</code> is null
+ * @see #setCurrencySymbol
+ * @see #setInternationalCurrencySymbol
+ *
+ * @stable ICU 3.4
+ */
+ public void setCurrency(Currency currency) {
+ dfs.setCurrency(java.util.Currency.getInstance(currency.getCurrencyCode()));
+ }
+
/**
* Return the international string denoting the local currency.
* @return the international string denoting the local currency
public void setMonetaryDecimalSeparator(char sep) {
dfs.setMonetaryDecimalSeparator(sep);
}
-
+
+// /**
+// * {@icu} Returns the monetary grouping separator.
+// * @return the monetary grouping separator character
+// * @stable ICU 3.6
+// */
+// public char getMonetaryGroupingSeparator() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Sets the monetary decimal separator.
+// * @param sep the monetary decimal separator character
+// * @stable ICU 3.6
+// */
+// public void setMonetaryGroupingSeparator(char sep) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the string used to separate the mantissa from the exponent.
+// * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
+// * @return the localized exponent symbol, used in localized patterns
+// * and formatted strings
+// * @see #setExponentSeparator
+// * @stable ICU 2.0
+// */
+// public String getExponentSeparator() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the string used to separate the mantissa from the exponent.
+// * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
+// * @param exp the localized exponent symbol, used in localized patterns
+// * and formatted strings
+// * @see #getExponentSeparator
+// * @stable ICU 2.0
+// */
+// public void setExponentSeparator(String exp) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the localized plus sign.
+// * @return the plus sign, used in localized patterns and formatted
+// * strings
+// * @see #setPlusSign
+// * @see #setMinusSign
+// * @see #getMinusSign
+// * @stable ICU 2.0
+// */
+// public char getPlusSign() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the localized plus sign.
+// * @param plus the plus sign, used in localized patterns and formatted
+// * strings
+// * @see #getPlusSign
+// * @see #setMinusSign
+// * @see #getMinusSign
+// * @stable ICU 2.0
+// */
+// public void setPlusSign(char plus) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the character used to pad numbers out to a specified width. This is
+// * not the pad character itself; rather, it is the special pattern character
+// * <em>preceding</em> the pad character. In the pattern "*_#,##0", '*' is the pad
+// * escape, and '_' is the pad character.
+// * @return the character
+// * @see #setPadEscape
+// * @see DecimalFormat#getFormatWidth
+// * @see DecimalFormat#getPadPosition
+// * @see DecimalFormat#getPadCharacter
+// * @stable ICU 2.0
+// */
+// public char getPadEscape() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the character used to pad numbers out to a specified width. This is not
+// * the pad character itself; rather, it is the special pattern character
+// * <em>preceding</em> the pad character. In the pattern "*_#,##0", '*' is the pad
+// * escape, and '_' is the pad character.
+// * @see #getPadEscape
+// * @see DecimalFormat#setFormatWidth
+// * @see DecimalFormat#setPadPosition
+// * @see DecimalFormat#setPadCharacter
+// * @stable ICU 2.0
+// */
+// public void setPadEscape(char c) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Indicates the currency match pattern used in {@link #getPatternForCurrencySpacing}.
+// * @stable ICU 4.2
+// */
+// public static final int CURRENCY_SPC_CURRENCY_MATCH = 0;
+//
+// /**
+// * {@icu} Indicates the surrounding match pattern used in {@link
+// * #getPatternForCurrencySpacing}.
+// * @stable ICU 4.2
+// */
+// public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1;
+//
+// /**
+// * {@icu} Indicates the insertion value used in {@link #getPatternForCurrencySpacing}.
+// * @stable ICU 4.4
+// */
+// public static final int CURRENCY_SPC_INSERT = 2;
+
+// /**
+// * {@icu} Returns the desired currency spacing value. Original values come from ICU's
+// * CLDR data based on the locale provided during construction, and can be null. These
+// * values govern what and when text is inserted between a currency code/name/symbol
+// * and the currency amount when formatting money.
+// *
+// * <p>For more information, see <a href="http://www.unicode.org/reports/tr35/#Currencies"
+// * >UTS#35 section 5.10.2</a>.
+// *
+// * <p><strong>Note:</strong> ICU4J does not currently use this information.
+// *
+// * @param itemType one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH
+// * or CURRENCY_SPC_INSERT
+// * @param beforeCurrency true to get the <code>beforeCurrency</code> values, false
+// * to get the <code>afterCurrency</code> values.
+// * @return the value, or null.
+// * @see #setPatternForCurrencySpacing(int, boolean, String)
+// * @stable ICU 4.2
+// */
+// public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Sets the indicated currency spacing pattern or value. See {@link
+// * #getPatternForCurrencySpacing} for more information.
+// *
+// * <p>Values for currency match and surrounding match must be {@link
+// * com.ibm.icu.text.UnicodeSet} patterns. Values for insert can be any string.
+// *
+// * <p><strong>Note:</strong> ICU4J does not currently use this information.
+// *
+// * @param itemType one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH
+// * or CURRENCY_SPC_INSERT
+// * @param beforeCurrency true if the pattern is for before the currency symbol.
+// * false if the pattern is for after it.
+// * @param pattern string to override current setting; can be null.
+// * @see #getPatternForCurrencySpacing(int, boolean)
+// * @stable ICU 4.2
+// */
+// public void setPatternForCurrencySpacing(int itemType, boolean beforeCurrency, String pattern) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+
+// /**
+// * Returns the locale for which this object was constructed.
+// * @return the locale for which this object was constructed
+// * @stable ICU 2.0
+// */
+// public Locale getLocale() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the locale for which this object was constructed.
+// * @return the locale for which this object was constructed
+// * @stable ICU 3.2
+// */
+// public ULocale getULocale() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
/**
* Standard override.
* @stable ICU 2.0
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
wrapNestedFormatters(messageFormat);
}
- /**
- * {@icu} Sets the ApostropheMode and the pattern used by this message format.
- * Parses the pattern and caches Format objects for simple argument types.
- * Patterns and their interpretation are specified in the
- * <a href="#patterns">class description</a>.
- * <p>
- * This method is best used only once on a given object to avoid confusion about the mode,
- * and after constructing the object with an empty pattern string to minimize overhead.
- *
- * @param pattern the pattern for this message format
- * @param aposMode the new ApostropheMode
- * @throws IllegalArgumentException if the pattern is invalid
- * @see MessagePattern.ApostropheMode
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public void applyPattern(String pattern, MessagePattern.ApostropheMode aposMode) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Sets the ApostropheMode and the pattern used by this message format.
+// * Parses the pattern and caches Format objects for simple argument types.
+// * Patterns and their interpretation are specified in the
+// * <a href="#patterns">class description</a>.
+// * <p>
+// * This method is best used only once on a given object to avoid confusion about the mode,
+// * and after constructing the object with an empty pattern string to minimize overhead.
+// *
+// * @param pattern the pattern for this message format
+// * @param aposMode the new ApostropheMode
+// * @throws IllegalArgumentException if the pattern is invalid
+// * @see MessagePattern.ApostropheMode
+// * @stable ICU 4.8
+// */
+// public void applyPattern(String pattern, MessagePattern.ApostropheMode aposMode) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu}
+// * @return this instance's ApostropheMode.
+// * @stable ICU 4.8
+// */
+// public MessagePattern.ApostropheMode getApostropheMode() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
- /**
- * {@icu}
- * @return this instance's ApostropheMode.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public MessagePattern.ApostropheMode getApostropheMode() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
/**
* Returns a pattern representing the current state of the message format.
* The string is constructed from internal information and therefore
savedPattern = null;
}
- /**
- * {@icu} Sets the formats to use for the values passed into
- * <code>format</code> methods or returned from <code>parse</code>
- * methods. The keys in <code>newFormats</code> are the argument
- * names in the previously set pattern string, and the values
- * are the formats.
- * <p>
- * Only argument names from the pattern string are considered.
- * Extra keys in <code>newFormats</code> that do not correspond
- * to an argument name are ignored. Similarly, if there is no
- * format in newFormats for an argument name, the formatter
- * for that argument remains unchanged.
- * <p>
- * This may be called on formats that do not use named arguments.
- * In this case the map will be queried for key Strings that
- * represent argument indices, e.g. "0", "1", "2" etc.
- *
- * @param newFormats a map from String to Format providing new
- * formats for named arguments.
- * @stable ICU 3.8
- */
- public void setFormatsByArgumentName(Map<String, Format> newFormats) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Sets the formats to use for the values passed into
+// * <code>format</code> methods or returned from <code>parse</code>
+// * methods. The keys in <code>newFormats</code> are the argument
+// * names in the previously set pattern string, and the values
+// * are the formats.
+// * <p>
+// * Only argument names from the pattern string are considered.
+// * Extra keys in <code>newFormats</code> that do not correspond
+// * to an argument name are ignored. Similarly, if there is no
+// * format in newFormats for an argument name, the formatter
+// * for that argument remains unchanged.
+// * <p>
+// * This may be called on formats that do not use named arguments.
+// * In this case the map will be queried for key Strings that
+// * represent argument indices, e.g. "0", "1", "2" etc.
+// *
+// * @param newFormats a map from String to Format providing new
+// * formats for named arguments.
+// * @stable ICU 3.8
+// */
+// public void setFormatsByArgumentName(Map<String, Format> newFormats) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Sets the formats to use for the format elements in the
savedPattern = null;
}
- /**
- * {@icu} Sets the format to use for the format elements within the
- * previously set pattern string that use the given argument
- * name.
- * <p>
- * If the argument name is used for more than one format element
- * in the pattern string, then the new format is used for all such
- * format elements. If the argument name is not used for any format
- * element in the pattern string, then the new format is ignored.
- * <p>
- * This API may be used on formats that do not use named arguments.
- * In this case <code>argumentName</code> should be a String that names
- * an argument index, e.g. "0", "1", "2"... etc. If it does not name
- * a valid index, the format will be ignored. No error is thrown.
- *
- * @param argumentName the name of the argument to change
- * @param newFormat the new format to use
- * @stable ICU 3.8
- */
- public void setFormatByArgumentName(String argumentName, Format newFormat) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Sets the format to use for the format elements within the
+// * previously set pattern string that use the given argument
+// * name.
+// * <p>
+// * If the argument name is used for more than one format element
+// * in the pattern string, then the new format is used for all such
+// * format elements. If the argument name is not used for any format
+// * element in the pattern string, then the new format is ignored.
+// * <p>
+// * This API may be used on formats that do not use named arguments.
+// * In this case <code>argumentName</code> should be a String that names
+// * an argument index, e.g. "0", "1", "2"... etc. If it does not name
+// * a valid index, the format will be ignored. No error is thrown.
+// *
+// * @param argumentName the name of the argument to change
+// * @param newFormat the new format to use
+// * @stable ICU 3.8
+// */
+// public void setFormatByArgumentName(String argumentName, Format newFormat) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Sets the format to use for the format element with the given
return messageFormat.getFormats();
}
- /**
- * {@icu} Returns the format argument names. For more details, see
- * {@link #setFormatByArgumentName(String, Format)}.
- * @return List of names
- * @internal
- * @deprecated This API is ICU internal only.
- */
- public Set<String> getFormatArgumentNames() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the format argument names. For more details, see
+// * {@link #setFormatByArgumentName(String, Format)}.
+// * @return List of names
+// * @internal
+// * @deprecated This API is ICU internal only.
+// */
+// public Set<String> getFormatArgumentNames() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
- /**
- * {@icu} Returns the first top-level format associated with the given argument name.
- * For more details, see {@link #setFormatByArgumentName(String, Format)}.
- * @param argumentName The name of the desired argument.
- * @return the Format associated with the name, or null if there isn't one.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public Format getFormatByArgumentName(String argumentName) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the first top-level format associated with the given argument name.
+// * For more details, see {@link #setFormatByArgumentName(String, Format)}.
+// * @param argumentName The name of the desired argument.
+// * @return the Format associated with the name, or null if there isn't one.
+// * @stable ICU 4.8
+// */
+// public Format getFormatByArgumentName(String argumentName) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
- /**
- * {@icu} Returns the top-level argument names. For more details, see
- * {@link #setFormatByArgumentName(String, Format)}.
- * @return a Set of argument names
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public Set<String> getArgumentNames() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the top-level argument names. For more details, see
+// * {@link #setFormatByArgumentName(String, Format)}.
+// * @return a Set of argument names
+// * @stable ICU 4.8
+// */
+// public Set<String> getArgumentNames() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Formats an array of objects and appends the <code>MessageFormat</code>'s
return buf;
}
- /**
- * Formats a map of objects and appends the <code>MessageFormat</code>'s
- * pattern, with format elements replaced by the formatted objects, to the
- * provided <code>StringBuffer</code>.
- * <p>
- * The text substituted for the individual format elements is derived from
- * the current subformat of the format element and the
- * <code>arguments</code> value corresopnding to the format element's
- * argument name.
- * <p>
- * This API may be called on formats that do not use named arguments.
- * In this case the the keys in <code>arguments</code> must be numeric
- * strings (e.g. "0", "1", "2"...).
- * <p>
- * An argument is <i>unavailable</i> if <code>arguments</code> is
- * <code>null</code> or does not have a value corresponding to an argument
- * name in the pattern. When an argument is unavailable no substitution
- * is performed.
- *
- * @param arguments a map of objects to be formatted and substituted.
- * @param result where text is appended.
- * @param pos On input: an alignment field, if desired.
- * On output: the offsets of the alignment field.
- * @throws IllegalArgumentException if an argument in the
- * <code>arguments</code> array is not of the type
- * expected by the format element(s) that use it.
- * @return the passed-in StringBuffer
- * @stable ICU 3.8
- */
- public final StringBuffer format(Map<String, Object> arguments, StringBuffer result,
- FieldPosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Formats a map of objects and appends the <code>MessageFormat</code>'s
+// * pattern, with format elements replaced by the formatted objects, to the
+// * provided <code>StringBuffer</code>.
+// * <p>
+// * The text substituted for the individual format elements is derived from
+// * the current subformat of the format element and the
+// * <code>arguments</code> value corresopnding to the format element's
+// * argument name.
+// * <p>
+// * This API may be called on formats that do not use named arguments.
+// * In this case the the keys in <code>arguments</code> must be numeric
+// * strings (e.g. "0", "1", "2"...).
+// * <p>
+// * An argument is <i>unavailable</i> if <code>arguments</code> is
+// * <code>null</code> or does not have a value corresponding to an argument
+// * name in the pattern. When an argument is unavailable no substitution
+// * is performed.
+// *
+// * @param arguments a map of objects to be formatted and substituted.
+// * @param result where text is appended.
+// * @param pos On input: an alignment field, if desired.
+// * On output: the offsets of the alignment field.
+// * @throws IllegalArgumentException if an argument in the
+// * <code>arguments</code> array is not of the type
+// * expected by the format element(s) that use it.
+// * @return the passed-in StringBuffer
+// * @stable ICU 3.8
+// */
+// public final StringBuffer format(Map<String, Object> arguments, StringBuffer result,
+// FieldPosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Creates a MessageFormat with the given pattern and uses it
return java.text.MessageFormat.format(pattern, arguments);
}
- /**
- * Creates a MessageFormat with the given pattern and uses it to
- * format the given arguments. The pattern must identifyarguments
- * by name instead of by number.
- * <p>
- * @throws IllegalArgumentException if the pattern is invalid,
- * or if an argument in the <code>arguments</code> map
- * is not of the type expected by the format element(s)
- * that use it.
- * @see #format(Map, StringBuffer, FieldPosition)
- * @see #format(String, Object[])
- * @stable ICU 3.8
- */
- public static String format(String pattern, Map<String, Object> arguments) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Creates a MessageFormat with the given pattern and uses it to
+// * format the given arguments. The pattern must identifyarguments
+// * by name instead of by number.
+// * <p>
+// * @throws IllegalArgumentException if the pattern is invalid,
+// * or if an argument in the <code>arguments</code> map
+// * is not of the type expected by the format element(s)
+// * that use it.
+// * @see #format(Map, StringBuffer, FieldPosition)
+// * @see #format(String, Object[])
+// * @stable ICU 3.8
+// */
+// public static String format(String pattern, Map<String, Object> arguments) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* {@icu} Returns true if this MessageFormat uses named arguments,
return messageFormat.parse(source, pos);
}
- /**
- * {@icu} Parses the string, returning the results in a Map.
- * This is similar to the version that returns an array
- * of Object. This supports both named and numbered
- * arguments-- if numbered, the keys in the map are the
- * corresponding Strings (e.g. "0", "1", "2"...).
- *
- * @param source the text to parse
- * @param pos the position at which to start parsing. on return,
- * contains the result of the parse.
- * @return a Map containing key/value pairs for each parsed argument.
- * @stable ICU 3.8
- */
- public Map<String, Object> parseToMap(String source, ParsePosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Parses the string, returning the results in a Map.
+// * This is similar to the version that returns an array
+// * of Object. This supports both named and numbered
+// * arguments-- if numbered, the keys in the map are the
+// * corresponding Strings (e.g. "0", "1", "2"...).
+// *
+// * @param source the text to parse
+// * @param pos the position at which to start parsing. on return,
+// * contains the result of the parse.
+// * @return a Map containing key/value pairs for each parsed argument.
+// * @stable ICU 3.8
+// */
+// public Map<String, Object> parseToMap(String source, ParsePosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Parses text from the beginning of the given string to produce an object
return messageFormat.parse(source);
}
- /**
- * {@icu} Parses text from the beginning of the given string to produce a map from
- * argument to values. The method may not use the entire text of the given string.
- *
- * <p>See the {@link #parse(String, ParsePosition)} method for more information on
- * message parsing.
- *
- * @param source A <code>String</code> whose beginning should be parsed.
- * @return A <code>Map</code> parsed from the string.
- * @throws ParseException if the beginning of the specified string cannot
- * be parsed.
- * @see #parseToMap(String, ParsePosition)
- * @stable ICU 3.8
- */
- public Map<String, Object> parseToMap(String source) throws ParseException {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Parses text from the beginning of the given string to produce a map from
+// * argument to values. The method may not use the entire text of the given string.
+// *
+// * <p>See the {@link #parse(String, ParsePosition)} method for more information on
+// * message parsing.
+// *
+// * @param source A <code>String</code> whose beginning should be parsed.
+// * @return A <code>Map</code> parsed from the string.
+// * @throws ParseException if the beginning of the specified string cannot
+// * be parsed.
+// * @see #parseToMap(String, ParsePosition)
+// * @stable ICU 3.8
+// */
+// public Map<String, Object> parseToMap(String source) throws ParseException {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Parses text from a string to produce an object array or Map.
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 1996-2012, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class MessagePattern {
- private MessagePattern() {}
-
- public enum ApostropheMode {
- /**
- * A literal apostrophe is represented by
- * either a single or a double apostrophe pattern character.
- * Within a MessageFormat pattern, a single apostrophe only starts quoted literal text
- * if it immediately precedes a curly brace {},
- * or a pipe symbol | if inside a choice format,
- * or a pound symbol # if inside a plural format.
- * <p>
- * This is the default behavior starting with ICU 4.8.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- DOUBLE_OPTIONAL,
- /**
- * A literal apostrophe must be represented by
- * a double apostrophe pattern character.
- * A single apostrophe always starts quoted literal text.
- * <p>
- * This is the behavior of ICU 4.6 and earlier, and of the JDK.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- DOUBLE_REQUIRED
- }
-}
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
import java.util.Set;
import com.ibm.icu.util.Currency;
-import com.ibm.icu.util.CurrencyAmount;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
return numberFormat.format(number.toBigDecimal());
}
- /**
- * {@icu} Convenience method to format a CurrencyAmount.
- * @stable ICU 3.0
- */
- public final String format(CurrencyAmount currAmt) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Convenience method to format a CurrencyAmount.
+// * @stable ICU 3.0
+// */
+// public final String format(CurrencyAmount currAmt) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Specialization of format.
return buf;
}
- /**
- * {@icu} Formats a CurrencyAmount. Specialization of format.
- * @see java.text.Format#format(Object, StringBuffer, FieldPosition)
- * @stable ICU 3.0
- */
- public StringBuffer format(CurrencyAmount currAmt,
- StringBuffer toAppendTo,
- FieldPosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Formats a CurrencyAmount. Specialization of format.
+// * @see java.text.Format#format(Object, StringBuffer, FieldPosition)
+// * @stable ICU 3.0
+// */
+// public StringBuffer format(CurrencyAmount currAmt,
+// StringBuffer toAppendTo,
+// FieldPosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns a Long if possible (e.g., within the range [Long.MIN_VALUE,
return numberFormat.parse(text);
}
- /**
- * Parses text from the given string as a CurrencyAmount. Unlike
- * the parse() method, this method will attempt to parse a generic
- * currency name, searching for a match of this object's locale's
- * currency display names, or for a 3-letter ISO currency code.
- * This method will fail if this format is not a currency format,
- * that is, if it does not contain the currency pattern symbol
- * (U+00A4) in its prefix or suffix.
- *
- * @param text the string to parse
- * @param pos input-output position; on input, the position within
- * text to match; must have 0 <= pos.getIndex() < text.length();
- * on output, the position after the last matched character. If
- * the parse fails, the position in unchanged upon output.
- * @return a CurrencyAmount, or null upon failure
- */
- CurrencyAmount parseCurrency(String text, ParsePosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Parses text from the given string as a CurrencyAmount. Unlike
+// * the parse() method, this method will attempt to parse a generic
+// * currency name, searching for a match of this object's locale's
+// * currency display names, or for a 3-letter ISO currency code.
+// * This method will fail if this format is not a currency format,
+// * that is, if it does not contain the currency pattern symbol
+// * (U+00A4) in its prefix or suffix.
+// *
+// * @param text the text to parse
+// * @param pos input-output position; on input, the position within
+// * text to match; must have 0 <= pos.getIndex() < text.length();
+// * on output, the position after the last matched character. If
+// * the parse fails, the position in unchanged upon output.
+// * @return a CurrencyAmount, or null upon failure
+// * @draft ICU 49
+// * @provisional This API might change or be removed in a future release.
+// */
+// public CurrencyAmount parseCurrency(CharSequence text, ParsePosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns true if this format will parse numbers as integers only.
numberFormat.setParseIntegerOnly(value);
}
- /**
- * {@icu} Sets whether strict parsing is in effect. When this is true, the
- * following conditions cause a parse failure (examples use the pattern "#,##0.#"):<ul>
- * <li>Leading zeros<br>
- * '00', '0123' fail the parse, but '0' and '0.001' pass</li>
- * <li>Leading or doubled grouping separators<br>
- * ',123' and '1,,234" fail</li>
- * <li>Groups of incorrect length when grouping is used<br>
- * '1,23' and '1234,567' fail, but '1234' passes</li>
- * <li>Grouping separators used in numbers followed by exponents<br>
- * '1,234E5' fails, but '1234E5' and '1,234E' pass ('E' is not an exponent when
- * not followed by a number)</li>
- * </ul>
- * When strict parsing is off, leading zeros and all grouping separators are ignored.
- * This is the default behavior.
- * @param value True to enable strict parsing. Default is false.
- * @see #isParseStrict
- * @stable ICU 3.6
- */
- public void setParseStrict(boolean value) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns whether strict parsing is in effect.
- * @return true if strict parsing is in effect
- * @see #setParseStrict
- * @stable ICU 3.6
- */
- public boolean isParseStrict() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Sets whether strict parsing is in effect. When this is true, the
+// * following conditions cause a parse failure (examples use the pattern "#,##0.#"):<ul>
+// * <li>Leading zeros<br>
+// * '00', '0123' fail the parse, but '0' and '0.001' pass</li>
+// * <li>Leading or doubled grouping separators<br>
+// * ',123' and '1,,234" fail</li>
+// * <li>Groups of incorrect length when grouping is used<br>
+// * '1,23' and '1234,567' fail, but '1234' passes</li>
+// * <li>Grouping separators used in numbers followed by exponents<br>
+// * '1,234E5' fails, but '1234E5' and '1,234E' pass ('E' is not an exponent when
+// * not followed by a number)</li>
+// * </ul>
+// * When strict parsing is off, leading zeros and all grouping separators are ignored.
+// * This is the default behavior.
+// * @param value True to enable strict parsing. Default is false.
+// * @see #isParseStrict
+// * @stable ICU 3.6
+// */
+// public void setParseStrict(boolean value) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns whether strict parsing is in effect.
+// * @return true if strict parsing is in effect
+// * @see #setParseStrict
+// * @stable ICU 3.6
+// */
+// public boolean isParseStrict() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
//============== Locale Stuff =====================
}
private static volatile ULocale[] availableULocales;
- /**
- * {@icu} Registers a new NumberFormatFactory. The factory is adopted by
- * the service and must not be modified. The returned object is a
- * key that can be used to unregister this factory.
- * @param factory the factory to register
- * @return a key with which to unregister the factory
- * @stable ICU 2.6
- */
- public static Object registerFactory(NumberFormatFactory factory) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Unregisters the factory or instance associated with this key (obtained from
- * registerInstance or registerFactory).
- * @param registryKey a key obtained from registerFactory
- * @return true if the object was successfully unregistered
- * @stable ICU 2.6
- */
- public static boolean unregister(Object registryKey) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Registers a new NumberFormatFactory. The factory is adopted by
+// * the service and must not be modified. The returned object is a
+// * key that can be used to unregister this factory.
+// * @param factory the factory to register
+// * @return a key with which to unregister the factory
+// * @stable ICU 2.6
+// */
+// public static Object registerFactory(NumberFormatFactory factory) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Unregisters the factory or instance associated with this key (obtained from
+// * registerInstance or registerFactory).
+// * @param registryKey a key obtained from registerFactory
+// * @return true if the object was successfully unregistered
+// * @stable ICU 2.6
+// */
+// public static boolean unregister(Object registryKey) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Overrides hashCode.
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class RawCollationKey {
- private RawCollationKey() {}
-}
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
this(pattern, loc.toLocale());
}
- /**
- * Constructs a SimpleDateFormat using the given pattern , override and locale.
- * @param pattern The pattern to be used
- * @param override The override string. A numbering system override string can take one of the following forms:
- * 1). If just a numbering system name is specified, it applies to all numeric fields in the date format pattern.
- * 2). To specify an alternate numbering system on a field by field basis, use the field letters from the pattern
- * followed by an = sign, followed by the numbering system name. For example, to specify that just the year
- * be formatted using Hebrew digits, use the override "y=hebr". Multiple overrides can be specified in a single
- * string by separating them with a semi-colon. For example, the override string "m=thai;y=deva" would format using
- * Thai digits for the month and Devanagari digits for the year.
- * @param loc The locale to be used
- * @stable ICU 4.2
- */
- public SimpleDateFormat(String pattern, String override, ULocale loc)
- {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Constructs a SimpleDateFormat using the given pattern , override and locale.
+// * @param pattern The pattern to be used
+// * @param override The override string. A numbering system override string can take one of the following forms:
+// * 1). If just a numbering system name is specified, it applies to all numeric fields in the date format pattern.
+// * 2). To specify an alternate numbering system on a field by field basis, use the field letters from the pattern
+// * followed by an = sign, followed by the numbering system name. For example, to specify that just the year
+// * be formatted using Hebrew digits, use the override "y=hebr". Multiple overrides can be specified in a single
+// * string by separating them with a semi-colon. For example, the override string "m=thai;y=deva" would format using
+// * Thai digits for the month and Devanagari digits for the year.
+// * @param loc The locale to be used
+// * @stable ICU 4.2
+// */
+// public SimpleDateFormat(String pattern, String override, ULocale loc)
+// {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Constructs a SimpleDateFormat using the given pattern and
((java.text.SimpleDateFormat)dateFormat).setDateFormatSymbols(newFormatSymbols.dfs);
}
+// /**
+// * {@icu} Gets the time zone formatter which this date/time
+// * formatter uses to format and parse a time zone.
+// *
+// * @return the time zone formatter which this date/time
+// * formatter uses.
+// * @draft ICU 49
+// * @provisional This API might change or be removed in a future release.
+// */
+// public TimeZoneFormat getTimeZoneFormat() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Allows you to set the time zone formatter.
+// *
+// * @param tzfmt the new time zone formatter
+// * @draft ICU 49
+// * @provisional This API might change or be removed in a future release.
+// */
+// public void setTimeZoneFormat(TimeZoneFormat tzfmt) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
// For clone to use
private SimpleDateFormat(java.text.SimpleDateFormat sdf) {
super(sdf);
/*
*******************************************************************************
- * Copyright (C) 2003-2011, International Business Machines Corporation and *
+ * Copyright (C) 2003-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
import java.text.Format;
-import com.ibm.icu.util.ULocale;
-
/**
* An abstract class that extends {@link java.text.Format} to provide
* additional ICU protocol, specifically, the <tt>getLocale()</tt>
*/
public UFormat() {}
- /**
- * 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) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * 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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
- /**
- * Set information about the locales that were used to create this
- * object. If the object was not constructed from locale data,
- * both arguments should be set to null. Otherwise, neither
- * should be null. The actual locale must be at the same level or
- * less specific than the valid locale. This method is intended
- * for use by factories or other entities that create objects of
- * this class.
- * @param valid the most specific locale containing any resource
- * data, or null
- * @param actual the locale containing data used to construct this
- * object, or null
- * @see com.ibm.icu.util.ULocale
- * @see com.ibm.icu.util.ULocale#VALID_LOCALE
- * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
- */
- final void setLocale(ULocale valid, ULocale actual) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Set information about the locales that were used to create this
+// * object. If the object was not constructed from locale data,
+// * both arguments should be set to null. Otherwise, neither
+// * should be null. The actual locale must be at the same level or
+// * less specific than the valid locale. This method is intended
+// * for use by factories or other entities that create objects of
+// * this class.
+// * @param valid the most specific locale containing any resource
+// * data, or null
+// * @param actual the locale containing data used to construct this
+// * object, or null
+// * @see com.ibm.icu.util.ULocale
+// * @see com.ibm.icu.util.ULocale#VALID_LOCALE
+// * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
+// */
+// final void setLocale(ULocale valid, ULocale actual) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
}
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.text;
-
-/*
- * Empty stub
- */
-public class UnicodeSet {
- private UnicodeSet() {}
-}
/*
-* Copyright (C) 1996-2011, International Business Machines
+* Copyright (C) 1996-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*/
*/
public final static int DST_OFFSET = 16;
- /**
- * {@icu} Field number for <code>get()</code> and <code>set()</code>
- * indicating the extended year corresponding to the
- * {@link #WEEK_OF_YEAR} field. This may be one greater or less
- * than the value of {@link #EXTENDED_YEAR}.
- * @stable ICU 2.0
- */
- public static final int YEAR_WOY = 17;
-
- /**
- * {@icu} Field number for <code>get()</code> and <code>set()</code>
- * indicating the localized day of week. This will be a value from 1
- * to 7 inclusive, with 1 being the localized first day of the week.
- * @stable ICU 2.0
- */
- public static final int DOW_LOCAL = 18;
-
- /**
- * {@icu} Field number for <code>get()</code> and <code>set()</code>
- * indicating the extended year. This is a single number designating
- * the year of this calendar system, encompassing all supra-year
- * fields. For example, for the Julian calendar system, year numbers
- * are positive, with an era of BCE or CE. An extended year value for
- * the Julian calendar system assigns positive values to CE years and
- * negative values to BCE years, with 1 BCE being year 0.
- * @stable ICU 2.0
- */
- public static final int EXTENDED_YEAR = 19;
-
- /**
- * {@icu} Field number for <code>get()</code> and <code>set()</code>
- * indicating the modified Julian day number. This is different from
- * the conventional Julian day number in two regards. First, it
- * demarcates days at local zone midnight, rather than noon GMT.
- * Second, it is a local number; that is, it depends on the local time
- * zone. It can be thought of as a single number that encompasses all
- * the date-related fields.
- * @stable ICU 2.0
- */
- public static final int JULIAN_DAY = 20;
-
- /**
- * {@icu} Field number for <code>get()</code> and <code>set()</code>
- * indicating the milliseconds in the day. This ranges from 0 to
- * 23:59:59.999 (regardless of DST). This field behaves
- * <em>exactly</em> like a composite of all time-related fields, not
- * including the zone fields. As such, it also reflects
- * discontinuities of those fields on DST transition days. On a day of
- * DST onset, it will jump forward. On a day of DST cessation, it will
- * jump backward. This reflects the fact that is must be combined with
- * the DST_OFFSET field to obtain a unique local time value.
- * @stable ICU 2.0
- */
- public static final int MILLISECONDS_IN_DAY = 21;
-
- /**
- * {@icu} Field indicating whether or not the current month is a leap month.
- * Should have a value of 0 for non-leap months, and 1 for leap months.
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int IS_LEAP_MONTH = 22;
+// /**
+// * {@icu} Field number for <code>get()</code> and <code>set()</code>
+// * indicating the extended year corresponding to the
+// * {@link #WEEK_OF_YEAR} field. This may be one greater or less
+// * than the value of {@link #EXTENDED_YEAR}.
+// * @stable ICU 2.0
+// */
+// public static final int YEAR_WOY = 17;
+//
+// /**
+// * {@icu} Field number for <code>get()</code> and <code>set()</code>
+// * indicating the localized day of week. This will be a value from 1
+// * to 7 inclusive, with 1 being the localized first day of the week.
+// * @stable ICU 2.0
+// */
+// public static final int DOW_LOCAL = 18;
+//
+// /**
+// * {@icu} Field number for <code>get()</code> and <code>set()</code>
+// * indicating the extended year. This is a single number designating
+// * the year of this calendar system, encompassing all supra-year
+// * fields. For example, for the Julian calendar system, year numbers
+// * are positive, with an era of BCE or CE. An extended year value for
+// * the Julian calendar system assigns positive values to CE years and
+// * negative values to BCE years, with 1 BCE being year 0.
+// * @stable ICU 2.0
+// */
+// public static final int EXTENDED_YEAR = 19;
+//
+// /**
+// * {@icu} Field number for <code>get()</code> and <code>set()</code>
+// * indicating the modified Julian day number. This is different from
+// * the conventional Julian day number in two regards. First, it
+// * demarcates days at local zone midnight, rather than noon GMT.
+// * Second, it is a local number; that is, it depends on the local time
+// * zone. It can be thought of as a single number that encompasses all
+// * the date-related fields.
+// * @stable ICU 2.0
+// */
+// public static final int JULIAN_DAY = 20;
+//
+// /**
+// * {@icu} Field number for <code>get()</code> and <code>set()</code>
+// * indicating the milliseconds in the day. This ranges from 0 to
+// * 23:59:59.999 (regardless of DST). This field behaves
+// * <em>exactly</em> like a composite of all time-related fields, not
+// * including the zone fields. As such, it also reflects
+// * discontinuities of those fields on DST transition days. On a day of
+// * DST onset, it will jump forward. On a day of DST cessation, it will
+// * jump backward. This reflects the fact that is must be combined with
+// * the DST_OFFSET field to obtain a unique local time value.
+// * @stable ICU 2.0
+// */
+// public static final int MILLISECONDS_IN_DAY = 21;
+//
+// /**
+// * {@icu} Field indicating whether or not the current month is a leap month.
+// * Should have a value of 0 for non-leap months, and 1 for leap months.
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int IS_LEAP_MONTH = 22;
/**
* Value of the <code>DAY_OF_WEEK</code> field indicating
*/
public static final int WEEKEND_CEASE = 3;
+ /**
+ * {@icu}Option used by {@link #setRepeatedWallTimeOption(int)} and
+ * {@link #setSkippedWallTimeOption(int)} specifying an ambiguous wall time
+ * to be interpreted as the latest.
+ * @see #setRepeatedWallTimeOption(int)
+ * @see #getRepeatedWallTimeOption()
+ * @see #setSkippedWallTimeOption(int)
+ * @see #getSkippedWallTimeOption()
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final int WALLTIME_LAST = 0;
+
+ /**
+ * {@icu}Option used by {@link #setRepeatedWallTimeOption(int)} and
+ * {@link #setSkippedWallTimeOption(int)} specifying an ambiguous wall time
+ * to be interpreted as the earliest.
+ * @see #setRepeatedWallTimeOption(int)
+ * @see #getRepeatedWallTimeOption()
+ * @see #setSkippedWallTimeOption(int)
+ * @see #getSkippedWallTimeOption()
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final int WALLTIME_FIRST = 1;
+
+ /**
+ * {@icu}Option used by {@link #setSkippedWallTimeOption(int)} specifying an
+ * ambiguous wall time to be interpreted as the next valid wall time.
+ * @see #setSkippedWallTimeOption(int)
+ * @see #getSkippedWallTimeOption()
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static final int WALLTIME_NEXT_VALID = 2;
+
/**
* Constructs a Calendar with the default time zone
* and locale.
}
private static volatile ULocale[] availableLocales;
- /**
- * {@icu} Given a key and a locale, returns an array of string values in a preferred
- * order that would make a difference. These are all and only those values where
- * the open (creation) of the service with the locale formed from the input locale
- * plus input keyword and that value has different behavior than creation with the
- * input locale alone.
- * @param key one of the keys supported by this service. For now, only
- * "calendar" is supported.
- * @param locale the locale
- * @param commonlyUsed if set to true it will return only commonly used values
- * with the given locale in preferred order. Otherwise,
- * it will return all the available values for the locale.
- * @return an array of string values for the given key and the locale.
- * @stable ICU 4.2
- */
- public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
- boolean commonlyUsed) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Given a key and a locale, returns an array of string values in a preferred
+// * order that would make a difference. These are all and only those values where
+// * the open (creation) of the service with the locale formed from the input locale
+// * plus input keyword and that value has different behavior than creation with the
+// * input locale alone.
+// * @param key one of the keys supported by this service. For now, only
+// * "calendar" is supported.
+// * @param locale the locale
+// * @param commonlyUsed if set to true it will return only commonly used values
+// * with the given locale in preferred order. Otherwise,
+// * it will return all the available values for the locale.
+// * @return an array of string values for the given key and the locale.
+// * @stable ICU 4.2
+// */
+// public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
+// boolean commonlyUsed) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns this Calendar's current time.
return calendar.isLenient();
}
+// /**
+// * {@icu}Sets the behavior for handling wall time repeating multiple times
+// * at negative time zone offset transitions. For example, 1:30 AM on
+// * November 6, 2011 in US Eastern time (Ameirca/New_York) occurs twice;
+// * 1:30 AM EDT, then 1:30 AM EST one hour later. When <code>WALLTIME_FIRST</code>
+// * is used, the wall time 1:30AM in this example will be interpreted as 1:30 AM EDT
+// * (first occurrence). When <code>WALLTIME_LAST</code> is used, it will be
+// * interpreted as 1:30 AM EST (last occurrence). The default value is
+// * <code>WALLTIME_LAST</code>.
+// *
+// * @param option the behavior for handling repeating wall time, either
+// * <code>WALLTIME_FIRST</code> or <code>WALLTIME_LAST</code>.
+// * @throws IllegalArgumentException when <code>option</code> is neither
+// * <code>WALLTIME_FIRST</code> nor <code>WALLTIME_LAST</code>.
+// *
+// * @see #getRepeatedWallTimeOption()
+// * @see #WALLTIME_FIRST
+// * @see #WALLTIME_LAST
+// *
+// * @draft ICU 49
+// * @provisional This API might change or be removed in a future release.
+// */
+// public void setRepeatedWallTimeOption(int option) {
+// if (option != WALLTIME_LAST) {
+// throw new UnsupportedOperationException("The option not supported by com.ibm.icu.base");
+// }
+// }
+
+ /**
+ * {@icu}Gets the behavior for handling wall time repeating multiple times
+ * at negative time zone offset transitions.
+ *
+ * @return the behavior for handling repeating wall time, either
+ * <code>WALLTIME_FIRST</code> or <code>WALLTIME_LAST</code>.
+ *
+ * @see #setRepeatedWallTimeOption(int)
+ * @see #WALLTIME_FIRST
+ * @see #WALLTIME_LAST
+ *
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public int getRepeatedWallTimeOption() {
+ return WALLTIME_LAST;
+ }
+
+// /**
+// * {@icu}Sets the behavior for handling skipped wall time at positive time zone offset
+// * transitions. For example, 2:30 AM on March 13, 2011 in US Eastern time (America/New_York)
+// * does not exist because the wall time jump from 1:59 AM EST to 3:00 AM EDT. When
+// * <code>WALLTIME_FIRST</code> is used, 2:30 AM is interpreted as 30 minutes before 3:00 AM
+// * EDT, therefore, it will be resolved as 1:30 AM EST. When <code>WALLTIME_LAST</code>
+// * is used, 2:30 AM is interpreted as 31 minutes after 1:59 AM EST, therefore, it will be
+// * resolved as 3:30 AM EDT. When <code>WALLTIME_NEXT_VALID</code> is used, 2:30 AM will
+// * be resolved as next valid wall time, that is 3:00 AM EDT. The default value is
+// * <code>WALLTIME_LAST</code>.
+// * <p>
+// * <b>Note:</b>This option is effective only when this calendar is {@link #isLenient() lenient}.
+// * When the calendar is strict, such non-existing wall time will cause an exception.
+// *
+// * @param option the behavior for handling skipped wall time at positive time zone
+// * offset transitions, one of <code>WALLTIME_FIRST</code>, <code>WALLTIME_LAST</code> and
+// * <code>WALLTIME_NEXT_VALID</code>.
+// * @throws IllegalArgumentException when <code>option</code> is not any of
+// * <code>WALLTIME_FIRST</code>, <code>WALLTIME_LAST</code> and <code>WALLTIME_NEXT_VALID</code>.
+// *
+// * @see #getSkippedWallTimeOption()
+// * @see #WALLTIME_FIRST
+// * @see #WALLTIME_LAST
+// * @see #WALLTIME_NEXT_VALID
+// *
+// * @draft ICU 49
+// * @provisional This API might change or be removed in a future release.
+// */
+// public void setSkippedWallTimeOption(int option) {
+// if (option != WALLTIME_LAST) {
+// throw new UnsupportedOperationException("The option not supported by com.ibm.icu.base");
+// }
+// }
+
+ /**
+ * {@icu}Gets the behavior for handling skipped wall time at positive time zone offset
+ * transitions.
+ *
+ * @return the behavior for handling skipped wall time, one of
+ * <code>WALLTIME_FIRST</code>, <code>WALLTIME_LAST</code> and <code>WALLTIME_NEXT_VALID</code>.
+ *
+ * @see #setSkippedWallTimeOption(int)
+ * @see #WALLTIME_FIRST
+ * @see #WALLTIME_LAST
+ * @see #WALLTIME_NEXT_VALID
+ *
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public int getSkippedWallTimeOption() {
+ return WALLTIME_LAST;
+ }
+
/**
* Sets what the first day of the week is; e.g., Sunday in US,
* Monday in France.
}
return WEEKDAY;}
- /**
- * {@icu} Returns the time during the day at which the weekend begins or end in this
- * calendar system. If getDayOfWeekType(dayOfWeek) == WEEKEND_ONSET return the time
- * at which the weekend begins. If getDayOfWeekType(dayOfWeek) == WEEKEND_CEASE
- * return the time at which the weekend ends. If getDayOfWeekType(dayOfWeek) has some
- * other value, then throw an exception.
- * @param dayOfWeek either SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
- * THURSDAY, FRIDAY, or SATURDAY
- * @return the milliseconds after midnight at which the
- * weekend begins or ends
- * @exception IllegalArgumentException if dayOfWeek is not
- * WEEKEND_ONSET or WEEKEND_CEASE
- * @see #getDayOfWeekType
- * @see #isWeekend(Date)
- * @see #isWeekend()
- * @stable ICU 2.0
- */
- public int getWeekendTransition(int dayOfWeek) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the time during the day at which the weekend begins or end in this
+// * calendar system. If getDayOfWeekType(dayOfWeek) == WEEKEND_ONSET return the time
+// * at which the weekend begins. If getDayOfWeekType(dayOfWeek) == WEEKEND_CEASE
+// * return the time at which the weekend ends. If getDayOfWeekType(dayOfWeek) has some
+// * other value, then throw an exception.
+// * @param dayOfWeek either SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
+// * THURSDAY, FRIDAY, or SATURDAY
+// * @return the milliseconds after midnight at which the
+// * weekend begins or ends
+// * @exception IllegalArgumentException if dayOfWeek is not
+// * WEEKEND_ONSET or WEEKEND_CEASE
+// * @see #getDayOfWeekType
+// * @see #isWeekend(Date)
+// * @see #isWeekend()
+// * @stable ICU 2.0
+// */
+// public int getWeekendTransition(int dayOfWeek) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* {@icu} Returns true if the given date and time is in the weekend in this calendar
public final int getFieldCount() {
return FIELD_COUNT;
}
- private static final int FIELD_COUNT = IS_LEAP_MONTH + 1;
+
+ private static final int FIELD_COUNT = /* IS_LEAP_MONTH */ DST_OFFSET + 1;
/**
* {@icu} Returns the current Calendar type. Note, in 3.0 this function will return
// -------- BEGIN ULocale boilerplate --------
- /**
- * {@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.
- * @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) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@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.
+// * @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) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
// -------- END ULocale boilerplate --------
case DST_OFFSET:
return java.util.Calendar.DST_OFFSET;
- case YEAR_WOY:
- case DOW_LOCAL:
- case EXTENDED_YEAR:
- case JULIAN_DAY:
- case MILLISECONDS_IN_DAY:
- // Unmappable
- throw new UnsupportedOperationException("Calendar field type not supported by com.ibm.icu.base");
+// case YEAR_WOY:
+// case DOW_LOCAL:
+// case EXTENDED_YEAR:
+// case JULIAN_DAY:
+// case MILLISECONDS_IN_DAY:
+// // Unmappable
+// throw new UnsupportedOperationException("Calendar field type not supported by com.ibm.icu.base");
default:
// Illegal
throw new ArrayIndexOutOfBoundsException("Specified calendar field is out of range");
package com.ibm.icu.util;
import java.io.Serializable;
-import java.text.ParsePosition;
-import java.util.Date;
import java.util.Locale;
import com.ibm.icu.util.ULocale.Category;
return new Currency(java.util.Currency.getInstance(locale.toLocale()));
}
- /**
- * Returns an array of Strings which contain the currency
- * identifiers that are valid for the given locale on the
- * given date. If there are no such identifiers, returns null.
- * Returned identifiers are in preference order.
- * @param loc the locale for which to retrieve currency codes.
- * @param d the date for which to retrieve currency codes for the given locale.
- * @return The array of ISO currency codes.
- * @stable ICU 4.0
- */
- public static String[] getAvailableCurrencyCodes(ULocale loc, Date d) {
- throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
- }
+// /**
+// * Returns an array of Strings which contain the currency
+// * identifiers that are valid for the given locale on the
+// * given date. If there are no such identifiers, returns null.
+// * Returned identifiers are in preference order.
+// * @param loc the locale for which to retrieve currency codes.
+// * @param d the date for which to retrieve currency codes for the given locale.
+// * @return The array of ISO currency codes.
+// * @stable ICU 4.0
+// */
+// public static String[] getAvailableCurrencyCodes(ULocale loc, Date d) {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the set of available currencies. The returned set of currencies contains all of the
+// * available currencies, including obsolete ones. The result set can be modified without
+// * affecting the available currencies in the runtime.
+// *
+// * @return The set of available currencies. The returned set could be empty if there is no
+// * currency data available.
+// *
+// * @stable ICU 49
+// */
+// public static Set<Currency> getAvailableCurrencies() {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
/**
* Returns a currency object given an ISO 4217 3-letter code.
return new Currency(java.util.Currency.getInstance(theISOCode));
}
- /**
- * Registers a new currency for the provided locale. The returned object
- * is a key that can be used to unregister this currency object.
- * @param currency the currency to register
- * @param locale the ulocale under which to register the currency
- * @return a registry key that can be used to unregister this currency
- * @see #unregister
- * @stable ICU 3.2
- */
- public static Object registerInstance(Currency currency, ULocale locale) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Unregister the currency associated with this key (obtained from
- * registerInstance).
- * @param registryKey the registry key returned from registerInstance
- * @see #registerInstance
- * @stable ICU 2.6
- */
- public static boolean unregister(Object registryKey) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Return an array of the locales for which a currency
- * is defined.
- * @return an array of the available locales
- * @stable ICU 2.2
- */
- public static Locale[] getAvailableLocales() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Return an array of the ulocales for which a currency
- * is defined.
- * @return an array of the available ulocales
- * @stable ICU 3.2
- */
- public static ULocale[] getAvailableULocales() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Given a key and a locale, returns an array of values for the key for which data
- * exists. If commonlyUsed is true, these are the values that typically are used
- * with this locale, otherwise these are all values for which data exists.
- * This is a common service API.
- * <p>
- * The only supported key is "currency", other values return an empty array.
- * <p>
- * Currency information is based on the region of the locale. If the locale does not
- * indicate a region, {@link ULocale#addLikelySubtags(ULocale)} is used to infer a region,
- * except for the 'und' locale.
- * <p>
- * If commonlyUsed is true, only the currencies known to be in use as of the current date
- * are returned. When there are more than one, these are returned in preference order
- * (typically, this occurs when a country is transitioning to a new currency, and the
- * newer currency is preferred), see
- * <a href="http://unicode.org/reports/tr35/#Supplemental_Currency_Data">Unicode TR#35 Sec. C1</a>.
- * If commonlyUsed is false, all currencies ever used in any locale are returned, in no
- * particular order.
- *
- * @param key key whose values to look up. the only recognized key is "currency"
- * @param locale the locale
- * @param commonlyUsed if true, return only values that are currently used in the locale.
- * Otherwise returns all values.
- * @return an array of values for the given key and the locale. If there is no data, the
- * array will be empty.
- * @stable ICU 4.2
- */
- public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
- boolean commonlyUsed) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Registers a new currency for the provided locale. The returned object
+// * is a key that can be used to unregister this currency object.
+// * @param currency the currency to register
+// * @param locale the ulocale under which to register the currency
+// * @return a registry key that can be used to unregister this currency
+// * @see #unregister
+// * @stable ICU 3.2
+// */
+// public static Object registerInstance(Currency currency, ULocale locale) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Unregister the currency associated with this key (obtained from
+// * registerInstance).
+// * @param registryKey the registry key returned from registerInstance
+// * @see #registerInstance
+// * @stable ICU 2.6
+// */
+// public static boolean unregister(Object registryKey) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Return an array of the locales for which a currency
+// * is defined.
+// * @return an array of the available locales
+// * @stable ICU 2.2
+// */
+// public static Locale[] getAvailableLocales() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Return an array of the ulocales for which a currency
+// * is defined.
+// * @return an array of the available ulocales
+// * @stable ICU 3.2
+// */
+// public static ULocale[] getAvailableULocales() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Given a key and a locale, returns an array of values for the key for which data
+// * exists. If commonlyUsed is true, these are the values that typically are used
+// * with this locale, otherwise these are all values for which data exists.
+// * This is a common service API.
+// * <p>
+// * The only supported key is "currency", other values return an empty array.
+// * <p>
+// * Currency information is based on the region of the locale. If the locale does not
+// * indicate a region, {@link ULocale#addLikelySubtags(ULocale)} is used to infer a region,
+// * except for the 'und' locale.
+// * <p>
+// * If commonlyUsed is true, only the currencies known to be in use as of the current date
+// * are returned. When there are more than one, these are returned in preference order
+// * (typically, this occurs when a country is transitioning to a new currency, and the
+// * newer currency is preferred), see
+// * <a href="http://unicode.org/reports/tr35/#Supplemental_Currency_Data">Unicode TR#35 Sec. C1</a>.
+// * If commonlyUsed is false, all currencies ever used in any locale are returned, in no
+// * particular order.
+// *
+// * @param key key whose values to look up. the only recognized key is "currency"
+// * @param locale the locale
+// * @param commonlyUsed if true, return only values that are currently used in the locale.
+// * Otherwise returns all values.
+// * @return an array of values for the given key and the locale. If there is no data, the
+// * array will be empty.
+// * @stable ICU 4.2
+// */
+// public static final String[] getKeywordValuesForLocale(String key, ULocale locale,
+// boolean commonlyUsed) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Return a hashcode for this currency.
return currency.getCurrencyCode();
}
+// /**
+// * Returns the ISO 4217 numeric code for this currency object.
+// * <p>Note: If the ISO 4217 numeric code is not assigned for the currency or
+// * the currency is unknown, this method returns 0.</p>
+// * @return The ISO 4217 numeric code of this currency.
+// * @stable ICU 49
+// */
+// public int getNumericCode() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
/**
* Convenience and compatibility override of getName that
* requests the symbol name.
return currency.getSymbol(uloc.toLocale());
}
- /**
- * Returns the display name for the given currency in the
- * given locale.
- * This is a convenient method for
- * getName(ULocale, int, boolean[]);
- * @stable ICU 3.2
- */
- public String getName(Locale locale,
- int nameStyle,
- boolean[] isChoiceFormat) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the display name for the given currency in the
- * given locale. For example, the display name for the USD
- * currency object in the en_US locale is "$".
- * @param locale locale in which to display currency
- * @param nameStyle selector for which kind of name to return.
- * The nameStyle should be either SYMBOL_NAME or
- * LONG_NAME. Otherwise, throw IllegalArgumentException.
- * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
- * if the returned value is a ChoiceFormat pattern; otherwise it
- * is set to false
- * @return display string for this currency. If the resource data
- * contains no entry for this currency, then the ISO 4217 code is
- * returned. If isChoiceFormat[0] is true, then the result is a
- * ChoiceFormat pattern. Otherwise it is a static string. <b>Note:</b>
- * as of ICU 4.4, choice formats are not used, and the value returned
- * in isChoiceFormat is always false.
- * <p>
- * @throws IllegalArgumentException if the nameStyle is not SYMBOL_NAME
- * or LONG_NAME.
- * @see #getName(ULocale, int, String, boolean[])
- * @stable ICU 3.2
- */
- public String getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the display name for the given currency in the given locale.
- * This is a convenience overload of getName(ULocale, int, String, boolean[]);
- * @stable ICU 4.2
- */
- public String getName(Locale locale, int nameStyle, String pluralCount,
- boolean[] isChoiceFormat) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Returns the display name for the given currency in the
- * given locale. For example, the SYMBOL_NAME for the USD
- * currency object in the en_US locale is "$".
- * The PLURAL_LONG_NAME for the USD currency object when the currency
- * amount is plural is "US dollars", such as in "3.00 US dollars";
- * while the PLURAL_LONG_NAME for the USD currency object when the currency
- * amount is singular is "US dollar", such as in "1.00 US dollar".
- * @param locale locale in which to display currency
- * @param nameStyle selector for which kind of name to return
- * @param pluralCount plural count string for this locale
- * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
- * if the returned value is a ChoiceFormat pattern; otherwise it
- * is set to false
- * @return display string for this currency. If the resource data
- * contains no entry for this currency, then the ISO 4217 code is
- * returned. If isChoiceFormat[0] is true, then the result is a
- * ChoiceFormat pattern. Otherwise it is a static string. <b>Note:</b>
- * as of ICU 4.4, choice formats are not used, and the value returned
- * in isChoiceFormat is always false.
- * @throws IllegalArgumentException if the nameStyle is not SYMBOL_NAME,
- * LONG_NAME, or PLURAL_LONG_NAME.
- * @stable ICU 4.2
- */
- public String getName(ULocale locale, int nameStyle, String pluralCount,
- boolean[] isChoiceFormat) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Attempt to parse the given string as a currency, either as a
- * display name in the given locale, or as a 3-letter ISO 4217
- * code. If multiple display names match, then the longest one is
- * selected. If both a display name and a 3-letter ISO code
- * match, then the display name is preferred, unless it's length
- * is less than 3.
- *
- * @param locale the locale of the display names to match
- * @param text the text to parse
- * @param type parse against currency type: LONG_NAME only or not
- * @param pos input-output position; on input, the position within
- * text to match; must have 0 <= pos.getIndex() < text.length();
- * on output, the position after the last matched character. If
- * the parse fails, the position in unchanged upon output.
- * @return the ISO 4217 code, as a string, of the best match, or
- * null if there is no match
- *
- * @internal
- * @deprecated This API is ICU internal only.
- */
- public static String parse(ULocale locale, String text, int type, ParsePosition pos) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Returns the display name for the given currency in the
+// * given locale.
+// * This is a convenient method for
+// * getName(ULocale, int, boolean[]);
+// * @stable ICU 3.2
+// */
+// public String getName(Locale locale,
+// int nameStyle,
+// boolean[] isChoiceFormat) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the display name for the given currency in the
+// * given locale. For example, the display name for the USD
+// * currency object in the en_US locale is "$".
+// * @param locale locale in which to display currency
+// * @param nameStyle selector for which kind of name to return.
+// * The nameStyle should be either SYMBOL_NAME or
+// * LONG_NAME. Otherwise, throw IllegalArgumentException.
+// * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
+// * if the returned value is a ChoiceFormat pattern; otherwise it
+// * is set to false
+// * @return display string for this currency. If the resource data
+// * contains no entry for this currency, then the ISO 4217 code is
+// * returned. If isChoiceFormat[0] is true, then the result is a
+// * ChoiceFormat pattern. Otherwise it is a static string. <b>Note:</b>
+// * as of ICU 4.4, choice formats are not used, and the value returned
+// * in isChoiceFormat is always false.
+// * <p>
+// * @throws IllegalArgumentException if the nameStyle is not SYMBOL_NAME
+// * or LONG_NAME.
+// * @see #getName(ULocale, int, String, boolean[])
+// * @stable ICU 3.2
+// */
+// public String getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the display name for the given currency in the given locale.
+// * This is a convenience overload of getName(ULocale, int, String, boolean[]);
+// * @stable ICU 4.2
+// */
+// public String getName(Locale locale, int nameStyle, String pluralCount,
+// boolean[] isChoiceFormat) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the display name for this currency in the default locale.
+// * If the resource data for the default locale contains no entry for this currency,
+// * then the ISO 4217 code is returned.
+// * <p>
+// * Note: This method was added for JDK compatibility support and equivalent to
+// * <code>getName(Locale.getDefault(), LONG_NAME, null)</code>.
+// *
+// * @return The display name of this currency
+// * @see #getDisplayName(Locale)
+// * @see #getName(Locale, int, boolean[])
+// * @stable ICU 49
+// */
+// public String getDisplayName() {
+// //return getName(Locale.getDefault(), LONG_NAME, null);
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the display name for this currency in the given locale.
+// * If the resource data for the given locale contains no entry for this currency,
+// * then the ISO 4217 code is returned.
+// * <p>
+// * Note: This method was added for JDK compatibility support and equivalent to
+// * <code>getName(locale, LONG_NAME, null)</code>.
+// *
+// * @param locale locale in which to display currency
+// * @return The display name of this currency for the specified locale
+// * @see #getDisplayName(Locale)
+// * @see #getName(Locale, int, boolean[])
+// * @stable ICU 49
+// */
+// public String getDisplayName(Locale locale) {
+// //return getName(locale, LONG_NAME, null);
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Returns the display name for the given currency in the
+// * given locale. For example, the SYMBOL_NAME for the USD
+// * currency object in the en_US locale is "$".
+// * The PLURAL_LONG_NAME for the USD currency object when the currency
+// * amount is plural is "US dollars", such as in "3.00 US dollars";
+// * while the PLURAL_LONG_NAME for the USD currency object when the currency
+// * amount is singular is "US dollar", such as in "1.00 US dollar".
+// * @param locale locale in which to display currency
+// * @param nameStyle selector for which kind of name to return
+// * @param pluralCount plural count string for this locale
+// * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
+// * if the returned value is a ChoiceFormat pattern; otherwise it
+// * is set to false
+// * @return display string for this currency. If the resource data
+// * contains no entry for this currency, then the ISO 4217 code is
+// * returned. If isChoiceFormat[0] is true, then the result is a
+// * ChoiceFormat pattern. Otherwise it is a static string. <b>Note:</b>
+// * as of ICU 4.4, choice formats are not used, and the value returned
+// * in isChoiceFormat is always false.
+// * @throws IllegalArgumentException if the nameStyle is not SYMBOL_NAME,
+// * LONG_NAME, or PLURAL_LONG_NAME.
+// * @stable ICU 4.2
+// */
+// public String getName(ULocale locale, int nameStyle, String pluralCount,
+// boolean[] isChoiceFormat) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Attempt to parse the given string as a currency, either as a
+// * display name in the given locale, or as a 3-letter ISO 4217
+// * code. If multiple display names match, then the longest one is
+// * selected. If both a display name and a 3-letter ISO code
+// * match, then the display name is preferred, unless it's length
+// * is less than 3.
+// *
+// * @param locale the locale of the display names to match
+// * @param text the text to parse
+// * @param type parse against currency type: LONG_NAME only or not
+// * @param pos input-output position; on input, the position within
+// * text to match; must have 0 <= pos.getIndex() < text.length();
+// * on output, the position after the last matched character. If
+// * the parse fails, the position in unchanged upon output.
+// * @return the ISO 4217 code, as a string, of the best match, or
+// * null if there is no match
+// *
+// * @internal
+// * @deprecated This API is ICU internal only.
+// */
+// public static String parse(ULocale locale, String text, int type, ParsePosition pos) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns the number of the number of fraction digits that should
return currency.getDefaultFractionDigits();
}
- /**
- * Returns the rounding increment for this currency, or 0.0 if no
- * rounding is done by this currency.
- * @return the non-negative rounding increment, or 0.0 if none
- * @stable ICU 2.2
- */
- public double getRoundingIncrement() {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Returns the rounding increment for this currency, or 0.0 if no
+// * rounding is done by this currency.
+// * @return the non-negative rounding increment, or 0.0 if none
+// * @stable ICU 2.2
+// */
+// public double getRoundingIncrement() {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Returns the ISO 4217 code for this currency.
return currency.toString();
}
- /**
- * 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 obsoleted. The implementation is
- * no longer locale-specific and so there is no longer a valid or
- * actual locale associated with the Currency object. Until
- * it is removed, this method will return the root locale.
- * @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
- * @obsolete ICU 3.2 to be removed
- * @deprecated This API is obsolete.
- */
- public final ULocale getLocale(ULocale.Type type) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
-
- /**
- * Queries if the given ISO 4217 3-letter code is available on the specified date range.
- * <p>
- * Note: For checking availability of a currency on a specific date, specify the date on both <code>from</code> and
- * <code>to</code>. When both <code>from</code> and <code>to</code> are null, this method checks if the specified
- * currency is available all time.
- *
- * @param code
- * The ISO 4217 3-letter code.
- * @param from
- * The lower bound of the date range, inclusive. When <code>from</code> is null, check the availability
- * of the currency any date before <code>to</code>
- * @param to
- * The upper bound of the date range, inclusive. When <code>to</code> is null, check the availability of
- * the currency any date after <code>from</code>
- * @return true if the given ISO 4217 3-letter code is supported on the specified date range.
- * @throws IllegalArgumentException when <code>to</code> is before <code>from</code>.
- *
- * @draft ICU 4.6
- * @provisional This API might change or be removed in a future release.
- */
- public static boolean isAvailable(String code, Date from, Date to) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * 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 obsoleted. The implementation is
+// * no longer locale-specific and so there is no longer a valid or
+// * actual locale associated with the Currency object. Until
+// * it is removed, this method will return the root locale.
+// * @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
+// * @obsolete ICU 3.2 to be removed
+// * @deprecated This API is obsolete.
+// */
+// public final ULocale getLocale(ULocale.Type type) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
+
+// /**
+// * Queries if the given ISO 4217 3-letter code is available on the specified date range.
+// * <p>
+// * Note: For checking availability of a currency on a specific date, specify the date on both <code>from</code> and
+// * <code>to</code>. When both <code>from</code> and <code>to</code> are null, this method checks if the specified
+// * currency is available all time.
+// *
+// * @param code
+// * The ISO 4217 3-letter code.
+// * @param from
+// * The lower bound of the date range, inclusive. When <code>from</code> is null, check the availability
+// * of the currency any date before <code>to</code>
+// * @param to
+// * The upper bound of the date range, inclusive. When <code>to</code> is null, check the availability of
+// * the currency any date after <code>from</code>
+// * @return true if the given ISO 4217 3-letter code is supported on the specified date range.
+// * @throws IllegalArgumentException when <code>to</code> is before <code>from</code>.
+// *
+// * @draft ICU 4.6
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static boolean isAvailable(String code, Date from, Date to) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
}
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.util;
-
-/*
- * Empty stub
- */
-public class CurrencyAmount {
- private CurrencyAmount() {}
-}
--- /dev/null
+/*
+ ******************************************************************************
+ * Copyright (C) 2005-2012, International Business Machines Corporation and *
+ * others. All Rights Reserved. *
+ ******************************************************************************
+*/
+package com.ibm.icu.util;
+
+/**
+ * Provides a flexible mechanism for controlling access, without requiring that
+ * a class be immutable. Once frozen, an object can never be unfrozen, so it is
+ * thread-safe from that point onward. Once the object has been frozen,
+ * it must guarantee that no changes can be made to it. Any attempt to alter
+ * it must raise an UnsupportedOperationException exception. This means that when
+ * the object returns internal objects, or if anyone has references to those internal
+ * objects, that those internal objects must either be immutable, or must also
+ * raise exceptions if any attempt to modify them is made. Of course, the object
+ * can return clones of internal objects, since those are safe.
+ * <h2>Background</h2>
+ * <p>
+ * There are often times when you need objects to be objects 'safe', so that
+ * they can't be modified. Examples are when objects need to be thread-safe, or
+ * in writing robust code, or in caches. If you are only creating your own
+ * objects, you can guarantee this, of course -- but only if you don't make a
+ * mistake. If you have objects handed into you, or are creating objects using
+ * others handed into you, it is a different story. It all comes down to whether
+ * you want to take the Blanche Dubois approach ("depend on the kindness of
+ * strangers") or the Andy Grove approach ("Only the Paranoid
+ * Survive").
+ * </p>
+ * <p>
+ * For example, suppose we have a simple class:
+ * </p>
+ *
+ * <pre>
+ * public class A {
+ * protected Collection b;
+ *
+ * protected Collection c;
+ *
+ * public Collection get_b() {
+ * return b;
+ * }
+ *
+ * public Collection get_c() {
+ * return c;
+ * }
+ *
+ * public A(Collection new_b, Collection new_c) {
+ * b = new_b;
+ * c = new_c;
+ * }
+ * }
+ * </pre>
+ *
+ * <p>
+ * Since the class doesn't have any setters, someone might think that it is
+ * immutable. You know where this is leading, of course; this class is unsafe in
+ * a number of ways. The following illustrates that.
+ * </p>
+ *
+ * <pre>
+ * public test1(SupposedlyImmutableClass x, SafeStorage y) {
+ * // unsafe getter
+ * A a = x.getA();
+ * Collection col = a.get_b();
+ * col.add(something); // a has now been changed, and x too
+ *
+ * // unsafe constructor
+ * a = new A(col, col);
+ * y.store(a);
+ * col.add(something); // a has now been changed, and y too
+ * }
+ * </pre>
+ *
+ * <p>
+ * There are a few different techniques for having safe classes.
+ * </p>
+ * <ol>
+ * <li>Const objects. In C++, you can declare parameters const.</li>
+ * <li>Immutable wrappers. For example, you can put a collection in an
+ * immutable wrapper.</li>
+ * <li>Always-Immutable objects. Java uses this approach, with a few
+ * variations. Examples:
+ * <ol>
+ * <li>Simple. Once a Color is created (eg from R, G, and B integers) it is
+ * immutable.</li>
+ * <li>Builder Class. There is a separate 'builder' class. For example,
+ * modifiable Strings are created using StringBuffer (which doesn't have the
+ * full String API available). Once you want an immutable form, you create one
+ * with toString().</li>
+ * <li>Primitives. These are always safe, since they are copied on input/output
+ * from methods.</li>
+ * </ol>
+ * </li>
+ * <li>Cloning. Where you need an object to be safe, you clone it.</li>
+ * </ol>
+ * <p>
+ * There are advantages and disadvantages of each of these.
+ * </p>
+ * <ol>
+ * <li>Const provides a certain level of protection, but since const can be and
+ * is often cast away, it only protects against most inadvertent mistakes. It
+ * also offers no threading protection, since anyone who has a pointer to the
+ * (unconst) object in another thread can mess you up.</li>
+ * <li>Immutable wrappers are safer than const in that the constness can't be
+ * cast away. But other than that they have all the same problems: not safe if
+ * someone else keeps hold of the original object, or if any of the objects
+ * returned by the class are mutable.</li>
+ * <li>Always-Immutable Objects are safe, but usage can require excessive
+ * object creation.</li>
+ * <li>Cloning is only safe if the object truly has a 'safe' clone; defined as
+ * one that <i>ensures that no change to the clone affects the original</i>.
+ * Unfortunately, many objects don't have a 'safe' clone, and always cloning can
+ * require excessive object creation.</li>
+ * </ol>
+ * <h2>Freezable Model</h2>
+ * <p>
+ * The <code>Freezable</code> model supplements these choices by giving you
+ * the ability to build up an object by calling various methods, then when it is
+ * in a final state, you can <i>make</i> it immutable. Once immutable, an
+ * object cannot <i>ever </i>be modified, and is completely thread-safe: that
+ * is, multiple threads can have references to it without any synchronization.
+ * If someone needs a mutable version of an object, they can use
+ * <code>cloneAsThawed()</code>, and modify the copy. This provides a simple,
+ * effective mechanism for safe classes in circumstances where the alternatives
+ * are insufficient or clumsy. (If an object is shared before it is immutable,
+ * then it is the responsibility of each thread to mutex its usage (as with
+ * other objects).)
+ * </p>
+ * <p>
+ * Here is what needs to be done to implement this interface, depending on the
+ * type of the object.
+ * </p>
+ * <h3><b>Immutable Objects</b></h3>
+ * <p>
+ * These are the easiest. You just use the interface to reflect that, by adding
+ * the following:
+ * </p>
+ *
+ * <pre>
+ * public class A implements Freezable<A> {
+ * ...
+ * public final boolean isFrozen() {return true;}
+ * public final A freeze() {return this;}
+ * public final A cloneAsThawed() { return this; }
+ * }
+ * </pre>
+ *
+ * <p>
+ * These can be final methods because subclasses of immutable objects must
+ * themselves be immutable. (Note: <code>freeze</code> is returning
+ * <code>this</code> for chaining.)
+ * </p>
+ * <h3><b>Mutable Objects</b></h3>
+ * <p>
+ * Add a protected 'flagging' field:
+ * </p>
+ *
+ * <pre>
+ * protected boolean immutable;
+ * </pre>
+ *
+ * <p>
+ * Add the following methods:
+ * </p>
+ *
+ * <pre>
+ * public final boolean isFrozen() {
+ * return frozen;
+ * };
+ *
+ * public A freeze() {
+ * frozen = true;
+ * return this;
+ * }
+ * </pre>
+ *
+ * <p>
+ * Add a <code>cloneAsThawed()</code> method following the normal pattern for
+ * <code>clone()</code>, except that <code>frozen=false</code> in the new
+ * clone.
+ * </p>
+ * <p>
+ * Then take the setters (that is, any method that can change the internal state
+ * of the object), and add the following as the first statement:
+ * </p>
+ *
+ * <pre>
+ * if (isFrozen()) {
+ * throw new UnsupportedOperationException("Attempt to modify frozen object");
+ * }
+ * </pre>
+ *
+ * <h4><b>Subclassing</b></h4>
+ * <p>
+ * Any subclass of a <code>Freezable</code> will just use its superclass's
+ * flagging field. It must override <code>freeze()</code> and
+ * <code>cloneAsThawed()</code> to call the superclass, but normally does not
+ * override <code>isFrozen()</code>. It must then just pay attention to its
+ * own getters, setters and fields.
+ * </p>
+ * <h4><b>Internal Caches</b></h4>
+ * <p>
+ * Internal caches are cases where the object is logically unmodified, but
+ * internal state of the object changes. For example, there are const C++
+ * functions that cast away the const on the "this" pointer in order
+ * to modify an object cache. These cases are handled by mutexing the internal
+ * cache to ensure thread-safety. For example, suppose that UnicodeSet had an
+ * internal marker to the last code point accessed. In this case, the field is
+ * not externally visible, so the only thing you need to do is to synchronize
+ * the field for thread safety.
+ * </p>
+ * <h4>Unsafe Internal Access</h4>
+ * <p>
+ * Internal fields are called <i>safe</i> if they are either
+ * <code>frozen</code> or immutable (such as String or primitives). If you've
+ * never allowed internal access to these, then you are all done. For example,
+ * converting UnicodeSet to be <code>Freezable</code> is just accomplished
+ * with the above steps. But remember that you <i><b>have</b></i> allowed
+ * access to unsafe internals if you have any code like the following, in a
+ * getter, setter, or constructor:
+ * </p>
+ *
+ * <pre>
+ * Collection getStuff() {
+ * return stuff;
+ * } // caller could keep reference & modify
+ *
+ * void setStuff(Collection x) {
+ * stuff = x;
+ * } // caller could keep reference & modify
+ *
+ * MyClass(Collection x) {
+ * stuff = x;
+ * } // caller could keep reference & modify
+ * </pre>
+ *
+ * <p>
+ * These also illustrated in the code sample in <b>Background</b> above.
+ * </p>
+ * <p>
+ * To deal with unsafe internals, the simplest course of action is to do the
+ * work in the <code>freeze()</code> function. Just make all of your internal
+ * fields frozen, and set the frozen flag. Any subsequent getter/setter will
+ * work properly. Here is an example:
+ * </p>
+ *
+ * <pre>
+ * public A freeze() {
+ * if (!frozen) {
+ * foo.freeze();
+ * frozen = true;
+ * }
+ * return this;
+ * }
+ * </pre>
+ *
+ * <p>
+ * If the field is a <code>Collection</code> or <code>Map</code>, then to
+ * make it frozen you have two choices. If you have never allowed access to the
+ * collection from outside your object, then just wrap it to prevent future
+ * modification.
+ * </p>
+ *
+ * <pre>
+ * zone_to_country = Collections.unmodifiableMap(zone_to_country);
+ * </pre>
+ *
+ * <p>
+ * If you have <i>ever</i> allowed access, then do a <code>clone()</code>
+ * before wrapping it.
+ * </p>
+ *
+ * <pre>
+ * zone_to_country = Collections.unmodifiableMap(zone_to_country.clone());
+ * </pre>
+ *
+ * <p>
+ * If a collection <i>(or any other container of objects)</i> itself can
+ * contain mutable objects, then for a safe clone you need to recurse through it
+ * to make the entire collection immutable. The recursing code should pick the
+ * most specific collection available, to avoid the necessity of later
+ * downcasing.
+ * </p>
+ * <blockquote>
+ * <p>
+ * <b>Note: </b>An annoying flaw in Java is that the generic collections, like
+ * <code>Map</code> or <code>Set</code>, don't have a <code>clone()</code>
+ * operation. When you don't know the type of the collection, the simplest
+ * course is to just create a new collection:
+ * </p>
+ *
+ * <pre>
+ * zone_to_country = Collections.unmodifiableMap(new HashMap(zone_to_country));
+ * </pre>
+ *
+ * </blockquote>
+ * @stable ICU 3.8
+ */
+public interface Freezable<T> extends Cloneable {
+ /**
+ * Determines whether the object has been frozen or not.
+ * @stable ICU 3.8
+ */
+ public boolean isFrozen();
+
+ /**
+ * Freezes the object.
+ * @return the object itself.
+ * @stable ICU 3.8
+ */
+ public T freeze();
+
+ /**
+ * Provides for the clone operation. Any clone is initially unfrozen.
+ * @stable ICU 3.8
+ */
+ public T cloneAsThawed();
+}
import java.io.Serializable;
import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.Set;
+import java.util.SimpleTimeZone;
import com.ibm.icu.util.ULocale.Category;
* @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
* @stable ICU 2.0
*/
-public class TimeZone implements Serializable, Cloneable {
+public class TimeZone implements Serializable, Cloneable, Freezable<TimeZone> {
private static final long serialVersionUID = 1L;
/**
*/
public static final int LONG = 1;
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a short generic name, such as "PT."
- * @see #LONG_GENERIC
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int SHORT_GENERIC = 2;
-
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a long generic name, such as "Pacific Time."
- * @see #SHORT_GENERIC
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int LONG_GENERIC = 3;
-
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a short name derived from the timezone's offset, such as "-0800."
- * @see #LONG_GMT
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int SHORT_GMT = 4;
-
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a long name derived from the timezone's offset, such as "GMT-08:00."
- * @see #SHORT_GMT
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int LONG_GMT = 5;
-
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a short name derived from the timezone's short standard or daylight
- * timezone name ignoring commonlyUsed, such as "PDT."
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
-
- public static final int SHORT_COMMONLY_USED = 6;
-
- /**
- * {@icu} A style specifier for <code>getDisplayName()</code> indicating
- * a long name derived from the timezone's fallback name, such as
- * "United States (Los Angeles)."
- * @draft ICU 4.4
- * @provisional This API might change or be removed in a future release.
- */
- public static final int GENERIC_LOCATION = 7;
-
- /**
- * Gets the time zone offset, for current date, modified in case of
- * daylight savings. This is the offset to add *to* UTC to get local time.
- * @param era the era of the given date.
- * @param year the year in the given date.
- * @param month the month in the given date.
- * Month is 0-based. e.g., 0 for January.
- * @param day the day-in-month of the given date.
- * @param dayOfWeek the day-of-week of the given date.
- * @param milliseconds the millis in day in <em>standard</em> local time.
- * @return the offset to add *to* GMT to get local time.
- * @stable ICU 2.0
- */
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a short generic name, such as "PT."
+// * @see #LONG_GENERIC
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int SHORT_GENERIC = 2;
+//
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a long generic name, such as "Pacific Time."
+// * @see #SHORT_GENERIC
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int LONG_GENERIC = 3;
+//
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a short name derived from the timezone's offset, such as "-0800."
+// * @see #LONG_GMT
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int SHORT_GMT = 4;
+//
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a long name derived from the timezone's offset, such as "GMT-08:00."
+// * @see #SHORT_GMT
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int LONG_GMT = 5;
+//
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a short name derived from the timezone's short standard or daylight
+// * timezone name ignoring commonlyUsed, such as "PDT."
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+//
+// public static final int SHORT_COMMONLY_USED = 6;
+//
+// /**
+// * {@icu} A style specifier for <code>getDisplayName()</code> indicating
+// * a long name derived from the timezone's fallback name, such as
+// * "United States (Los Angeles)."
+// * @draft ICU 4.4
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static final int GENERIC_LOCATION = 7;
+//
+// /**
+// * Gets the time zone offset, for current date, modified in case of
+// * daylight savings. This is the offset to add *to* UTC to get local time.
+// * @param era the era of the given date.
+// * @param year the year in the given date.
+// * @param month the month in the given date.
+// * Month is 0-based. e.g., 0 for January.
+// * @param day the day-in-month of the given date.
+// * @param dayOfWeek the day-of-week of the given date.
+// * @param milliseconds the millis in day in <em>standard</em> local time.
+// * @return the offset to add *to* GMT to get local time.
+// * @stable ICU 2.0
+// */
- /**
- * {@icu} System time zone type constants used by filtering zones in
- * {@link TimeZone#getAvailableIDs(SystemTimeZoneType, String, Integer)}
- *
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public enum SystemTimeZoneType {
- /**
- * Any system zones.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- ANY,
-
- /**
- * Canonical system zones.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- CANONICAL,
-
- /**
- * Canonical system zones associated with actual locations.
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- CANONICAL_LOCATION,
- }
+// /**
+// * {@icu} System time zone type constants used by filtering zones in
+// * {@link TimeZone#getAvailableIDs(SystemTimeZoneType, String, Integer)}
+// *
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// public enum SystemTimeZoneType {
+// /**
+// * Any system zones.
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// ANY,
+//
+// /**
+// * Canonical system zones.
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// CANONICAL,
+//
+// /**
+// * Canonical system zones associated with actual locations.
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// CANONICAL_LOCATION,
+// }
public int getOffset(int era, int year, int month, int day,
int dayOfWeek, int milliseconds) {
return timeZone.getOffset(date);
}
- /**
- * Returns the time zone raw and GMT offset for the given moment
- * in time. Upon return, local-millis = GMT-millis + rawOffset +
- * dstOffset. All computations are performed in the proleptic
- * Gregorian calendar. The default implementation in the TimeZone
- * class delegates to the 8-argument getOffset().
- *
- * @param date moment in time for which to return offsets, in
- * units of milliseconds from January 1, 1970 0:00 GMT, either GMT
- * time or local wall time, depending on `local'.
- * @param local if true, `date' is local wall time; otherwise it
- * is in GMT time.
- * @param offsets output parameter to receive the raw offset, that
- * is, the offset not including DST adjustments, in offsets[0],
- * and the DST offset, that is, the offset to be added to
- * `rawOffset' to obtain the total offset between local and GMT
- * time, in offsets[1]. If DST is not in effect, the DST offset is
- * zero; otherwise it is a positive value, typically one hour.
- *
- * @stable ICU 2.8
- */
- public void getOffset(long date, boolean local, int[] offsets) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Returns the time zone raw and GMT offset for the given moment
+// * in time. Upon return, local-millis = GMT-millis + rawOffset +
+// * dstOffset. All computations are performed in the proleptic
+// * Gregorian calendar. The default implementation in the TimeZone
+// * class delegates to the 8-argument getOffset().
+// *
+// * @param date moment in time for which to return offsets, in
+// * units of milliseconds from January 1, 1970 0:00 GMT, either GMT
+// * time or local wall time, depending on `local'.
+// * @param local if true, `date' is local wall time; otherwise it
+// * is in GMT time.
+// * @param offsets output parameter to receive the raw offset, that
+// * is, the offset not including DST adjustments, in offsets[0],
+// * and the DST offset, that is, the offset to be added to
+// * `rawOffset' to obtain the total offset between local and GMT
+// * time, in offsets[1]. If DST is not in effect, the DST offset is
+// * zero; otherwise it is a positive value, typically one hour.
+// *
+// * @stable ICU 2.8
+// */
+// public void getOffset(long date, boolean local, int[] offsets) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Sets the base time zone offset to GMT.
* @stable ICU 2.0
*/
public void setRawOffset(int offsetMillis) {
+ if (isFrozen) {
+ throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
+ }
timeZone.setRawOffset(offsetMillis);
}
* @stable ICU 2.0
*/
public void setID(String ID) {
+ if (isFrozen) {
+ throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
+ }
timeZone.setID(ID);
}
return timeZone.useDaylightTime();
}
+// /**
+// * Queries if this time zone is in daylight saving time or will observe
+// * daylight saving time at any future time.
+// * <p>The default implementation in this class returns <code>true</code> if {@link #useDaylightTime()}
+// * or {@link #inDaylightTime(Date) inDaylightTime(new Date())} returns <code>true</code>.
+// * <p>
+// * <strong>Note:</strong> This method was added for JDK compatibility support.
+// * The JDK's <code>useDaylightTime()</code> only checks the last known rule(s), therefore
+// * it may return false even the zone observes daylight saving time currently. JDK added
+// * <code>observesDaylightTime()</code> to resolve the issue. In ICU, {@link #useDaylightTime()}
+// * works differently. The ICU implementation checks if the zone uses daylight saving time
+// * in the current calendar year. Therefore, it will never return <code>false</code> if
+// * daylight saving time is currently used.
+// * <p>
+// * ICU's TimeZone subclass implementations override this method to support the same behavior
+// * with JDK's <code>observesDaylightSavingTime()</code>. Unlike {@link #useDaylightTime()},
+// * the implementation does not take past daylight saving time into account, so
+// * that this method may return <code>false</code> even when {@link #useDaylightTime()} returns
+// * <code>true</code>.
+// *
+// * @return <code>true</code> if this time zone is in daylight saving time or will observe
+// * daylight saving time at any future time.
+// * @see #useDaylightTime
+// * @stable ICU 49
+// */
+// public boolean observesDaylightTime() {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
/**
* Queries if the given date is in daylight savings time in
* this time zone.
return new TimeZone(java.util.TimeZone.getTimeZone(ID));
}
+ /**
+ * Gets the <code>TimeZone</code> for the given ID. The instance of <code>TimeZone</code>
+ * returned by this method is immutable. Any methods mutate the instance({@link #setID(String)},
+ * {@link #setRawOffset(int)}) will throw <code>UnsupportedOperationException</code> upon its
+ * invocation.
+ *
+ * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles",
+ * or a custom ID such as "GMT-8:00". Note that the support of abbreviations,
+ * such as "PST", is for JDK 1.1.x compatibility only and full names should be used.
+ *
+ * @return the specified <code>TimeZone</code>, or the UNKNOWN_ZONE
+ * if the given ID cannot be understood.
+ * @see #UNKNOWN_ZONE
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
+ */
+ public static TimeZone getFrozenTimeZone(String ID) {
+ return getTimeZone(ID).freeze();
+ }
+
/**
* Gets the <code>TimeZone</code> for the given ID and the timezone type.
* @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles", or a
return TIMEZONE_JDK;
}
- /**
- * {@icu} Returns a set of time zone ID strings with the given filter conditions.
- * <p><b>Note:</b>A <code>Set</code> returned by this method is
- * immutable.
- * @param zoneType The system time zone type.
- * @param region The ISO 3166 two-letter country code or UN M.49 three-digit area code.
- * When null, no filtering done by region.
- * @param rawOffset An offset from GMT in milliseconds, ignoring the effect of daylight savings
- * time, if any. When null, no filtering done by zone offset.
- * @return an immutable set of system time zone IDs.
- * @see SystemTimeZoneType
- *
- * @draft ICU 4.8
- * @provisional This API might change or be removed in a future release.
- */
- public static Set<String> getAvailableIDs(SystemTimeZoneType zoneType,
- String region, Integer rawOffset) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns a set of time zone ID strings with the given filter conditions.
+// * <p><b>Note:</b>A <code>Set</code> returned by this method is
+// * immutable.
+// * @param zoneType The system time zone type.
+// * @param region The ISO 3166 two-letter country code or UN M.49 three-digit area code.
+// * When null, no filtering done by region.
+// * @param rawOffset An offset from GMT in milliseconds, ignoring the effect of daylight savings
+// * time, if any. When null, no filtering done by zone offset.
+// * @return an immutable set of system time zone IDs.
+// * @see SystemTimeZoneType
+// *
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static Set<String> getAvailableIDs(SystemTimeZoneType zoneType,
+// String region, Integer rawOffset) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Return a new String array containing all system TimeZone IDs
}
- /**
- * Return a new String array containing all system TimeZone IDs
- * associated with the given country. These IDs may be passed to
- * <code>get()</code> to construct the corresponding TimeZone
- * object.
- * @param country a two-letter ISO 3166 country code, or <code>null</code>
- * to return zones not associated with any country
- * @return an array of IDs for system TimeZones in the given
- * country. If there are none, return a zero-length array.
- * @stable ICU 2.0
- */
- public static String[] getAvailableIDs(String country) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Return a new String array containing all system TimeZone IDs
+// * associated with the given country. These IDs may be passed to
+// * <code>get()</code> to construct the corresponding TimeZone
+// * object.
+// * @param country a two-letter ISO 3166 country code, or <code>null</code>
+// * to return zones not associated with any country
+// * @return an array of IDs for system TimeZones in the given
+// * country. If there are none, return a zero-length array.
+// * @stable ICU 2.0
+// */
+// public static String[] getAvailableIDs(String country) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Return a new String array containing all system TimeZone IDs.
return java.util.TimeZone.getAvailableIDs();
}
- /**
- * {@icu} Returns the number of IDs in the equivalency group that
- * includes the given ID. An equivalency group contains zones
- * that have the same GMT offset and rules.
- *
- * <p>The returned count includes the given ID; it is always >= 1
- * for valid IDs. The given ID must be a system time zone. If it
- * is not, returns zero.
- * @param id a system time zone ID
- * @return the number of zones in the equivalency group containing
- * 'id', or zero if 'id' is not a valid system ID
- * @see #getEquivalentID
- * @stable ICU 2.0
- */
- public static int countEquivalentIDs(String id) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * {@icu} Returns the number of IDs in the equivalency group that
+// * includes the given ID. An equivalency group contains zones
+// * that have the same GMT offset and rules.
+// *
+// * <p>The returned count includes the given ID; it is always >= 1
+// * for valid IDs. The given ID must be a system time zone. If it
+// * is not, returns zero.
+// * @param id a system time zone ID
+// * @return the number of zones in the equivalency group containing
+// * 'id', or zero if 'id' is not a valid system ID
+// * @see #getEquivalentID
+// * @stable ICU 2.0
+// */
+// public static int countEquivalentIDs(String id) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
- /**
- * Returns an ID in the equivalency group that
- * includes the given ID. An equivalency group contains zones
- * that have the same GMT offset and rules.
- *
- * <p>The given index must be in the range 0..n-1, where n is the
- * value returned by <code>countEquivalentIDs(id)</code>. For
- * some value of 'index', the returned value will be equal to the
- * given id. If the given id is not a valid system time zone, or
- * if 'index' is out of range, then returns an empty string.
- * @param id a system time zone ID
- * @param index a value from 0 to n-1, where n is the value
- * returned by <code>countEquivalentIDs(id)</code>
- * @return the ID of the index-th zone in the equivalency group
- * containing 'id', or an empty string if 'id' is not a valid
- * system ID or 'index' is out of range
- * @see #countEquivalentIDs
- * @stable ICU 2.0
- */
- public static String getEquivalentID(String id, int index) {
- throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
- }
+// /**
+// * Returns an ID in the equivalency group that
+// * includes the given ID. An equivalency group contains zones
+// * that have the same GMT offset and rules.
+// *
+// * <p>The given index must be in the range 0..n-1, where n is the
+// * value returned by <code>countEquivalentIDs(id)</code>. For
+// * some value of 'index', the returned value will be equal to the
+// * given id. If the given id is not a valid system time zone, or
+// * if 'index' is out of range, then returns an empty string.
+// * @param id a system time zone ID
+// * @param index a value from 0 to n-1, where n is the value
+// * returned by <code>countEquivalentIDs(id)</code>
+// * @return the ID of the index-th zone in the equivalency group
+// * containing 'id', or an empty string if 'id' is not a valid
+// * system ID or 'index' is out of range
+// * @see #countEquivalentIDs
+// * @stable ICU 2.0
+// */
+// public static String getEquivalentID(String id, int index) {
+// throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
+// }
/**
* Gets the default <code>TimeZone</code> for this host.
return timeZone.hashCode();
}
+// /**
+// * {@icu} Returns the time zone data version currently used by ICU.
+// *
+// * @return the version string, such as "2007f"
+// * @throws MissingResourceException if ICU time zone resource bundle
+// * is missing or the version information is not available.
+// *
+// * @stable ICU 3.8
+// */
+// public static synchronized String getTZDataVersion() {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the canonical system time zone ID or the normalized
+// * custom time zone ID for the given time zone ID.
+// * @param id The input time zone ID to be canonicalized.
+// * @return The canonical system time zone ID or the custom time zone ID
+// * in normalized format for the given time zone ID. When the given time zone ID
+// * is neither a known system time zone ID nor a valid custom time zone ID,
+// * null is returned.
+// * @stable ICU 4.0
+// */
+// public static String getCanonicalID(String id) {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the canonical system time zone ID or the normalized
+// * custom time zone ID for the given time zone ID.
+// * @param id The input time zone ID to be canonicalized.
+// * @param isSystemID When non-null boolean array is specified and
+// * the given ID is a known system time zone ID, true is set to <code>isSystemID[0]</code>
+// * @return The canonical system time zone ID or the custom time zone ID
+// * in normalized format for the given time zone ID. When the given time zone ID
+// * is neither a known system time zone ID nor a valid custom time zone ID,
+// * null is returned.
+// * @stable ICU 4.0
+// */
+// public static String getCanonicalID(String id, boolean[] isSystemID) {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
+// /**
+// * {@icu} Returns the region code associated with the given
+// * system time zone ID. The region code is either ISO 3166
+// * 2-letter country code or UN M.49 3-digit area code.
+// * When the time zone is not associated with a specific location,
+// * for example - "Etc/UTC", "EST5EDT", then this method returns
+// * "001" (UN M.49 area code for World).
+// * @param id the system time zone ID.
+// * @return the region code associated with the given
+// * system time zone ID.
+// * @throws IllegalArgumentException if <code>id</code> is not a known system ID.
+// * @see #getAvailableIDs(String)
+// *
+// * @draft ICU 4.8
+// * @provisional This API might change or be removed in a future release.
+// */
+// public static String getRegion(String id) {
+// throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+// }
+
+ private transient boolean isFrozen = false;
+
/**
- * {@icu} Returns the time zone data version currently used by ICU.
- *
- * @return the version string, such as "2007f"
- * @throws MissingResourceException if ICU time zone resource bundle
- * is missing or the version information is not available.
- *
- * @stable ICU 3.8
+ * {@inheritDoc}
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
*/
- public static synchronized String getTZDataVersion() {
- throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+ public boolean isFrozen() {
+ return isFrozen;
}
/**
- * {@icu} Returns the canonical system time zone ID or the normalized
- * custom time zone ID for the given time zone ID.
- * @param id The input time zone ID to be canonicalized.
- * @return The canonical system time zone ID or the custom time zone ID
- * in normalized format for the given time zone ID. When the given time zone ID
- * is neither a known system time zone ID nor a valid custom time zone ID,
- * null is returned.
- * @stable ICU 4.0
+ * {@inheritDoc}
+ * @draft ICU 49
+ * @provisional This API might change or be removed in a future release.
*/
- public static String getCanonicalID(String id) {
- throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+ public TimeZone freeze() {
+ isFrozen = true;
+ return this;
}
/**
- * {@icu} Returns the canonical system time zone ID or the normalized
- * custom time zone ID for the given time zone ID.
- * @param id The input time zone ID to be canonicalized.
- * @param isSystemID When non-null boolean array is specified and
- * the given ID is a known system time zone ID, true is set to <code>isSystemID[0]</code>
- * @return The canonical system time zone ID or the custom time zone ID
- * in normalized format for the given time zone ID. When the given time zone ID
- * is neither a known system time zone ID nor a valid custom time zone ID,
- * null is returned.
- * @stable ICU 4.0
- */
- public static String getCanonicalID(String id, boolean[] isSystemID) {
- throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
- }
-
- /**
- * {@icu} Returns the region code associated with the given
- * system time zone ID. The region code is either ISO 3166
- * 2-letter country code or UN M.49 3-digit area code.
- * When the time zone is not associated with a specific location,
- * for example - "Etc/UTC", "EST5EDT", then this method returns
- * "001" (UN M.49 area code for World).
- * @param id the system time zone ID.
- * @return the region code associated with the given
- * system time zone ID.
- * @throws IllegalArgumentException if <code>id</code> is not a known system ID.
- * @see #getAvailableIDs(String)
- *
- * @draft ICU 4.8
+ * {@inheritDoc}
+ * @draft ICU 49
* @provisional This API might change or be removed in a future release.
- */
- public static String getRegion(String id) {
- throw new UnsupportedOperationException("Method not supproted by com.ibm.icu.base");
+ */
+ public TimeZone cloneAsThawed() {
+ try {
+ TimeZone other = (TimeZone) super.clone();
+ other.isFrozen = false;
+ return other;
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeException(e);
+ }
}
+
}
//eof
/*
******************************************************************************
-* Copyright (C) 2003-2011, International Business Machines Corporation and *
+* Copyright (C) 2003-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
String bcpType = uext.getUnicodeLocaleType(bcpKey);
// convert to legacy key/type
String lkey = bcp47ToLDMLKey(bcpKey);
- String ltype = bcp47ToLDMLType(lkey, ((bcpType.length() == 0) ? "true" : bcpType)); // use "true" as the value of typeless keywords
+ String ltype = bcp47ToLDMLType(lkey, ((bcpType.length() == 0) ? "yes" : bcpType)); // use "yes" as the value of typeless keywords
// special handling for u-va-posix, since this is a variant, not a keyword
if (lkey.equals("va") && ltype.equals("posix") && base.getVariant().length() == 0) {
id = id + "_POSIX";
} else if (key.equals("colstrength")) {
map = TYPEMAP_COLSTRENGTH;
aliasMap = TYPEALIAS_COLSTRENGTH;
+ } else if (key.equals("numbers")) {
+ map = TYPEMAP_NUMBERS;
} else if (key.equals("timezone")) {
map = TYPEMAP_TIMEZONE;
aliasMap = TYPEALIAS_TIMEZONE;
if (kwKey.length() != 1) {
// Unicode locale key
kwKey = bcp47ToLDMLKey(kwKey);
- // use "true" as the value of typeless keywords
- kwVal = bcp47ToLDMLType(kwKey, ((kwVal.length() == 0) ? "true" : kwVal));
+ // use "yes" as the value of typeless keywords
+ kwVal = bcp47ToLDMLType(kwKey, ((kwVal.length() == 0) ? "yes" : kwVal));
}
if (addSep) {
"tertiary", "level3",
};
+ private static final String[] TYPEMAP_NUMBERS = {
+ "traditional", "traditio",
+ };
+
private static final String[] TYPEMAP_TIMEZONE = {
"Africa/Abidjan", "ciabj",
"Africa/Accra", "ghacc",
"Africa/Gaborone", "bwgbe",
"Africa/Harare", "zwhre",
"Africa/Johannesburg", "zajnb",
+ "Africa/Juba", "ssjub",
"Africa/Kampala", "ugkla",
"Africa/Khartoum", "sdkrt",
"Africa/Kigali", "rwkgl",
"America/Coral_Harbour", "cayzs",
"America/Cordoba", "arcor",
"America/Costa_Rica", "crsjo",
+ "America/Creston", "cacfq",
"America/Cuiaba", "brcgb",
"America/Curacao", "ancur",
"America/Danmarkshavn", "gldkshvn",
"America/Jujuy", "arjuj",
"America/Juneau", "usjnu",
"America/Kentucky/Monticello", "usmoc",
+ "America/Kralendijk", "bqkra",
"America/La_Paz", "bolpb",
"America/Lima", "pelim",
"America/Los_Angeles", "uslax",
"America/Louisville", "uslui",
+ "America/Lower_Princes", "sxphi",
"America/Maceio", "brmcz",
"America/Managua", "nimga",
"America/Manaus", "brmao",
"America/Pangnirtung", "capnt",
"America/Paramaribo", "srpbm",
"America/Phoenix", "usphx",
- "America/Port-au-Prince", "htpap",
"America/Port_of_Spain", "ttpos",
+ "America/Port-au-Prince", "htpap",
"America/Porto_Velho", "brpvh",
"America/Puerto_Rico", "prsju",
"America/Rainy_River", "caffs",
"Asia/Dushanbe", "tjdyu",
"Asia/Gaza", "gaza",
"Asia/Harbin", "cnhrb",
+ "Asia/Hebron", "hebron",
"Asia/Hong_Kong", "hkhkg",
"Asia/Hovd", "mnhvd",
"Asia/Irkutsk", "ruikt",
"Indian/Mayotte", "ytmam",
"Indian/Reunion", "rereu",
"MST7MDT", "mst7mdt",
- "PST8PDT", "pst8pdt",
"Pacific/Apia", "wsapw",
"Pacific/Auckland", "nzakl",
"Pacific/Chatham", "nzcht",
"Pacific/Truk", "fmtkk",
"Pacific/Wake", "umawk",
"Pacific/Wallis", "wfmau",
+ "PST8PDT", "pst8pdt",
};
private static final String[] TYPEALIAS_COLSTRENGTH = {
"Australia/ACT", "Australia/Sydney",
"Australia/Canberra", "Australia/Sydney",
"Australia/LHI", "Australia/Lord_Howe",
- "Australia/NSW", "Australia/Sydney",
"Australia/North", "Australia/Darwin",
+ "Australia/NSW", "Australia/Sydney",
"Australia/Queensland", "Australia/Brisbane",
"Australia/South", "Australia/Adelaide",
"Australia/Tasmania", "Australia/Hobart",
"Brazil/West", "America/Manaus",
"Canada/Atlantic", "America/Halifax",
"Canada/Central", "America/Winnipeg",
- "Canada/East-Saskatchewan", "America/Regina",
"Canada/Eastern", "America/Toronto",
+ "Canada/East-Saskatchewan", "America/Regina",
"Canada/Mountain", "America/Edmonton",
"Canada/Newfoundland", "America/St_Johns",
"Canada/Pacific", "America/Vancouver",
"Chile/Continental", "America/Santiago",
"Chile/EasterIsland", "Pacific/Easter",
"Cuba", "America/Havana",
- "EST", "Etc/GMT+5",
"Egypt", "Africa/Cairo",
"Eire", "Europe/Dublin",
+ "EST", "Etc/GMT+5",
"Etc/GMT+0", "Etc/GMT",
- "Etc/GMT-0", "Etc/GMT",
"Etc/GMT0", "Etc/GMT",
+ "Etc/GMT-0", "Etc/GMT",
"Etc/Greenwich", "Etc/GMT",
"Etc/UCT", "Etc/GMT",
- "Etc/UTC", "Etc/GMT",
"Etc/Universal", "Etc/GMT",
+ "Etc/UTC", "Etc/GMT",
"Etc/Zulu", "Etc/GMT",
"Europe/Belfast", "Europe/London",
"Europe/Nicosia", "Asia/Nicosia",
"GB-Eire", "Europe/London",
"GMT", "Etc/GMT",
"GMT+0", "Etc/GMT",
- "GMT-0", "Etc/GMT",
"GMT0", "Etc/GMT",
+ "GMT-0", "Etc/GMT",
"Greenwich", "Etc/GMT",
- "HST", "Etc/GMT+10",
"Hongkong", "Asia/Hong_Kong",
+ "HST", "Etc/GMT+10",
"Iceland", "Atlantic/Reykjavik",
"Iran", "Asia/Tehran",
"Israel", "Asia/Jerusalem",
"Japan", "Asia/Tokyo",
"Kwajalein", "Pacific/Kwajalein",
"Libya", "Africa/Tripoli",
- "MST", "Etc/GMT+7",
"Mexico/BajaNorte", "America/Tijuana",
"Mexico/BajaSur", "America/Mazatlan",
"Mexico/General", "America/Mexico_City",
+ "MST", "Etc/GMT+7",
+ "Navajo", "America/Shiprock",
"NZ", "Pacific/Auckland",
"NZ-CHAT", "Pacific/Chatham",
- "Navajo", "America/Shiprock",
- "PRC", "Asia/Shanghai",
"Pacific/Chuuk", "Pacific/Truk",
"Pacific/Pohnpei", "Pacific/Ponape",
"Pacific/Samoa", "Pacific/Pago_Pago",
"Pacific/Yap", "Pacific/Truk",
"Poland", "Europe/Warsaw",
"Portugal", "Europe/Lisbon",
+ "PRC", "Asia/Shanghai",
"ROC", "Asia/Taipei",
"ROK", "Asia/Seoul",
"Singapore", "Asia/Singapore",
"Turkey", "Europe/Istanbul",
"UCT", "Etc/GMT",
+ "Universal", "Etc/GMT",
"US/Alaska", "America/Anchorage",
"US/Aleutian", "America/Adak",
"US/Arizona", "America/Phoenix",
"US/Central", "America/Chicago",
- "US/East-Indiana", "America/Indianapolis",
"US/Eastern", "America/New_York",
+ "US/East-Indiana", "America/Indianapolis",
"US/Hawaii", "Pacific/Honolulu",
"US/Indiana-Starke", "America/Indiana/Knox",
"US/Michigan", "America/Detroit",
"US/Pacific-New", "America/Los_Angeles",
"US/Samoa", "Pacific/Pago_Pago",
"UTC", "Etc/GMT",
- "Universal", "Etc/GMT",
"W-SU", "Europe/Moscow",
"Zulu", "Etc/GMT",
};
+++ /dev/null
-/*
- *******************************************************************************
- * Copyright (C) 2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- *******************************************************************************
- */
-package com.ibm.icu.util;
-
-/*
- * Empty stub
- */
-public final class VersionInfo {
- private VersionInfo() {}
-}
/*
******************************************************************************
- * Copyright (C) 2005-2011, International Business Machines Corporation and *
+ * Copyright (C) 2005-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
}
- // Core
+ // Collate
- public void testFormat() throws Exception {
- runUtility("Core/Format");
+ public void testCollator() throws Exception {
+ runUtility("Collate/Collator");
}
- public void testCompression() throws Exception {
- runUtility("Core/Compression");
+ public void testGlobalizationPreferencesTest() throws Exception {
+ runUtility("Collate/GlobalizationPreferencesTest");
}
- public void testRBBI() throws Exception {
- runUtility("Core/RBBI");
+ public void testICUResourceBundleCollationTest() throws Exception {
+ runUtility("Collate/ICUResourceBundleCollationTest");
}
- public void testArabicShapingRegTest() throws Exception {
- runUtility("Core/ArabicShapingRegTest");
+ public void testLocaleAliasCollationTest() throws Exception {
+ runUtility("Collate/LocaleAliasCollationTest");
}
- public void testCalendar() throws Exception {
- runUtility("Core/Calendar");
+ public void testRbnfLenientScannerTest() throws Exception {
+ runUtility("Collate/RbnfLenientScannerTest");
}
- public void testTimeZone() throws Exception {
- runUtility("Core/TimeZone");
+ public void testSearchTest() throws Exception {
+ runUtility("Collate/SearchTest");
}
- public void testProperty() throws Exception {
- runUtility("Core/Property");
+ public void testULocaleCollationTest() throws Exception {
+ runUtility("Collate/ULocaleCollationTest");
}
- public void testSpoofChecker() throws Exception {
- runUtility("Core/SpoofChecker");
+
+ // Core
+
+ public void testArabicShapingRegTest() throws Exception {
+ runUtility("Core/ArabicShapingRegTest");
}
- public void testNormalizer() throws Exception {
- runUtility("Core/Normalizer");
+ public void testBidi() throws Exception {
+ runUtility("Core/Bidi");
}
- public void testUtil() throws Exception {
- runUtility("Core/Util");
+ public void testCalendar() throws Exception {
+ runUtility("Core/Calendar");
}
- public void testTestUCharacterIterator() throws Exception {
- runUtility("Core/TestUCharacterIterator");
+ public void testCompression() throws Exception {
+ runUtility("Core/Compression");
}
public void testDiagBigDecimal() throws Exception {
runUtility("Core/DiagBigDecimal");
}
- public void testImpl() throws Exception {
- runUtility("Core/Impl");
- }
-
- public void testStringPrep() throws Exception {
- runUtility("Core/StringPrep");
+ public void testDuration() throws Exception {
+ runUtility("Core/Duration");
}
- public void testTimeScale() throws Exception {
- runUtility("Core/TimeScale");
+ public void testFormat() throws Exception {
+ runUtility("Core/Format");
}
- public void testTestCharsetDetector() throws Exception {
- runUtility("Core/TestCharsetDetector");
+ public void testImpl() throws Exception {
+ runUtility("Core/Impl");
}
- public void testBidi() throws Exception {
- runUtility("Core/Bidi");
+ public void testNormalizer() throws Exception {
+ runUtility("Core/Normalizer");
}
- public void testDuration() throws Exception {
- runUtility("Core/Duration");
+ public void testProperty() throws Exception {
+ runUtility("Core/Property");
}
- public void testSerializable() throws Exception {
- runUtility("Core/Serializable");
+ public void testRBBI() throws Exception {
+ runUtility("Core/RBBI");
}
+// Note: ICU serializable test cases do not support test data loading
+// through Eclipse's class loader.
+// public void testSerializable() throws Exception {
+// runUtility("Core/Serializable");
+// }
- // Collate
-
- public void testCollator() throws Exception {
- runUtility("Collate/Collator");
+ public void testSpoofChecker() throws Exception {
+ runUtility("Core/SpoofChecker");
}
- public void testGlobalizationPreferencesTest() throws Exception {
- runUtility("Collate/GlobalizationPreferencesTest");
+ public void testStringPrep() throws Exception {
+ runUtility("Core/StringPrep");
}
- public void testRbnfLenientScannerTest() throws Exception {
- runUtility("Collate/RbnfLenientScannerTest");
+ public void testTestCharsetDetector() throws Exception {
+ runUtility("Core/TestCharsetDetector");
}
- public void testSearchTest() throws Exception {
- runUtility("Collate/SearchTest");
+ public void testTestUCharacterIterator() throws Exception {
+ runUtility("Core/TestUCharacterIterator");
}
- public void testICUResourceBundleCollationTest() throws Exception {
- runUtility("Collate/ICUResourceBundleCollationTest");
+ public void testTimeScale() throws Exception {
+ runUtility("Core/TimeScale");
}
- public void testLocaleAliasCollationTest() throws Exception {
- runUtility("Collate/LocaleAliasCollationTest");
+ public void testTimeZone() throws Exception {
+ runUtility("Core/TimeZone");
}
- public void testULocaleCollationTest() throws Exception {
- runUtility("Collate/ULocaleCollationTest");
+ public void testUtil() throws Exception {
+ runUtility("Core/Util");
}
+
// Translit
public void testTranslit() throws Exception {
-//##header
/**
*******************************************************************************
* Copyright (C) 1996-2012, International Business Machines Corporation and
return c1;
}
-//#if defined(ECLIPSE)
-//## public static final int codePointAt(String seq, int index) {
-//## return codePointAt((CharSequence)seq, index);
-//## }
-//#endif
-
/**
* Cover the JDK 1.5 API, for convenience. Return the code point at index.
* <br/><b>Note</b>: the semantics of this API is different from the related UTF16
return c2;
}
-//#if defined(ECLIPSE)
-//## public static final int codePointBefore(String seq, int index) {
-//## return codePointBefore((CharSequence)seq, index);
-//## }
-//#endif
-
/**
* Cover the JDK 1.5 API, for convenience. Return the code point before index.
* <br/><b>Note</b>: the semantics of this API is different from the related UTF16
return len;
}
-//#if defined(ECLIPSE)
-//## public static int codePointCount(String text, int start, int limit) {
-//## return codePointCount((CharSequence)text, start, limit);
-//## }
-//#endif
-
/**
* Cover the JDK API, for convenience. Count the number of code points in the range of text.
* @param text the characters to check
return index;
}
-//#if defined(ECLIPSE)
-//## public static int offsetByCodePoints(String text, int index, int codePointOffset) {
-//## return offsetByCodePoints((CharSequence)text, index, codePointOffset);
-//## }
-//#endif
-
/**
* Cover the JDK API, for convenience. Adjust the char index by a code point offset.
* @param text the characters to check
-//##header
/*
*******************************************************************************
* Copyright (C) 1996-2012, International Business Machines Corporation and *
* @see #setRoundingMode
* @stable ICU 2.0
*/
-//#if defined(ECLIPSE)
-//## public BigDecimal getRoundingIncrement() {
-//## return roundingIncrementICU;
-//## }
-//#else
public java.math.BigDecimal getRoundingIncrement() {
if (roundingIncrementICU == null)
return null;
return roundingIncrementICU.toBigDecimal();
}
-//#endif
/**
* {@icu} Sets the rounding increment. This method also controls whether rounding is
-//##header
/*****************************************************************************************
*
- * Copyright (C) 1996-2011, International Business Machines
+ * Copyright (C) 1996-2012, International Business Machines
* Corporation and others. All Rights Reserved.
**/
public void testJB6354()
{
DecimalFormat pat = new DecimalFormat("#,##0.00");
-//#if defined(ECLIPSE)
-//## BigDecimal r1, r2;
-//#else
java.math.BigDecimal r1, r2;
-//#endif
// get default rounding increment
r1 = pat.getRoundingIncrement();
-//##header
/*
*******************************************************************************
* Copyright (C) 2001-2012, International Business Machines Corporation and *
expect2(df, 2.0, "2.00 *&' \u20B9 '&*");
expect2(df, -1.0, "-1.00 *&' \u20B9 '&*");
-//#if defined(ECLIPSE)
-//## BigDecimal r;
-//#else
java.math.BigDecimal r;
-//#endif
+
r = df.getRoundingIncrement();
if (r != null) {
errln("FAIL: rounding = " + r + ", expect null");
-//##header
/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*
} else if (protocol.equals("file")) {
return getFileTargets(dataURL);
} else {
-//#if defined(ECLIPSE)
-//## logln("Don't know how to test " + dataURL);
-//#else
errln("Don't know how to test " + dataURL);
-//#endif
return null;
}
}
-//##header
/*
*******************************************************************************
* Copyright (C) 2005-2012, International Business Machines Corporation and *
URL url = urlEnum.nextElement();
URLHandler handler = URLHandler.get(url);
if (handler == null) {
-//#if defined(ECLIPSE)
-//## logln("Unsupported URL: " + url);
-//#else
errln("Unsupported URL: " + url);
-//#endif
continue;
}
handler.guide(this, true, false);