ICU-9094 merge changes for eclipse38 into trunk

X-SVN-Rev: 31518
This commit is contained in:
Dragan Besevic 2012-02-27 14:44:28 +00:00
parent 81d48c9c84
commit 085ea5add7
9 changed files with 376 additions and 13 deletions

1
.gitattributes vendored
View file

@ -226,6 +226,7 @@ icu4j/eclipse-build/plugins.template/com.ibm.icu.base/.settings/org.eclipse.jdt.
icu4j/eclipse-build/plugins.template/com.ibm.icu.base/META-INF/MANIFEST.MF -text
icu4j/eclipse-build/plugins.template/com.ibm.icu.base/build.properties -text
icu4j/eclipse-build/plugins.template/com.ibm.icu.base/plugin.properties -text
icu4j/eclipse-build/plugins.template/com.ibm.icu.base/src/com/ibm/icu/text/MessagePattern.java -text
icu4j/eclipse-build/plugins.template/com.ibm.icu.tests/META-INF/MANIFEST.MF -text
icu4j/eclipse-build/plugins.template/com.ibm.icu.tests/plugin.properties -text
icu4j/eclipse-build/plugins.template/com.ibm.icu/META-INF/MANIFEST.MF -text

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2001-2011, International Business Machines
* Copyright (C) 2001-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@ -2583,4 +2583,99 @@ public class Bidi {
{
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>
* &nbsp;&nbsp;prologue = "<code>abc DE</code>"<br>
* &nbsp;&nbsp;epilogue = none<br>
* &nbsp;&nbsp;main text = "<code>FGH xyz</code>"<br>
* &nbsp;&nbsp;paraLevel = LTR<br>
* &nbsp;&nbsp;display without prologue = "<code>HGF xyz</code>"
* ("HGF" is adjacent to "xyz")<br>
* &nbsp;&nbsp;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");
}
}

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 1996-2011, International Business Machines Corporation and *
* Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -330,6 +330,33 @@ public class Collator implements Comparator<Object>, Cloneable
return new Collator((java.text.Collator)collator.clone());
}
// Freezable interface implementation -------------------------------------------------
/**
* Determines whether the object has been frozen or not.
* @draft ICU 4.8
*/
public boolean isFrozen() {
return false;
}
/**
* Freezes the collator.
* @return the collator itself.
* @draft ICU 4.8
*/
public Collator freeze() {
throw new UnsupportedOperationException("Needs to be implemented by the subclass.");
}
/**
* Provides for the clone operation. Any clone is initially unfrozen.
* @draft ICU 4.8
*/
public Collator cloneAsThawed() {
throw new UnsupportedOperationException("Needs to be implemented by the subclass.");
}
// begin registry stuff
/**
@ -884,6 +911,51 @@ public class Collator implements Comparator<Object>, Cloneable
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

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1996-2011, International Business Machines
* Copyright (C) 1996-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*/
@ -206,7 +206,7 @@ public class DateFormat extends Format {
/**
* Alias for FRACTIONAL_SECOND_FIELD.
* @deprecated ICU 3.0 use FRACTIONAL_SECOND_FIELD.
* @stable ICU 3.0 FRACTIONAL_SECOND_FIELD.
*/
public final static int MILLISECOND_FIELD = FRACTIONAL_SECOND_FIELD;

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2011, International Business Machines Corporation and *
* Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -175,6 +175,20 @@ final public class DecimalFormatSymbols implements Cloneable, Serializable {
return dfs.getDigit();
}
/**
* Returns the array of characters used as digits, in order from 0 through 9
* @return The array
* @draft ICU 4.6
* @provisional This API might change or be removed in a future release.
*/
public char[] getDigits() {
char [] digitArray = new char[10];
for ( int i = 0 ; i < 10 ; i++ ) {
digitArray[i] = (char) (getZeroDigit() + i);
}
return digitArray;
}
/**
* Set the character used for a digit in a pattern.
* @param digit the digit pattern character

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2004-2011, International Business Machines
* Copyright (c) 2004-2012, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@ -542,6 +542,36 @@ public class MessageFormat extends UFormat {
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}
* @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
@ -778,16 +808,28 @@ public class MessageFormat extends UFormat {
}
/**
* {@icu} Returns the formats according to their argument names. For more details, see
* {@link #setFormatByArgumentName(String, Format)}.
* @return format associated with the name, or null if there isn't one.
* @internal
* @deprecated This API is ICU internal only.
* {@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 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");
}
/**
* Formats an array of objects and appends the <code>MessageFormat</code>'s
* pattern, with format elements replaced by the formatted objects, to the

View file

@ -0,0 +1,41 @@
/*
*******************************************************************************
* 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
}
}

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2001-2011, International Business Machines Corporation and *
* Copyright (C) 2001-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -417,6 +417,32 @@ public class Currency implements Serializable {
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");
}
}
//eof

View file

@ -1,7 +1,7 @@
/*
* @(#)TimeZone.java 1.51 00/01/19
*
* Copyright (C) 1996-2011, International Business Machines
* Copyright (C) 1996-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*/
@ -11,6 +11,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.Set;
import com.ibm.icu.util.ULocale.Category;
@ -224,6 +225,37 @@ public class TimeZone implements Serializable, Cloneable {
* @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,
}
public int getOffset(int era, int year, int month, int day,
int dayOfWeek, int milliseconds) {
return timeZone.getOffset(era, year, month, day, dayOfWeek, milliseconds);
@ -517,6 +549,26 @@ public class TimeZone implements Serializable, Cloneable {
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");
}
/**
* Return a new String array containing all system TimeZone IDs
* with the given raw offset from GMT. These IDs may be passed to
@ -707,6 +759,26 @@ public class TimeZone implements Serializable, Cloneable {
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");
}
}
//eof