8021108: Clean up doclint warnings and errors in java.text package

Reviewed-by: darcy, okutsu
This commit is contained in:
Yuka Kamiya 2013-07-26 17:22:08 +09:00
parent 050d7f177b
commit 7678cb95bc
21 changed files with 466 additions and 182 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -59,7 +59,8 @@ public class Annotation {
/**
* Constructs an annotation record with the given value, which
* may be null.
* @param value The value of the attribute
*
* @param value the value of the attribute
*/
public Annotation(Object value) {
this.value = value;
@ -67,6 +68,8 @@ public class Annotation {
/**
* Returns the value of the attribute, which may be null.
*
* @return the value of the attribute
*/
public Object getValue() {
return value;
@ -74,6 +77,8 @@ public class Annotation {
/**
* Returns the String representation of this Annotation.
*
* @return the {@code String} representation of this {@code Annotation}
*/
public String toString() {
return getClass().getName() + "[value=" + value + "]";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -101,6 +101,8 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Constructs an {@code Attribute} with the given name.
*
* @param name the name of {@code Attribute}
*/
protected Attribute(String name) {
this.name = name;
@ -111,7 +113,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Compares two objects for equality. This version only returns true
* for <code>x.equals(y)</code> if <code>x</code> and <code>y</code> refer
* for {@code x.equals(y)} if {@code x} and {@code y} refer
* to the same object, and guarantees this for all subclasses.
*/
public final boolean equals(Object obj) {
@ -137,6 +139,8 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Returns the name of the attribute.
*
* @return the name of {@code Attribute}
*/
protected String getName() {
return name;
@ -144,6 +148,10 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Resolves instances being deserialized to the predefined constants.
*
* @return the resolved {@code Attribute} object
* @throws InvalidObjectException if the object to resolve is not
* an instance of {@code Attribute}
*/
protected Object readResolve() throws InvalidObjectException {
if (this.getClass() != Attribute.class) {
@ -171,6 +179,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
* it is often necessary to store the reading (pronunciation) along with the
* written form.
* <p>Values are instances of {@link Annotation} holding instances of {@link String}.
*
* @see Annotation
* @see java.lang.String
*/
@ -196,18 +205,26 @@ public interface AttributedCharacterIterator extends CharacterIterator {
* <p>Any contiguous text segments having the same attributes (the
* same set of attribute/value pairs) are treated as separate runs
* if the attributes have been given to those text segments separately.
*
* @return the index of the first character of the run
*/
public int getRunStart();
/**
* Returns the index of the first character of the run
* with respect to the given {@code attribute} containing the current character.
*
* @param attribute the desired attribute.
* @return the index of the first character of the run
*/
public int getRunStart(Attribute attribute);
/**
* Returns the index of the first character of the run
* with respect to the given {@code attributes} containing the current character.
*
* @param attributes a set of the desired attributes.
* @return the index of the first character of the run
*/
public int getRunStart(Set<? extends Attribute> attributes);
@ -218,30 +235,43 @@ public interface AttributedCharacterIterator extends CharacterIterator {
* <p>Any contiguous text segments having the same attributes (the
* same set of attribute/value pairs) are treated as separate runs
* if the attributes have been given to those text segments separately.
*
* @return the index of the first character following the run
*/
public int getRunLimit();
/**
* Returns the index of the first character following the run
* with respect to the given {@code attribute} containing the current character.
*
* @param attribute the desired attribute
* @return the index of the first character following the run
*/
public int getRunLimit(Attribute attribute);
/**
* Returns the index of the first character following the run
* with respect to the given {@code attributes} containing the current character.
*
* @param attributes a set of the desired attributes
* @return the index of the first character following the run
*/
public int getRunLimit(Set<? extends Attribute> attributes);
/**
* Returns a map with the attributes defined on the current
* character.
*
* @return a map with the attributes defined on the current character
*/
public Map<Attribute,Object> getAttributes();
/**
* Returns the value of the named {@code attribute} for the current character.
* Returns {@code null} if the {@code attribute} is not defined.
*
* @param attribute the desired attribute
* @return the value of the named {@code attribute} or {@code null}
*/
public Object getAttribute(Attribute attribute);
@ -249,6 +279,8 @@ public interface AttributedCharacterIterator extends CharacterIterator {
* Returns the keys of all attributes defined on the
* iterator's text range. The set is empty if no
* attributes are defined.
*
* @return the keys of all attributes
*/
public Set<Attribute> getAllAttributeKeys();
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -176,8 +176,10 @@ public final class Bidi {
* Create a Bidi object representing the bidi information on a line of text within
* the paragraph represented by the current Bidi. This call is not required if the
* entire paragraph fits on one line.
*
* @param lineStart the offset from the start of the paragraph to the start of the line.
* @param lineLimit the offset from the start of the paragraph to the limit of the line.
* @return a {@code Bidi} object
*/
public Bidi createLineBidi(int lineStart, int lineLimit) {
AttributedString astr = new AttributedString("");
@ -189,6 +191,7 @@ public final class Bidi {
/**
* Return true if the line is not left-to-right or right-to-left. This means it either has mixed runs of left-to-right
* and right-to-left text, or the base direction differs from the direction of the only run of text.
*
* @return true if the line is not left-to-right or right-to-left.
*/
public boolean isMixed() {
@ -197,6 +200,7 @@ public final class Bidi {
/**
* Return true if the line is all left-to-right text and the base direction is left-to-right.
*
* @return true if the line is all left-to-right text and the base direction is left-to-right
*/
public boolean isLeftToRight() {
@ -236,8 +240,10 @@ public final class Bidi {
}
/**
* Return the resolved level of the character at offset. If offset is <0 or >=
* the length of the line, return the base direction level.
* Return the resolved level of the character at offset. If offset is
* {@literal <} 0 or &ge; the length of the line, return the base direction
* level.
*
* @param offset the index of the character for which to return the level
* @return the resolved level of the character at offset
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -191,7 +191,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
*
* Find the next word:
* <blockquote>
* <pre>
* <pre>{@code
* public static int nextWordStartAfter(int pos, String text) {
* BreakIterator wb = BreakIterator.getWordInstance();
* wb.setText(text);
@ -207,7 +207,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* }
* return BreakIterator.DONE;
* }
* </pre>
* }</pre>
* (The iterator returned by BreakIterator.getWordInstance() is unique in that
* the break positions it returns don't represent both the start and end of the
* thing being iterated over. That is, a sentence-break iterator returns breaks

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,7 @@ import java.util.Arrays;
* specifies a half-open interval up to the next item:
* <blockquote>
* <pre>
* X matches j if and only if limit[j] &lt;= X &lt; limit[j+1]
* X matches j if and only if limit[j] &le; X &lt; limit[j+1]
* </pre>
* </blockquote>
* If there is no match, then either the first or last index is used, depending
@ -85,21 +85,21 @@ import java.util.Arrays;
* <p>
* Here is a simple example that shows formatting and parsing:
* <blockquote>
* <pre>
* <pre>{@code
* double[] limits = {1,2,3,4,5,6,7};
* String[] dayOfWeekNames = {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"};
* ChoiceFormat form = new ChoiceFormat(limits, dayOfWeekNames);
* ParsePosition status = new ParsePosition(0);
* for (double i = 0.0; i &lt;= 8.0; ++i) {
* for (double i = 0.0; i <= 8.0; ++i) {
* status.setIndex(0);
* System.out.println(i + " -&gt; " + form.format(i) + " -&gt; "
* System.out.println(i + " -> " + form.format(i) + " -> "
* + form.parse(form.format(i),status));
* }
* </pre>
* }</pre>
* </blockquote>
* Here is a more complex example, with a pattern format:
* <blockquote>
* <pre>
* <pre>{@code
* double[] filelimits = {0,1,2};
* String[] filepart = {"are no files","is one file","are {2} files"};
* ChoiceFormat fileform = new ChoiceFormat(filelimits, filepart);
@ -107,20 +107,20 @@ import java.util.Arrays;
* MessageFormat pattform = new MessageFormat("There {0} on {1}");
* pattform.setFormats(testFormats);
* Object[] testArgs = {null, "ADisk", null};
* for (int i = 0; i &lt; 4; ++i) {
* for (int i = 0; i < 4; ++i) {
* testArgs[0] = new Integer(i);
* testArgs[2] = testArgs[0];
* System.out.println(pattform.format(testArgs));
* }
* </pre>
* }</pre>
* </blockquote>
* <p>
* Specifying a pattern for ChoiceFormat objects is fairly straightforward.
* For example:
* <blockquote>
* <pre>
* <pre>{@code
* ChoiceFormat fmt = new ChoiceFormat(
* "-1#is negative| 0#is zero or fraction | 1#is one |1.0&lt;is 1+ |2#is two |2&lt;is more than 2.");
* "-1#is negative| 0#is zero or fraction | 1#is one |1.0<is 1+ |2#is two |2<is more than 2.");
* System.out.println("Formatter Pattern : " + fmt.toPattern());
*
* System.out.println("Format with -INF : " + fmt.format(Double.NEGATIVE_INFINITY));
@ -133,25 +133,25 @@ import java.util.Arrays;
* System.out.println("Format with 2.1 : " + fmt.format(2.1));
* System.out.println("Format with NaN : " + fmt.format(Double.NaN));
* System.out.println("Format with +INF : " + fmt.format(Double.POSITIVE_INFINITY));
* </pre>
* }</pre>
* </blockquote>
* And the output result would be like the following:
* <blockquote>
* <pre>
* Format with -INF : is negative
* Format with -1.0 : is negative
* Format with 0 : is zero or fraction
* Format with 0.9 : is zero or fraction
* Format with 1.0 : is one
* Format with 1.5 : is 1+
* Format with 2 : is two
* Format with 2.1 : is more than 2.
* Format with NaN : is negative
* Format with +INF : is more than 2.
* </pre>
* <pre>{@code
* Format with -INF : is negative
* Format with -1.0 : is negative
* Format with 0 : is zero or fraction
* Format with 0.9 : is zero or fraction
* Format with 1.0 : is one
* Format with 1.5 : is 1+
* Format with 2 : is two
* Format with 2.1 : is more than 2.
* Format with NaN : is negative
* Format with +INF : is more than 2.
* }</pre>
* </blockquote>
*
* <h4><a name="synchronization">Synchronization</a></h4>
* <h3><a name="synchronization">Synchronization</a></h3>
*
* <p>
* Choice formats are not synchronized.
@ -255,6 +255,8 @@ public class ChoiceFormat extends NumberFormat {
/**
* Gets the pattern.
*
* @return the pattern string
*/
public String toPattern() {
StringBuffer result = new StringBuffer();
@ -305,6 +307,8 @@ public class ChoiceFormat extends NumberFormat {
/**
* Constructs with limits and corresponding formats based on the pattern.
*
* @param newPattern the new pattern string
* @see #applyPattern
*/
public ChoiceFormat(String newPattern) {
@ -313,6 +317,9 @@ public class ChoiceFormat extends NumberFormat {
/**
* Constructs with the limits and the corresponding formats.
*
* @param limits limits in ascending order
* @param formats corresponding format strings
* @see #setChoices
*/
public ChoiceFormat(double[] limits, String[] formats) {
@ -322,9 +329,9 @@ public class ChoiceFormat extends NumberFormat {
/**
* Set the choices to be used in formatting.
* @param limits contains the top value that you want
* parsed with that format,and should be in ascending sorted order. When
* parsed with that format, and should be in ascending sorted order. When
* formatting X, the choice will be the i, where
* limit[i] &lt;= X &lt; limit[i+1].
* limit[i] &le; X {@literal <} limit[i+1].
* If the limit array is not in ascending order, the results of formatting
* will be incorrect.
* @param formats are the formats you want to use for each limit.
@ -434,9 +441,12 @@ public class ChoiceFormat extends NumberFormat {
}
/**
* Finds the least double greater than d.
* If NaN, returns same value.
* Finds the least double greater than {@code d}.
* If {@code NaN}, returns same value.
* <p>Used to make half-open intervals.
*
* @param d the reference value
* @return the least double value greather than {@code d}
* @see #previousDouble
*/
public static final double nextDouble (double d) {
@ -444,8 +454,11 @@ public class ChoiceFormat extends NumberFormat {
}
/**
* Finds the greatest double less than d.
* If NaN, returns same value.
* Finds the greatest double less than {@code d}.
* If {@code NaN}, returns same value.
*
* @param d the reference value
* @return the greatest double value less than {@code d}
* @see #nextDouble
*/
public static final double previousDouble (double d) {
@ -553,15 +566,21 @@ public class ChoiceFormat extends NumberFormat {
static final long POSITIVEINFINITY = 0x7FF0000000000000L;
/**
* Finds the least double greater than d (if positive == true),
* or the greatest double less than d (if positive == false).
* If NaN, returns same value.
* Finds the least double greater than {@code d} (if {@code positive} is
* {@code true}), or the greatest double less than {@code d} (if
* {@code positive} is {@code false}).
* If {@code NaN}, returns same value.
*
* Does not affect floating-point flags,
* provided these member functions do not:
* Double.longBitsToDouble(long)
* Double.doubleToLongBits(double)
* Double.isNaN(double)
*
* @param d the reference value
* @param positive {@code true} if the least double is desired;
* {@code false} otherwise
* @return the least or greater double value
*/
public static double nextDouble (double d, boolean positive) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,14 +54,14 @@ import sun.text.normalizer.NormalizerBase;
* For example, consider the following in Spanish:
* <blockquote>
* <pre>
* "ca" -> the first key is key('c') and second key is key('a').
* "cha" -> the first key is key('ch') and second key is key('a').
* "ca" &rarr; the first key is key('c') and second key is key('a').
* "cha" &rarr; the first key is key('ch') and second key is key('a').
* </pre>
* </blockquote>
* And in German,
* <blockquote>
* <pre>
* "\u00e4b"-> the first key is key('a'), the second key is key('e'), and
* "\u00e4b" &rarr; the first key is key('a'), the second key is key('e'), and
* the third key is key('b').
* </pre>
* </blockquote>
@ -177,6 +177,8 @@ public final class CollationElementIterator
* means that when you change direction while iterating (i.e., call next() and
* then call previous(), or call previous() and then call next()), you'll get
* back the same element twice.</p>
*
* @return the next collation element
*/
public int next()
{
@ -272,6 +274,8 @@ public final class CollationElementIterator
* updates the pointer. This means that when you change direction while
* iterating (i.e., call next() and then call previous(), or call previous()
* and then call next()), you'll get back the same element twice.</p>
*
* @return the previous collation element
* @since 1.2
*/
public int previous()

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -68,28 +68,28 @@ package java.text;
* The following example shows how <code>CollationKey</code>s might be used
* to sort a list of <code>String</code>s.
* <blockquote>
* <pre>
* <pre>{@code
* // Create an array of CollationKeys for the Strings to be sorted.
* Collator myCollator = Collator.getInstance();
* CollationKey[] keys = new CollationKey[3];
* keys[0] = myCollator.getCollationKey("Tom");
* keys[1] = myCollator.getCollationKey("Dick");
* keys[2] = myCollator.getCollationKey("Harry");
* sort( keys );
* <br>
* sort(keys);
*
* //...
* <br>
*
* // Inside body of sort routine, compare keys this way
* if( keys[i].compareTo( keys[j] ) > 0 )
* if (keys[i].compareTo(keys[j]) > 0)
* // swap keys[i] and keys[j]
* <br>
*
* //...
* <br>
*
* // Finally, when we've returned from sort.
* System.out.println( keys[0].getSourceString() );
* System.out.println( keys[1].getSourceString() );
* System.out.println( keys[2].getSourceString() );
* </pre>
* System.out.println(keys[0].getSourceString());
* System.out.println(keys[1].getSourceString());
* System.out.println(keys[2].getSourceString());
* }</pre>
* </blockquote>
*
* @see Collator
@ -112,6 +112,8 @@ public abstract class CollationKey implements Comparable<CollationKey> {
/**
* Returns the String that this CollationKey represents.
*
* @return the source string of this CollationKey
*/
public String getSourceString() {
return source;
@ -123,6 +125,8 @@ public abstract class CollationKey implements Comparable<CollationKey> {
* could be legitimately compared, then one could compare the byte arrays
* for each of those keys to obtain the same result. Byte arrays are
* organized most significant byte first.
*
* @return a byte array representation of the CollationKey
*/
abstract public byte[] toByteArray();
@ -130,8 +134,8 @@ public abstract class CollationKey implements Comparable<CollationKey> {
/**
* CollationKey constructor.
*
* @param source - the source string.
* @exception NullPointerException if <code>source</code> is null.
* @param source the source string
* @exception NullPointerException if {@code source} is null
* @since 1.6
*/
protected CollationKey(String source) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -57,7 +57,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* {@code DateFormat} is an abstract class for date/time formatting subclasses which
* formats and parses dates or time in a language-independent manner.
* The date/time formatting subclass, such as {@link SimpleDateFormat}, allows for
* formatting (i.e., date -> text), parsing (text -> date), and
* formatting (i.e., date &rarr; text), parsing (text &rarr; date), and
* normalization. The date is represented as a <code>Date</code> object or
* as the milliseconds since January 1, 1970, 00:00:00 GMT.
*
@ -73,28 +73,36 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
*
* <p>To format a date for the current Locale, use one of the
* static factory methods:
* <pre>
* myString = DateFormat.getDateInstance().format(myDate);
* </pre>
* <blockquote>
* <pre>{@code
* myString = DateFormat.getDateInstance().format(myDate);
* }</pre>
* </blockquote>
* <p>If you are formatting multiple dates, it is
* more efficient to get the format and use it multiple times so that
* the system doesn't have to fetch the information about the local
* language and country conventions multiple times.
* <pre>
* DateFormat df = DateFormat.getDateInstance();
* for (int i = 0; i < myDate.length; ++i) {
* output.println(df.format(myDate[i]) + "; ");
* }
* </pre>
* <blockquote>
* <pre>{@code
* DateFormat df = DateFormat.getDateInstance();
* for (int i = 0; i < myDate.length; ++i) {
* output.println(df.format(myDate[i]) + "; ");
* }
* }</pre>
* </blockquote>
* <p>To format a date for a different Locale, specify it in the
* call to {@link #getDateInstance(int, Locale) getDateInstance()}.
* <pre>
* DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE);
* </pre>
* <blockquote>
* <pre>{@code
* DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE);
* }</pre>
* </blockquote>
* <p>You can use a DateFormat to parse also.
* <pre>
* myDate = df.parse(myString);
* </pre>
* <blockquote>
* <pre>{@code
* myDate = df.parse(myString);
* }</pre>
* </blockquote>
* <p>Use {@code getDateInstance} to get the normal date format for that country.
* There are other static factory methods available.
* Use {@code getTimeInstance} to get the time format for that country.
@ -125,7 +133,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* on the screen.
* </ul>
*
* <h4><a name="synchronization">Synchronization</a></h4>
* <h3><a name="synchronization">Synchronization</a></h3>
*
* <p>
* Date formats are not synchronized.
@ -581,6 +589,8 @@ public abstract class DateFormat extends Format {
/**
* Get a default date/time formatter that uses the SHORT style for both the
* date and the time.
*
* @return a date/time formatter
*/
public final static DateFormat getInstance() {
return getDateTimeInstance(SHORT, SHORT);
@ -653,9 +663,9 @@ public abstract class DateFormat extends Format {
/**
* Sets the time zone for the calendar of this {@code DateFormat} object.
* This method is equivalent to the following call.
* <blockquote><pre>
* getCalendar().setTimeZone(zone)
* </pre></blockquote>
* <blockquote><pre>{@code
* getCalendar().setTimeZone(zone)
* }</pre></blockquote>
*
* <p>The {@code TimeZone} set by this method is overwritten by a
* {@link #setCalendar(java.util.Calendar) setCalendar} call.
@ -673,9 +683,9 @@ public abstract class DateFormat extends Format {
/**
* Gets the time zone.
* This method is equivalent to the following call.
* <blockquote><pre>
* getCalendar().getTimeZone()
* </pre></blockquote>
* <blockquote><pre>{@code
* getCalendar().getTimeZone()
* }</pre></blockquote>
*
* @return the time zone associated with the calendar of DateFormat.
*/
@ -691,9 +701,9 @@ public abstract class DateFormat extends Format {
* inputs must match this object's format.
*
* <p>This method is equivalent to the following call.
* <blockquote><pre>
* getCalendar().setLenient(lenient)
* </pre></blockquote>
* <blockquote><pre>{@code
* getCalendar().setLenient(lenient)
* }</pre></blockquote>
*
* <p>This leniency value is overwritten by a call to {@link
* #setCalendar(java.util.Calendar) setCalendar()}.
@ -709,9 +719,9 @@ public abstract class DateFormat extends Format {
/**
* Tell whether date/time parsing is to be lenient.
* This method is equivalent to the following call.
* <blockquote><pre>
* getCalendar().isLenient()
* </pre></blockquote>
* <blockquote><pre>{@code
* getCalendar().isLenient()
* }</pre></blockquote>
*
* @return {@code true} if the {@link #calendar} is lenient;
* {@code false} otherwise.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -135,6 +135,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* implementations. For full locale coverage, use the
* {@link #getInstance(Locale) getInstance} method.
*
* @param locale the desired locale
* @see #getInstance(Locale)
* @exception java.util.MissingResourceException
* if the resources for the specified locale cannot be

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,7 +87,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* the <code>NumberFormat</code> factory methods, the pattern and symbols are
* read from localized <code>ResourceBundle</code>s.
*
* <h4>Patterns</h4>
* <h3>Patterns</h3>
*
* <code>DecimalFormat</code> patterns have the following syntax:
* <blockquote><pre>
@ -174,7 +174,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <blockquote>
* <table border=0 cellspacing=3 cellpadding=0 summary="Chart showing symbol,
* location, localized, and meaning.">
* <tr bgcolor="#ccccff">
* <tr style="background-color: rgb(204, 204, 255);">
* <th align=left>Symbol
* <th align=left>Location
* <th align=left>Localized?
@ -184,7 +184,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <td>Number
* <td>Yes
* <td>Digit
* <tr valign=top bgcolor="#eeeeff">
* <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
* <td><code>#</code>
* <td>Number
* <td>Yes
@ -194,7 +194,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <td>Number
* <td>Yes
* <td>Decimal separator or monetary decimal separator
* <tr valign=top bgcolor="#eeeeff">
* <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
* <td><code>-</code>
* <td>Number
* <td>Yes
@ -204,7 +204,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <td>Number
* <td>Yes
* <td>Grouping separator
* <tr valign=top bgcolor="#eeeeff">
* <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
* <td><code>E</code>
* <td>Number
* <td>Yes
@ -215,7 +215,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <td>Subpattern boundary
* <td>Yes
* <td>Separates positive and negative subpatterns
* <tr valign=top bgcolor="#eeeeff">
* <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
* <td><code>%</code>
* <td>Prefix or suffix
* <td>Yes
@ -225,7 +225,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* <td>Prefix or suffix
* <td>Yes
* <td>Multiply by 1000 and show as per mille value
* <tr valign=top bgcolor="#eeeeff">
* <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
* <td><code>&#164;</code> (<code>&#92;u00A4</code>)
* <td>Prefix or suffix
* <td>No
@ -248,7 +248,8 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
*
* <p>Numbers in scientific notation are expressed as the product of a mantissa
* and a power of ten, for example, 1234 can be expressed as 1.234 x 10^3. The
* mantissa is often in the range 1.0 <= x < 10.0, but it need not be.
* mantissa is often in the range 1.0 &le; x {@literal <} 10.0, but it need not
* be.
* <code>DecimalFormat</code> can be instructed to format and parse scientific
* notation <em>only via a pattern</em>; there is currently no factory method
* that creates a scientific notation format. In a pattern, the exponent
@ -336,13 +337,13 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
*
* <h4>Example</h4>
*
* <blockquote><pre>
* <blockquote><pre>{@code
* <strong>// Print out a number using the localized number, integer, currency,
* // and percent format for each locale</strong>
* Locale[] locales = NumberFormat.getAvailableLocales();
* double myNumber = -1234.56;
* NumberFormat form;
* for (int j=0; j<4; ++j) {
* for (int j = 0; j < 4; ++j) {
* System.out.println("FORMAT");
* for (int i = 0; i < locales.length; ++i) {
* if (locales[i].getCountry().length() == 0) {
@ -368,7 +369,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* } catch (ParseException e) {}
* }
* }
* </pre></blockquote>
* }</pre></blockquote>
*
* @see <a href="http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html">Java Tutorial</a>
* @see NumberFormat
@ -421,7 +422,7 @@ public class DecimalFormat extends NumberFormat {
* return the most appropriate sub-class of NumberFormat for a given
* locale.
*
* @param pattern A non-localized pattern string.
* @param pattern a non-localized pattern string.
* @exception NullPointerException if <code>pattern</code> is null
* @exception IllegalArgumentException if the given pattern is invalid.
* @see java.text.NumberFormat#getInstance
@ -2382,6 +2383,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the positive prefix.
* <P>Examples: +123, $123, sFr123
*
* @return the positive prefix
*/
public String getPositivePrefix () {
return positivePrefix;
@ -2390,6 +2393,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the positive prefix.
* <P>Examples: +123, $123, sFr123
*
* @param newValue the new positive prefix
*/
public void setPositivePrefix (String newValue) {
positivePrefix = newValue;
@ -2420,6 +2425,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the negative prefix.
* <P>Examples: -123, ($123) (with negative suffix), sFr-123
*
* @return the negative prefix
*/
public String getNegativePrefix () {
return negativePrefix;
@ -2428,6 +2435,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the negative prefix.
* <P>Examples: -123, ($123) (with negative suffix), sFr-123
*
* @param newValue the new negative prefix
*/
public void setNegativePrefix (String newValue) {
negativePrefix = newValue;
@ -2457,6 +2466,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the positive suffix.
* <P>Example: 123%
*
* @return the positive suffix
*/
public String getPositiveSuffix () {
return positiveSuffix;
@ -2465,6 +2476,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the positive suffix.
* <P>Example: 123%
*
* @param newValue the new positive suffix
*/
public void setPositiveSuffix (String newValue) {
positiveSuffix = newValue;
@ -2494,6 +2507,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the negative suffix.
* <P>Examples: -123%, ($123) (with positive suffixes)
*
* @return the negative suffix
*/
public String getNegativeSuffix () {
return negativeSuffix;
@ -2502,6 +2517,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the negative suffix.
* <P>Examples: 123%
*
* @param newValue the new negative suffix
*/
public void setNegativeSuffix (String newValue) {
negativeSuffix = newValue;
@ -2532,6 +2549,7 @@ public class DecimalFormat extends NumberFormat {
* Gets the multiplier for use in percent, per mille, and similar
* formats.
*
* @return the multiplier
* @see #setMultiplier(int)
*/
public int getMultiplier () {
@ -2549,6 +2567,7 @@ public class DecimalFormat extends NumberFormat {
* <P>Example: with multiplier 100, 1.23 is formatted as "123", and
* "123" is parsed into 1.23.
*
* @param newValue the new multiplier
* @see #getMultiplier
*/
public void setMultiplier (int newValue) {
@ -2571,6 +2590,8 @@ public class DecimalFormat extends NumberFormat {
* Return the grouping size. Grouping size is the number of digits between
* grouping separators in the integer portion of a number. For example,
* in the number "123,456.78", the grouping size is 3.
*
* @return the grouping size
* @see #setGroupingSize
* @see java.text.NumberFormat#isGroupingUsed
* @see java.text.DecimalFormatSymbols#getGroupingSeparator
@ -2585,6 +2606,8 @@ public class DecimalFormat extends NumberFormat {
* in the number "123,456.78", the grouping size is 3.
* <br>
* The value passed in is converted to a byte, which may lose information.
*
* @param newValue the new grouping size
* @see #getGroupingSize
* @see java.text.NumberFormat#setGroupingUsed
* @see java.text.DecimalFormatSymbols#setGroupingSeparator
@ -2597,7 +2620,10 @@ public class DecimalFormat extends NumberFormat {
/**
* Allows you to get the behavior of the decimal separator with integers.
* (The decimal separator will always appear with decimals.)
* <P>Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
* <P>Example: Decimal ON: 12345 &rarr; 12345.; OFF: 12345 &rarr; 12345
*
* @return {@code true} if the decimal separator is always shown;
* {@code false} otherwise
*/
public boolean isDecimalSeparatorAlwaysShown() {
return decimalSeparatorAlwaysShown;
@ -2606,7 +2632,10 @@ public class DecimalFormat extends NumberFormat {
/**
* Allows you to set the behavior of the decimal separator with integers.
* (The decimal separator will always appear with decimals.)
* <P>Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
* <P>Example: Decimal ON: 12345 &rarr; 12345.; OFF: 12345 &rarr; 12345
*
* @param newValue {@code true} if the decimal separator is always shown;
* {@code false} otherwise
*/
public void setDecimalSeparatorAlwaysShown(boolean newValue) {
decimalSeparatorAlwaysShown = newValue;
@ -2616,6 +2645,9 @@ public class DecimalFormat extends NumberFormat {
/**
* Returns whether the {@link #parse(java.lang.String, java.text.ParsePosition)}
* method returns <code>BigDecimal</code>. The default value is false.
*
* @return {@code true} if the parse method returns BigDecimal;
* {@code false} otherwise
* @see #setParseBigDecimal
* @since 1.5
*/
@ -2626,6 +2658,9 @@ public class DecimalFormat extends NumberFormat {
/**
* Sets whether the {@link #parse(java.lang.String, java.text.ParsePosition)}
* method returns <code>BigDecimal</code>.
*
* @param newValue {@code true} if the parse method returns BigDecimal;
* {@code false} otherwise
* @see #isParseBigDecimal
* @since 1.5
*/
@ -2712,6 +2747,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Synthesizes a pattern string that represents the current state
* of this Format object.
*
* @return a pattern string
* @see #applyPattern
*/
public String toPattern() {
@ -2721,6 +2758,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Synthesizes a localized pattern string that represents the current
* state of this Format object.
*
* @return a localized pattern string
* @see #applyPattern
*/
public String toLocalizedPattern() {
@ -3049,7 +3088,7 @@ public class DecimalFormat extends NumberFormat {
* by this routine, since that is the typical end-user desire;
* use setMaximumInteger if you want to set a real value.
* For negative numbers, use a second pattern, separated by a semicolon
* <P>Example <code>"#,#00.0#"</code> -> 1,234.56
* <P>Example <code>"#,#00.0#"</code> &rarr; 1,234.56
* <P>This means a minimum of 2 integer digits, 1 fraction digit, and
* a maximum of 2 fraction digits.
* <p>Example: <code>"#,#00.0#;(#,#00.0#)"</code> for negatives in
@ -3057,6 +3096,7 @@ public class DecimalFormat extends NumberFormat {
* <p>In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
* @exception NullPointerException if <code>pattern</code> is null
* @exception IllegalArgumentException if the given pattern is invalid.
*/
@ -3075,7 +3115,7 @@ public class DecimalFormat extends NumberFormat {
* by this routine, since that is the typical end-user desire;
* use setMaximumInteger if you want to set a real value.
* For negative numbers, use a second pattern, separated by a semicolon
* <P>Example <code>"#,#00.0#"</code> -> 1,234.56
* <P>Example <code>"#,#00.0#"</code> &rarr; 1,234.56
* <P>This means a minimum of 2 integer digits, 1 fraction digit, and
* a maximum of 2 fraction digits.
* <p>Example: <code>"#,#00.0#;(#,#00.0#)"</code> for negatives in
@ -3083,6 +3123,7 @@ public class DecimalFormat extends NumberFormat {
* <p>In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
* @exception NullPointerException if <code>pattern</code> is null
* @exception IllegalArgumentException if the given pattern is invalid.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -106,6 +106,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* This may return a {@code NumberFormat} instance with the Thai numbering system,
* instead of the Latin numbering system.
*
* @param locale the desired locale
* @exception NullPointerException if <code>locale</code> is null
*/
public DecimalFormatSymbols( Locale locale ) {
@ -122,7 +123,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* implementations. It must contain at least a <code>Locale</code>
* instance equal to {@link java.util.Locale#US Locale.US}.
*
* @return An array of locales for which localized
* @return an array of locales for which localized
* <code>DecimalFormatSymbols</code> instances are available.
* @since 1.6
*/
@ -166,6 +167,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* </pre>
* This may return a {@code NumberFormat} instance with the Thai numbering system,
* instead of the Latin numbering system.
*
* @param locale the desired locale.
* @return a <code>DecimalFormatSymbols</code> instance.
* @exception NullPointerException if <code>locale</code> is null
@ -185,6 +187,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for zero. Different for Arabic, etc.
*
* @return the character used for zero
*/
public char getZeroDigit() {
return zeroDigit;
@ -192,6 +196,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for zero. Different for Arabic, etc.
*
* @param zeroDigit the character used for zero
*/
public void setZeroDigit(char zeroDigit) {
this.zeroDigit = zeroDigit;
@ -199,6 +205,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for thousands separator. Different for French, etc.
*
* @return the grouping separator
*/
public char getGroupingSeparator() {
return groupingSeparator;
@ -206,6 +214,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for thousands separator. Different for French, etc.
*
* @param groupingSeparator the grouping separator
*/
public void setGroupingSeparator(char groupingSeparator) {
this.groupingSeparator = groupingSeparator;
@ -213,6 +223,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for decimal sign. Different for French, etc.
*
* @return the character used for decimal sign
*/
public char getDecimalSeparator() {
return decimalSeparator;
@ -220,6 +232,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for decimal sign. Different for French, etc.
*
* @param decimalSeparator the character used for decimal sign
*/
public void setDecimalSeparator(char decimalSeparator) {
this.decimalSeparator = decimalSeparator;
@ -227,6 +241,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for per mille sign. Different for Arabic, etc.
*
* @return the character used for per mille sign
*/
public char getPerMill() {
return perMill;
@ -234,6 +250,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for per mille sign. Different for Arabic, etc.
*
* @param perMill the character used for per mille sign
*/
public void setPerMill(char perMill) {
this.perMill = perMill;
@ -241,6 +259,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for percent sign. Different for Arabic, etc.
*
* @return the character used for percent sign
*/
public char getPercent() {
return percent;
@ -248,6 +268,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for percent sign. Different for Arabic, etc.
*
* @param percent the character used for percent sign
*/
public void setPercent(char percent) {
this.percent = percent;
@ -255,6 +277,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for a digit in a pattern.
*
* @return the character used for a digit in a pattern
*/
public char getDigit() {
return digit;
@ -262,6 +286,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for a digit in a pattern.
*
* @param digit the character used for a digit in a pattern
*/
public void setDigit(char digit) {
this.digit = digit;
@ -270,6 +296,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used to separate positive and negative subpatterns
* in a pattern.
*
* @return the pattern separator
*/
public char getPatternSeparator() {
return patternSeparator;
@ -278,6 +306,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used to separate positive and negative subpatterns
* in a pattern.
*
* @param patternSeparator the pattern separator
*/
public void setPatternSeparator(char patternSeparator) {
this.patternSeparator = patternSeparator;
@ -286,6 +316,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the string used to represent infinity. Almost always left
* unchanged.
*
* @return the string representing infinity
*/
public String getInfinity() {
return infinity;
@ -294,6 +326,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the string used to represent infinity. Almost always left
* unchanged.
*
* @param infinity the string representing infinity
*/
public void setInfinity(String infinity) {
this.infinity = infinity;
@ -302,6 +336,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the string used to represent "not a number". Almost always left
* unchanged.
*
* @return the string representing "not a number"
*/
public String getNaN() {
return NaN;
@ -310,6 +346,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the string used to represent "not a number". Almost always left
* unchanged.
*
* @param NaN the string representing "not a number"
*/
public void setNaN(String NaN) {
this.NaN = NaN;
@ -319,6 +357,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* Gets the character used to represent minus sign. If no explicit
* negative format is specified, one is formed by prefixing
* minusSign to the positive format.
*
* @return the character representing minus sign
*/
public char getMinusSign() {
return minusSign;
@ -328,6 +368,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* Sets the character used to represent minus sign. If no explicit
* negative format is specified, one is formed by prefixing
* minusSign to the positive format.
*
* @param minusSign the character representing minus sign
*/
public void setMinusSign(char minusSign) {
this.minusSign = minusSign;
@ -336,6 +378,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the currency symbol for the currency of these
* DecimalFormatSymbols in their locale.
*
* @return the currency symbol
* @since 1.2
*/
public String getCurrencySymbol()
@ -346,6 +390,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the currency symbol for the currency of these
* DecimalFormatSymbols in their locale.
*
* @param currency the currency symbol
* @since 1.2
*/
public void setCurrencySymbol(String currency)
@ -356,6 +402,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the ISO 4217 currency code of the currency of these
* DecimalFormatSymbols.
*
* @return the currency code
* @since 1.2
*/
public String getInternationalCurrencySymbol()
@ -374,6 +422,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* then the currency attribute is set to null and the currency symbol
* attribute is not modified.
*
* @param currencyCode the currency code
* @see #setCurrency
* @see #setCurrencySymbol
* @since 1.2
@ -427,6 +476,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the monetary decimal separator.
*
* @return the monetary decimal separator
* @since 1.2
*/
public char getMonetaryDecimalSeparator()
@ -436,6 +487,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the monetary decimal separator.
*
* @param sep the monetary decimal separator
* @since 1.2
*/
public void setMonetaryDecimalSeparator(char sep)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -100,6 +100,7 @@ public class FieldPosition {
* identified by constants, whose names typically end with _FIELD,
* in the various subclasses of Format.
*
* @param field the field identifier
* @see java.text.NumberFormat#INTEGER_FIELD
* @see java.text.NumberFormat#FRACTION_FIELD
* @see java.text.DateFormat#YEAR_FIELD
@ -157,6 +158,8 @@ public class FieldPosition {
/**
* Retrieves the field identifier.
*
* @return the field identifier
*/
public int getField() {
return field;
@ -164,6 +167,8 @@ public class FieldPosition {
/**
* Retrieves the index of the first character in the requested field.
*
* @return the begin index
*/
public int getBeginIndex() {
return beginIndex;
@ -172,6 +177,8 @@ public class FieldPosition {
/**
* Retrieves the index of the character following the last character in the
* requested field.
*
* @return the end index
*/
public int getEndIndex() {
return endIndex;
@ -179,6 +186,8 @@ public class FieldPosition {
/**
* Sets the begin index. For use by subclasses of Format.
*
* @param bi the begin index
* @since 1.2
*/
public void setBeginIndex(int bi) {
@ -187,6 +196,8 @@ public class FieldPosition {
/**
* Sets the end index. For use by subclasses of Format.
*
* @param ei the end index
* @since 1.2
*/
public void setEndIndex(int ei) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -58,7 +58,7 @@ import java.io.Serializable;
* no separator in between, and in this case the <code>parseObject</code> could
* not tell which digits belong to which number.
*
* <h4>Subclassing</h4>
* <h3>Subclassing</h3>
*
* <p>
* The Java Platform provides three specialized subclasses of <code>Format</code>--

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -68,7 +68,7 @@ import java.util.Locale;
* behavior is defined by the pattern that you provide as well as the
* subformats used for inserted arguments.
*
* <h4><a name="patterns">Patterns and Their Interpretation</a></h4>
* <h3><a name="patterns">Patterns and Their Interpretation</a></h3>
*
* <code>MessageFormat</code> uses patterns of the following form:
* <blockquote><pre>
@ -287,10 +287,10 @@ import java.util.Locale;
* You can create the <code>ChoiceFormat</code> programmatically, as in the
* above example, or by using a pattern. See {@link ChoiceFormat}
* for more information.
* <blockquote><pre>
* <blockquote><pre>{@code
* form.applyPattern(
* "There {0,choice,0#are no files|1#is one file|1&lt;are {0,number,integer} files}.");
* </pre></blockquote>
* "There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");
* }</pre></blockquote>
*
* <p>
* <strong>Note:</strong> As we see above, the string produced
@ -778,7 +778,7 @@ public class MessageFormat extends Format {
* <tr>
* <td><code>instanceof ChoiceFormat</code>
* <td><i>any</i>
* <td><code>subformat.format(argument).indexOf('{') >= 0 ?<br>
* <td><code>subformat.format(argument).indexOf('{') &gt;= 0 ?<br>
* (new MessageFormat(subformat.format(argument), getLocale())).format(argument) :
* subformat.format(argument)</code>
* <tr>
@ -811,6 +811,8 @@ public class MessageFormat extends Format {
* @param result where text is appended.
* @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field.
* @return the string buffer passed in as {@code result}, with formatted
* text appended
* @exception IllegalArgumentException if an argument in the
* <code>arguments</code> array is not of the type
* expected by the format element(s) that use it.
@ -828,6 +830,9 @@ public class MessageFormat extends Format {
* <code>(new {@link #MessageFormat(String) MessageFormat}(pattern)).{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}(arguments, new StringBuffer(), null).toString()</code>
* </blockquote>
*
* @param pattern the pattern string
* @param arguments object(s) to format
* @return the formatted string
* @exception IllegalArgumentException if the pattern is invalid,
* or if an argument in the <code>arguments</code> array
* is not of the type expected by the format element(s)
@ -940,6 +945,10 @@ public class MessageFormat extends Format {
* is comparing against the pattern "AAD {0} BBB", the error index is
* 0. When an error occurs, the call to this method will return null.
* If the source is null, return an empty array.
*
* @param source the string to parse
* @param pos the parse position
* @return an array of parsed objects
*/
public Object[] parse(String source, ParsePosition pos) {
if (source == null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,14 +55,12 @@ import sun.text.normalizer.NormalizerImpl;
*
* <p><pre>
* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE</pre>
* </p>
*
* or as two separate characters (the "decomposed" form):
*
* <p><pre>
* U+0041 LATIN CAPITAL LETTER A
* U+0301 COMBINING ACUTE ACCENT</pre>
* </p>
*
* To a user of your program, however, both of these sequences should be
* treated as the same "user-level" character "A with acute accent". When you
@ -78,13 +76,11 @@ import sun.text.normalizer.NormalizerImpl;
* U+0066 LATIN SMALL LETTER F
* U+0066 LATIN SMALL LETTER F
* U+0069 LATIN SMALL LETTER I</pre>
* </p>
*
* or as the single character
*
* <p><pre>
* U+FB03 LATIN SMALL LIGATURE FFI</pre>
* </p>
*
* The ffi ligature is not a distinct semantic character, and strictly speaking
* it shouldn't be in Unicode at all, but it was included for compatibility

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -73,34 +73,34 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* To format a number for the current Locale, use one of the factory
* class methods:
* <blockquote>
* <pre>
* myString = NumberFormat.getInstance().format(myNumber);
* </pre>
* <pre>{@code
* myString = NumberFormat.getInstance().format(myNumber);
* }</pre>
* </blockquote>
* If you are formatting multiple numbers, it is
* more efficient to get the format and use it multiple times so that
* the system doesn't have to fetch the information about the local
* language and country conventions multiple times.
* <blockquote>
* <pre>
* <pre>{@code
* NumberFormat nf = NumberFormat.getInstance();
* for (int i = 0; i < myNumber.length; ++i) {
* output.println(nf.format(myNumber[i]) + "; ");
* }
* </pre>
* }</pre>
* </blockquote>
* To format a number for a different Locale, specify it in the
* call to <code>getInstance</code>.
* <blockquote>
* <pre>
* <pre>{@code
* NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
* </pre>
* }</pre>
* </blockquote>
* You can also use a <code>NumberFormat</code> to parse numbers:
* <blockquote>
* <pre>
* <pre>{@code
* myNumber = nf.parse(myString);
* </pre>
* }</pre>
* </blockquote>
* Use <code>getInstance</code> or <code>getNumberInstance</code> to get the
* normal number format. Use <code>getIntegerInstance</code> to get an
@ -125,8 +125,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* the detailed description for each these control methods,
* <p>
* setParseIntegerOnly : only affects parsing, e.g.
* if true, "3456.78" -> 3456 (and leaves the parse position just after index 6)
* if false, "3456.78" -> 3456.78 (and leaves the parse position just after index 8)
* if true, "3456.78" &rarr; 3456 (and leaves the parse position just after index 6)
* if false, "3456.78" &rarr; 3456.78 (and leaves the parse position just after index 8)
* This is independent of formatting. If you want to not show a decimal point
* where there might be no digits after the decimal point, use
* setDecimalSeparatorAlwaysShown.
@ -134,8 +134,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* setDecimalSeparatorAlwaysShown : only affects formatting, and only where
* there might be no digits after the decimal point, such as with a pattern
* like "#,##0.##", e.g.,
* if true, 3456.00 -> "3,456."
* if false, 3456.00 -> "3456"
* if true, 3456.00 &rarr; "3,456."
* if false, 3456.00 &rarr; "3456"
* This is independent of parsing. If you want parsing to stop at the decimal
* point, use setParseIntegerOnly.
*
@ -166,7 +166,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* numbers: "(12)" for -12.
* </ol>
*
* <h4><a name="synchronization">Synchronization</a></h4>
* <h3><a name="synchronization">Synchronization</a></h3>
*
* <p>
* Number formats are generally not synchronized.
@ -280,6 +280,9 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
*
* @param number the double number to format
* @return the formatted String
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@ -302,6 +305,9 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
*
* @param number the long number to format
* @return the formatted String
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@ -313,6 +319,12 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
*
* @param number the double number to format
* @param toAppendTo the StringBuffer to which the formatted text is to be
* appended
* @param pos the field position
* @return the formatted StringBuffer
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@ -323,6 +335,12 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
*
* @param number the long number to format
* @param toAppendTo the StringBuffer to which the formatted text is to be
* appended
* @param pos the field position
* @return the formatted StringBuffer
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@ -339,6 +357,10 @@ public abstract class NumberFormat extends Format {
* after the 1).
* Does not throw an exception; if no object can be parsed, index is
* unchanged!
*
* @param source the String to parse
* @param parsePosition the parse position
* @return the parsed value
* @see java.text.NumberFormat#isParseIntegerOnly
* @see java.text.Format#parseObject
*/
@ -373,6 +395,9 @@ public abstract class NumberFormat extends Format {
* would stop at the "." character. Of course, the exact format accepted
* by the parse operation is locale dependant and determined by sub-classes
* of NumberFormat.
*
* @return {@code true} if numbers should be parsed as integers only;
* {@code false} otherwise
*/
public boolean isParseIntegerOnly() {
return parseIntegerOnly;
@ -380,6 +405,9 @@ public abstract class NumberFormat extends Format {
/**
* Sets whether or not numbers should be parsed as integers only.
*
* @param value {@code true} if numbers should be parsed as integers only;
* {@code false} otherwise
* @see #isParseIntegerOnly
*/
public void setParseIntegerOnly(boolean value) {
@ -393,6 +421,9 @@ public abstract class NumberFormat extends Format {
* {@link java.util.Locale.Category#FORMAT FORMAT} locale.
* This is the same as calling
* {@link #getNumberInstance() getNumberInstance()}.
*
* @return the {@code NumberFormat} instance for general-purpose number
* formatting
*/
public final static NumberFormat getInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE);
@ -402,6 +433,10 @@ public abstract class NumberFormat extends Format {
* Returns a general-purpose number format for the specified locale.
* This is the same as calling
* {@link #getNumberInstance(java.util.Locale) getNumberInstance(inLocale)}.
*
* @param inLocale the desired locale
* @return the {@code NumberFormat} instance for general-purpose number
* formatting
*/
public static NumberFormat getInstance(Locale inLocale) {
return getInstance(inLocale, NUMBERSTYLE);
@ -413,6 +448,9 @@ public abstract class NumberFormat extends Format {
* <p>This is equivalent to calling
* {@link #getNumberInstance(Locale)
* getNumberInstance(Locale.getDefault(Locale.Category.FORMAT))}.
*
* @return the {@code NumberFormat} instance for general-purpose number
* formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@ -422,6 +460,10 @@ public abstract class NumberFormat extends Format {
/**
* Returns a general-purpose number format for the specified locale.
*
* @param inLocale the desired locale
* @return the {@code NumberFormat} instance for general-purpose number
* formatting
*/
public static NumberFormat getNumberInstance(Locale inLocale) {
return getInstance(inLocale, NUMBERSTYLE);
@ -457,6 +499,7 @@ public abstract class NumberFormat extends Format {
* and to parse only the integer part of an input string (see {@link
* #isParseIntegerOnly isParseIntegerOnly}).
*
* @param inLocale the desired locale
* @see #getRoundingMode()
* @return a number format for integer values
* @since 1.4
@ -472,6 +515,7 @@ public abstract class NumberFormat extends Format {
* {@link #getCurrencyInstance(Locale)
* getCurrencyInstance(Locale.getDefault(Locale.Category.FORMAT))}.
*
* @return the {@code NumberFormat} instance for currency formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@ -481,6 +525,9 @@ public abstract class NumberFormat extends Format {
/**
* Returns a currency format for the specified locale.
*
* @param inLocale the desired locale
* @return the {@code NumberFormat} instance for currency formatting
*/
public static NumberFormat getCurrencyInstance(Locale inLocale) {
return getInstance(inLocale, CURRENCYSTYLE);
@ -493,6 +540,7 @@ public abstract class NumberFormat extends Format {
* {@link #getPercentInstance(Locale)
* getPercentInstance(Locale.getDefault(Locale.Category.FORMAT))}.
*
* @return the {@code NumberFormat} instance for percentage formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@ -502,6 +550,9 @@ public abstract class NumberFormat extends Format {
/**
* Returns a percentage format for the specified locale.
*
* @param inLocale the desired locale
* @return the {@code NumberFormat} instance for percentage formatting
*/
public static NumberFormat getPercentInstance(Locale inLocale) {
return getInstance(inLocale, PERCENTSTYLE);
@ -516,6 +567,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns a scientific format for the specified locale.
*
* @param inLocale the desired locale
*/
/*public*/ static NumberFormat getScientificInstance(Locale inLocale) {
return getInstance(inLocale, SCIENTIFICSTYLE);
@ -586,6 +639,9 @@ public abstract class NumberFormat extends Format {
* English locale, with grouping on, the number 1234567 might be formatted
* as "1,234,567". The grouping separator as well as the size of each group
* is locale dependant and is determined by sub-classes of NumberFormat.
*
* @return {@code true} if grouping is used;
* {@code false} otherwise
* @see #setGroupingUsed
*/
public boolean isGroupingUsed() {
@ -594,6 +650,9 @@ public abstract class NumberFormat extends Format {
/**
* Set whether or not grouping will be used in this format.
*
* @param newValue {@code true} if grouping is used;
* {@code false} otherwise
* @see #isGroupingUsed
*/
public void setGroupingUsed(boolean newValue) {
@ -603,6 +662,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the maximum number of digits allowed in the integer portion of a
* number.
*
* @return the maximum number of digits
* @see #setMaximumIntegerDigits
*/
public int getMaximumIntegerDigits() {
@ -611,10 +672,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the maximum number of digits allowed in the integer portion of a
* number. maximumIntegerDigits must be >= minimumIntegerDigits. If the
* number. maximumIntegerDigits must be &ge; minimumIntegerDigits. If the
* new value for maximumIntegerDigits is less than the current value
* of minimumIntegerDigits, then minimumIntegerDigits will also be set to
* the new value.
*
* @param newValue the maximum number of integer digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@ -630,6 +692,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the minimum number of digits allowed in the integer portion of a
* number.
*
* @return the minimum number of digits
* @see #setMinimumIntegerDigits
*/
public int getMinimumIntegerDigits() {
@ -638,10 +702,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the minimum number of digits allowed in the integer portion of a
* number. minimumIntegerDigits must be <= maximumIntegerDigits. If the
* number. minimumIntegerDigits must be &le; maximumIntegerDigits. If the
* new value for minimumIntegerDigits exceeds the current value
* of maximumIntegerDigits, then maximumIntegerDigits will also be set to
* the new value
*
* @param newValue the minimum number of integer digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@ -657,6 +722,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the maximum number of digits allowed in the fraction portion of a
* number.
*
* @return the maximum number of digits.
* @see #setMaximumFractionDigits
*/
public int getMaximumFractionDigits() {
@ -665,10 +732,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the maximum number of digits allowed in the fraction portion of a
* number. maximumFractionDigits must be >= minimumFractionDigits. If the
* number. maximumFractionDigits must be &ge; minimumFractionDigits. If the
* new value for maximumFractionDigits is less than the current value
* of minimumFractionDigits, then minimumFractionDigits will also be set to
* the new value.
*
* @param newValue the maximum number of fraction digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@ -684,6 +752,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the minimum number of digits allowed in the fraction portion of a
* number.
*
* @return the minimum number of digits
* @see #setMinimumFractionDigits
*/
public int getMinimumFractionDigits() {
@ -692,10 +762,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the minimum number of digits allowed in the fraction portion of a
* number. minimumFractionDigits must be <= maximumFractionDigits. If the
* number. minimumFractionDigits must be &le; maximumFractionDigits. If the
* new value for minimumFractionDigits exceeds the current value
* of maximumFractionDigits, then maximumIntegerDigits will also be set to
* the new value
*
* @param newValue the minimum number of fraction digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,6 +55,7 @@ class ParseException extends Exception {
* Constructs a ParseException with the specified detail message and
* offset.
* A detail message is a String that describes this particular exception.
*
* @param s the detail message
* @param errorOffset the position where the error is found while parsing.
*/
@ -65,6 +66,8 @@ class ParseException extends Exception {
/**
* Returns the position where the error was found.
*
* @return the position where the error was found
*/
public int getErrorOffset () {
return errorOffset;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,6 +69,8 @@ public class ParsePosition {
* Retrieve the current parse position. On input to a parse method, this
* is the index of the character at which parsing will begin; on output, it
* is the index of the character following the last character parsed.
*
* @return the current parse position
*/
public int getIndex() {
return index;
@ -76,6 +78,8 @@ public class ParsePosition {
/**
* Set the current parse position.
*
* @param index the current parse position
*/
public void setIndex(int index) {
this.index = index;
@ -83,6 +87,8 @@ public class ParsePosition {
/**
* Create a new ParsePosition with the given initial index.
*
* @param index initial index
*/
public ParsePosition(int index) {
this.index = index;
@ -91,6 +97,8 @@ public class ParsePosition {
* Set the index at which a parse error occurred. Formatters
* should set this before returning an error code from their
* parseObject method. The default value is -1 if this is not set.
*
* @param ei the index at which an error occurred
* @since 1.2
*/
public void setErrorIndex(int ei)
@ -101,12 +109,15 @@ public class ParsePosition {
/**
* Retrieve the index at which an error occurred, or -1 if the
* error index has not been set.
*
* @return the index at which an error occurred
* @since 1.2
*/
public int getErrorIndex()
{
return errorIndex;
}
/**
* Overrides equals
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -68,17 +68,17 @@ import java.util.Locale;
* &lt;reset&gt; &lt;text-argument&gt;
* </pre>
* The definitions of the rule elements is as follows:
* <UL Type=disc>
* <UL>
* <LI><strong>Text-Argument</strong>: A text-argument is any sequence of
* characters, excluding special characters (that is, common
* whitespace characters [0009-000D, 0020] and rule syntax characters
* [0021-002F, 003A-0040, 005B-0060, 007B-007E]). If those
* characters are desired, you can put them in single quotes
* (e.g. ampersand => '&'). Note that unquoted white space characters
* (e.g. ampersand =&gt; '&amp;'). Note that unquoted white space characters
* are ignored; e.g. <code>b c</code> is treated as <code>bc</code>.
* <LI><strong>Modifier</strong>: There are currently two modifiers that
* turn on special collation rules.
* <UL Type=square>
* <UL>
* <LI>'@' : Turns on backwards sorting of accents (secondary
* differences), as in French.
* <LI>'!' : Turns on Thai/Lao vowel-consonant swapping. If this
@ -91,7 +91,7 @@ import java.util.Locale;
* </UL>
* <p>'@' : Indicates that accents are sorted backwards, as in French.
* <LI><strong>Relation</strong>: The relations are the following:
* <UL Type=square>
* <UL>
* <LI>'&lt;' : Greater, as a letter difference (primary)
* <LI>';' : Greater, as an accent difference (secondary)
* <LI>',' : Greater, as a case difference (tertiary)
@ -100,7 +100,7 @@ import java.util.Locale;
* <LI><strong>Reset</strong>: There is a single reset
* which is used primarily for contractions and expansions, but which
* can also be used to add a modification at the end of a set of rules.
* <p>'&' : Indicates that the next rule follows the position to where
* <p>'&amp;' : Indicates that the next rule follows the position to where
* the reset text-argument would be sorted.
* </UL>
*
@ -166,7 +166,7 @@ import java.util.Locale;
* <p><strong>Errors</strong>
* <p>
* The following are errors:
* <UL Type=disc>
* <UL>
* <LI>A text-argument contains unquoted punctuation symbols
* (e.g. "a &lt; b-c &lt; d").
* <LI>A relation or reset character not followed by a text-argument
@ -206,8 +206,8 @@ import java.util.Locale;
* String Norwegian = "&lt; a, A &lt; b, B &lt; c, C &lt; d, D &lt; e, E &lt; f, F &lt; g, G &lt; h, H &lt; i, I" +
* "&lt; j, J &lt; k, K &lt; l, L &lt; m, M &lt; n, N &lt; o, O &lt; p, P &lt; q, Q &lt; r, R" +
* "&lt; s, S &lt; t, T &lt; u, U &lt; v, V &lt; w, W &lt; x, X &lt; y, Y &lt; z, Z" +
* "&lt; &#92;u00E6, &#92;u00C6" + // Latin letter ae & AE
* "&lt; &#92;u00F8, &#92;u00D8" + // Latin letter o & O with stroke
* "&lt; &#92;u00E6, &#92;u00C6" + // Latin letter ae &amp; AE
* "&lt; &#92;u00F8, &#92;u00D8" + // Latin letter o &amp; O with stroke
* "&lt; &#92;u00E5 = a&#92;u030A," + // Latin letter a with ring above
* " &#92;u00C5 = A&#92;u030A;" + // Latin letter A with ring above
* " aa, AA";
@ -232,9 +232,9 @@ import java.util.Locale;
* + ";&#92;u030B;&#92;u030C;&#92;u030D;&#92;u030E" // main accents
* + ";&#92;u030F;&#92;u0310;&#92;u0311;&#92;u0312" // main accents
* + "&lt; a , A ; ae, AE ; &#92;u00e6 , &#92;u00c6"
* + "&lt; b , B &lt; c, C &lt; e, E & C &lt; d, D";
* + "&lt; b , B &lt; c, C &lt; e, E &amp; C &lt; d, D";
* // change the order of accent characters
* String addOn = "& &#92;u0300 ; &#92;u0308 ; &#92;u0302";
* String addOn = "&amp; &#92;u0300 ; &#92;u0308 ; &#92;u0302";
* RuleBasedCollator myCollator = new RuleBasedCollator(oldRules + addOn);
* </pre>
* </blockquote>
@ -274,7 +274,7 @@ public class RuleBasedCollator extends Collator{
* @param rules the collation rules to build the collation table from.
* @exception ParseException A format exception
* will be thrown if the build process of the rules fails. For
* example, build rule "a < ? < d" will cause the constructor to
* example, build rule "a &lt; ? &lt; d" will cause the constructor to
* throw the ParseException because the '?' is not quoted.
*/
public RuleBasedCollator(String rules) throws ParseException {
@ -320,7 +320,10 @@ public class RuleBasedCollator extends Collator{
}
/**
* Return a CollationElementIterator for the given String.
* Returns a CollationElementIterator for the given String.
*
* @param source the string to be collated
* @return a {@code CollationElementIterator} object
* @see java.text.CollationElementIterator
*/
public CollationElementIterator getCollationElementIterator(String source) {
@ -328,7 +331,10 @@ public class RuleBasedCollator extends Collator{
}
/**
* Return a CollationElementIterator for the given String.
* Returns a CollationElementIterator for the given CharacterIterator.
*
* @param source the character iterator to be collated
* @return a {@code CollationElementIterator} object
* @see java.text.CollationElementIterator
* @since 1.2
*/

View File

@ -59,7 +59,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
/**
* <code>SimpleDateFormat</code> is a concrete class for formatting and
* parsing dates in a locale-sensitive manner. It allows for formatting
* (date -> text), parsing (text -> date), and normalization.
* (date &rarr; text), parsing (text &rarr; date), and normalization.
*
* <p>
* <code>SimpleDateFormat</code> allows you to start by choosing
@ -73,7 +73,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* For more information on using these methods, see
* {@link DateFormat}.
*
* <h4>Date and Time Patterns</h4>
* <h3>Date and Time Patterns</h3>
* <p>
* Date and time formats are specified by <em>date and time pattern</em>
* strings.
@ -93,7 +93,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <code>'z'</code> are reserved):
* <blockquote>
* <table border=0 cellspacing=3 cellpadding=0 summary="Chart shows pattern letters, date/time component, presentation, and examples.">
* <tr bgcolor="#ccccff">
* <tr style="background-color: rgb(204, 204, 255);">
* <th align=left>Letter
* <th align=left>Date or Time Component
* <th align=left>Presentation
@ -103,7 +103,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Era designator
* <td><a href="#text">Text</a>
* <td><code>AD</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>y</code>
* <td>Year
* <td><a href="#year">Year</a>
@ -113,7 +113,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Week year
* <td><a href="#year">Year</a>
* <td><code>2009</code>; <code>09</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>M</code>
* <td>Month in year (context sensitive)
* <td><a href="#month">Month</a>
@ -123,7 +123,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Month in year (standalone form)
* <td><a href="#month">Month</a>
* <td><code>July</code>; <code>Jul</code>; <code>07</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>w</code>
* <td>Week in year
* <td><a href="#number">Number</a>
@ -133,7 +133,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Week in month
* <td><a href="#number">Number</a>
* <td><code>2</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>D</code>
* <td>Day in year
* <td><a href="#number">Number</a>
@ -143,7 +143,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Day in month
* <td><a href="#number">Number</a>
* <td><code>10</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>F</code>
* <td>Day of week in month
* <td><a href="#number">Number</a>
@ -153,7 +153,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Day name in week
* <td><a href="#text">Text</a>
* <td><code>Tuesday</code>; <code>Tue</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>u</code>
* <td>Day number of week (1 = Monday, ..., 7 = Sunday)
* <td><a href="#number">Number</a>
@ -163,7 +163,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Am/pm marker
* <td><a href="#text">Text</a>
* <td><code>PM</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>H</code>
* <td>Hour in day (0-23)
* <td><a href="#number">Number</a>
@ -173,7 +173,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Hour in day (1-24)
* <td><a href="#number">Number</a>
* <td><code>24</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>K</code>
* <td>Hour in am/pm (0-11)
* <td><a href="#number">Number</a>
@ -183,7 +183,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Hour in am/pm (1-12)
* <td><a href="#number">Number</a>
* <td><code>12</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>m</code>
* <td>Minute in hour
* <td><a href="#number">Number</a>
@ -193,7 +193,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Second in minute
* <td><a href="#number">Number</a>
* <td><code>55</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>S</code>
* <td>Millisecond
* <td><a href="#number">Number</a>
@ -203,7 +203,7 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* <td>Time zone
* <td><a href="#timezone">General time zone</a>
* <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>Z</code>
* <td>Time zone
* <td><a href="#rfc822timezone">RFC 822 time zone</a>
@ -365,37 +365,37 @@ import sun.util.locale.provider.LocaleProviderAdapter;
* in the U.S. Pacific Time time zone.
* <blockquote>
* <table border=0 cellspacing=3 cellpadding=0 summary="Examples of date and time patterns interpreted in the U.S. locale">
* <tr bgcolor="#ccccff">
* <tr style="background-color: rgb(204, 204, 255);">
* <th align=left>Date and Time Pattern
* <th align=left>Result
* <tr>
* <td><code>"yyyy.MM.dd G 'at' HH:mm:ss z"</code>
* <td><code>2001.07.04 AD at 12:08:56 PDT</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>"EEE, MMM d, ''yy"</code>
* <td><code>Wed, Jul 4, '01</code>
* <tr>
* <td><code>"h:mm a"</code>
* <td><code>12:08 PM</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>"hh 'o''clock' a, zzzz"</code>
* <td><code>12 o'clock PM, Pacific Daylight Time</code>
* <tr>
* <td><code>"K:mm a, z"</code>
* <td><code>0:08 PM, PDT</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>"yyyyy.MMMMM.dd GGG hh:mm aaa"</code>
* <td><code>02001.July.04 AD 12:08 PM</code>
* <tr>
* <td><code>"EEE, d MMM yyyy HH:mm:ss Z"</code>
* <td><code>Wed, 4 Jul 2001 12:08:56 -0700</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>"yyMMddHHmmssZ"</code>
* <td><code>010704120856-0700</code>
* <tr>
* <td><code>"yyyy-MM-dd'T'HH:mm:ss.SSSZ"</code>
* <td><code>2001-07-04T12:08:56.235-0700</code>
* <tr bgcolor="#eeeeff">
* <tr style="background-color: rgb(238, 238, 255);">
* <td><code>"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"</code>
* <td><code>2001-07-04T12:08:56.235-07:00</code>
* <tr>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -59,6 +59,8 @@ public final class StringCharacterIterator implements CharacterIterator
/**
* Constructs an iterator with an initial index of 0.
*
* @param text the {@code String} to be iterated over
*/
public StringCharacterIterator(String text)
{