ICU-7063 Reverting Mark's changes for #7063 for now, because of the build breakage and incompatibility concerns.

X-SVN-Rev: 26479
This commit is contained in:
Yoshito Umaoka 2009-08-11 20:44:22 +00:00
parent e8a0cc8837
commit 7f169416ee
61 changed files with 277 additions and 628 deletions

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*
@ -219,15 +219,13 @@ public final class CollationElementIterator
* <p>If the RuleBasedCollator used by this iterator has had its
* attributes changed, calling reset() will reinitialize the
* iterator to use the new attributes.</p>
* @return
*
* @stable ICU 2.8
*/
public CollationElementIterator reset()
public void reset()
{
m_source_.setToStart();
updateInternalState();
return this;
}
/**
@ -454,10 +452,9 @@ public final class CollationElementIterator
* @param offset the character offset into the original source string to
* set. Note that this is not an offset into the corresponding
* sequence of collation elements.
* @return
* @stable ICU 2.8
*/
public CollationElementIterator setOffset(int offset)
public void setOffset(int offset)
{
m_source_.setIndex(offset);
int ch_int = m_source_.current();
@ -504,7 +501,6 @@ public final class CollationElementIterator
// the string again if we are at the end
m_isForwards_ = true;
}
return this;
}
/**
@ -512,15 +508,13 @@ public final class CollationElementIterator
* to the beginning of the text.</p>
*
* @param source the new source string for iteration.
* @return
* @stable ICU 2.8
*/
public CollationElementIterator setText(String source)
public void setText(String source)
{
m_srcUtilIter_.setText(source);
m_source_ = m_srcUtilIter_;
updateInternalState();
return this;
}
/**
@ -530,15 +524,13 @@ public final class CollationElementIterator
* <p>The source iterator's integrity will be preserved since a new copy
* will be created for use.</p>
* @param source the new source string iterator for iteration.
* @return
* @stable ICU 2.8
*/
public CollationElementIterator setText(UCharacterIterator source)
public void setText(UCharacterIterator source)
{
m_srcUtilIter_.setText(source.getText());
m_source_ = m_srcUtilIter_;
updateInternalState();
return this;
}
/**
@ -546,15 +538,13 @@ public final class CollationElementIterator
* offset to the beginning of the text.
* </p>
* @param source the new source string iterator for iteration.
* @return
* @stable ICU 2.8
*/
public CollationElementIterator setText(CharacterIterator source)
public void setText(CharacterIterator source)
{
m_source_ = new CharacterIteratorWrapper(source);
m_source_.setToStart();
updateInternalState();
return this;
}
// public miscellaneous methods -----------------------------------------

View file

@ -237,7 +237,6 @@ public abstract class Collator implements Comparator<Object>, Cloneable
*
* <p>See the Collator class description for an example of use.</p>
* @param newStrength the new strength value.
* @return
* @see #getStrength
* @see #PRIMARY
* @see #SECONDARY
@ -248,7 +247,7 @@ public abstract class Collator implements Comparator<Object>, Cloneable
* of PRIMARY, SECONDARY, TERTIARY, QUATERNARY or IDENTICAL.
* @stable ICU 2.8
*/
public Collator setStrength(int newStrength)
public void setStrength(int newStrength)
{
if ((newStrength != PRIMARY) &&
(newStrength != SECONDARY) &&
@ -258,7 +257,6 @@ public abstract class Collator implements Comparator<Object>, Cloneable
throw new IllegalArgumentException("Incorrect comparison level.");
}
m_strength_ = newStrength;
return this;
}
/**
@ -293,7 +291,6 @@ public abstract class Collator implements Comparator<Object>, Cloneable
* mode.</p>
*
* @param decomposition the new decomposition mode
* @return
* @see #getDecomposition
* @see #NO_DECOMPOSITION
* @see #CANONICAL_DECOMPOSITION
@ -301,14 +298,13 @@ public abstract class Collator implements Comparator<Object>, Cloneable
* decomposition mode.
* @stable ICU 2.8
*/
public Collator setDecomposition(int decomposition)
public void setDecomposition(int decomposition)
{
if ((decomposition != NO_DECOMPOSITION) &&
(decomposition != CANONICAL_DECOMPOSITION)) {
throw new IllegalArgumentException("Wrong decomposition mode.");
}
m_decomposition_ = decomposition;
return this;
}
// public getters --------------------------------------------------------
@ -970,7 +966,7 @@ public abstract class Collator implements Comparator<Object>, Cloneable
* @see #setVariableTop
* @stable ICU 2.6
*/
public abstract Collator setVariableTop(int varTop);
public abstract void setVariableTop(int varTop);
/**
* Get the version of this collator object.

View file

@ -284,32 +284,28 @@ public final class RuleBasedCollator extends Collator
* distinguishing between Katakana and Hiragana characters.
* @param flag true if Hiragana Quaternary mode is to be on, false
* otherwise
* @return
* @see #setHiraganaQuaternaryDefault
* @see #isHiraganaQuaternary
* @stable ICU 2.8
*/
public RuleBasedCollator setHiraganaQuaternary(boolean flag)
public void setHiraganaQuaternary(boolean flag)
{
m_isHiragana4_ = flag;
updateInternalState();
return this;
updateInternalState();
}
/**
* Sets the Hiragana Quaternary mode to the initial mode set during
* construction of the RuleBasedCollator.
* See setHiraganaQuaternary(boolean) for more details.
* @return
* @see #setHiraganaQuaternary(boolean)
* @see #isHiraganaQuaternary
* @stable ICU 2.8
*/
public RuleBasedCollator setHiraganaQuaternaryDefault()
public void setHiraganaQuaternaryDefault()
{
m_isHiragana4_ = m_defaultIsHiragana4_;
updateInternalState();
return this;
}
/**
@ -321,14 +317,13 @@ public final class RuleBasedCollator extends Collator
* @param upperfirst true to sort uppercase characters before
* lowercase characters, false to sort lowercase
* characters before uppercase characters
* @return
* @see #isLowerCaseFirst
* @see #isUpperCaseFirst
* @see #setLowerCaseFirst
* @see #setCaseFirstDefault
* @stable ICU 2.8
*/
public RuleBasedCollator setUpperCaseFirst(boolean upperfirst)
public void setUpperCaseFirst(boolean upperfirst)
{
if (upperfirst) {
if(m_caseFirst_ != AttributeValue.UPPER_FIRST_) {
@ -343,7 +338,6 @@ public final class RuleBasedCollator extends Collator
m_caseFirst_ = AttributeValue.OFF_;
}
updateInternalState();
return this;
}
/**
@ -357,14 +351,13 @@ public final class RuleBasedCollator extends Collator
* @param lowerfirst true for sorting lower cased characters before
* upper cased characters, false to ignore case
* preferences.
* @return
* @see #isLowerCaseFirst
* @see #isUpperCaseFirst
* @see #setUpperCaseFirst
* @see #setCaseFirstDefault
* @stable ICU 2.8
*/
public RuleBasedCollator setLowerCaseFirst(boolean lowerfirst)
public void setLowerCaseFirst(boolean lowerfirst)
{
if (lowerfirst) {
if(m_caseFirst_ != AttributeValue.LOWER_FIRST_) {
@ -379,7 +372,6 @@ public final class RuleBasedCollator extends Collator
m_caseFirst_ = AttributeValue.OFF_;
}
updateInternalState();
return this;
}
/**
@ -387,104 +379,92 @@ public final class RuleBasedCollator extends Collator
* construction of the RuleBasedCollator.
* See setUpperCaseFirst(boolean) and setLowerCaseFirst(boolean) for more
* details.
* @return
* @see #isLowerCaseFirst
* @see #isUpperCaseFirst
* @see #setLowerCaseFirst(boolean)
* @see #setUpperCaseFirst(boolean)
* @stable ICU 2.8
*/
public final RuleBasedCollator setCaseFirstDefault()
public final void setCaseFirstDefault()
{
if(m_caseFirst_ != m_defaultCaseFirst_) {
latinOneRegenTable_ = true;
}
m_caseFirst_ = m_defaultCaseFirst_;
updateInternalState();
return this;
}
/**
* Sets the alternate handling mode to the initial mode set during
* construction of the RuleBasedCollator.
* See setAlternateHandling(boolean) for more details.
* @return
* @see #setAlternateHandlingShifted(boolean)
* @see #isAlternateHandlingShifted()
* @stable ICU 2.8
*/
public RuleBasedCollator setAlternateHandlingDefault()
public void setAlternateHandlingDefault()
{
m_isAlternateHandlingShifted_ = m_defaultIsAlternateHandlingShifted_;
updateInternalState();
return this;
}
/**
* Sets the case level mode to the initial mode set during
* construction of the RuleBasedCollator.
* See setCaseLevel(boolean) for more details.
* @return
* @see #setCaseLevel(boolean)
* @see #isCaseLevel
* @stable ICU 2.8
*/
public RuleBasedCollator setCaseLevelDefault()
public void setCaseLevelDefault()
{
m_isCaseLevel_ = m_defaultIsCaseLevel_;
updateInternalState();
return this;
}
/**
* Sets the decomposition mode to the initial mode set during construction
* of the RuleBasedCollator.
* See setDecomposition(int) for more details.
* @return
* @see #getDecomposition
* @see #setDecomposition(int)
* @stable ICU 2.8
*/
public RuleBasedCollator setDecompositionDefault()
public void setDecompositionDefault()
{
setDecomposition(m_defaultDecomposition_);
updateInternalState();
return this;
updateInternalState();
}
/**
* Sets the French collation mode to the initial mode set during
* construction of the RuleBasedCollator.
* See setFrenchCollation(boolean) for more details.
* @return
* @see #isFrenchCollation
* @see #setFrenchCollation(boolean)
* @stable ICU 2.8
*/
public RuleBasedCollator setFrenchCollationDefault()
public void setFrenchCollationDefault()
{
if(m_isFrenchCollation_ != m_defaultIsFrenchCollation_) {
latinOneRegenTable_ = true;
}
m_isFrenchCollation_ = m_defaultIsFrenchCollation_;
updateInternalState();
return this;
}
/**
* Sets the collation strength to the initial mode set during the
* construction of the RuleBasedCollator.
* See setStrength(int) for more details.
* @return
* @see #setStrength(int)
* @see #getStrength
* @stable ICU 2.8
*/
public RuleBasedCollator setStrengthDefault()
public void setStrengthDefault()
{
setStrength(m_defaultStrength_);
updateInternalState();
return this;
updateInternalState();
}
/**
@ -492,16 +472,14 @@ public final class RuleBasedCollator extends Collator
* When numeric collation is turned on, this Collator generates a collation
* key for the numeric value of substrings of digits. This is a way to get
* '100' to sort AFTER '2'
* @return
* @see #getNumericCollation
* @see #setNumericCollation
* @stable ICU 2.8
*/
public RuleBasedCollator setNumericCollationDefault()
public void setNumericCollationDefault()
{
setNumericCollation(m_defaultIsNumericCollation_);
updateInternalState();
return this;
updateInternalState();
}
/**
@ -514,19 +492,17 @@ public final class RuleBasedCollator extends Collator
* <a href="http://www.icu-project.org/userguide/Collate_ServiceArchitecture.html">
* French collation</a> for more information.
* @param flag true to set the French collation on, false to set it off
* @return
* @stable ICU 2.8
* @see #isFrenchCollation
* @see #setFrenchCollationDefault
*/
public RuleBasedCollator setFrenchCollation(boolean flag)
public void setFrenchCollation(boolean flag)
{
if(m_isFrenchCollation_ != flag) {
latinOneRegenTable_ = true;
}
m_isFrenchCollation_ = flag;
updateInternalState();
return this;
}
/**
@ -546,16 +522,14 @@ public final class RuleBasedCollator extends Collator
* moved to the QUATERNARY order.
* @param shifted true if SHIFTED behaviour for alternate handling is
* desired, false for the NON_IGNORABLE behaviour.
* @return
* @see #isAlternateHandlingShifted
* @see #setAlternateHandlingDefault
* @stable ICU 2.8
*/
public RuleBasedCollator setAlternateHandlingShifted(boolean shifted)
public void setAlternateHandlingShifted(boolean shifted)
{
m_isAlternateHandlingShifted_ = shifted;
updateInternalState();
return this;
}
/**
@ -576,16 +550,14 @@ public final class RuleBasedCollator extends Collator
* case level</a> for more information.
* </p>
* @param flag true if case level sorting is required, false otherwise
* @return
* @stable ICU 2.8
* @see #setCaseLevelDefault
* @see #isCaseLevel
*/
public RuleBasedCollator setCaseLevel(boolean flag)
public void setCaseLevel(boolean flag)
{
m_isCaseLevel_ = flag;
updateInternalState();
return this;
}
/**
@ -596,7 +568,6 @@ public final class RuleBasedCollator extends Collator
* </p>
* <p>See the Collator class description for an example of use.</p>
* @param newStrength the new strength value.
* @return
* @see #getStrength
* @see #setStrengthDefault
* @see #PRIMARY
@ -608,11 +579,10 @@ public final class RuleBasedCollator extends Collator
* of PRIMARY, SECONDARY, TERTIARY, QUATERNARY or IDENTICAL.
* @stable ICU 2.8
*/
public RuleBasedCollator setStrength(int newStrength)
public void setStrength(int newStrength)
{
super.setStrength(newStrength);
updateInternalState();
return this;
}
/**
@ -686,15 +656,13 @@ public final class RuleBasedCollator extends Collator
* Lower 16 bits are ignored.
* @param varTop Collation element value, as returned by setVariableTop or
* getVariableTop
* @return
* @see #getVariableTop
* @see #setVariableTop(String)
* @stable ICU 2.6
*/
public RuleBasedCollator setVariableTop(int varTop)
public void setVariableTop(int varTop)
{
m_variableTopValue_ = (varTop & CE_PRIMARY_MASK_) >> 16;
return this;
}
/**
@ -702,17 +670,15 @@ public final class RuleBasedCollator extends Collator
* key for the numeric value of substrings of digits. This is a way to get
* '100' to sort AFTER '2'
* @param flag true to turn numeric collation on and false to turn it off
* @return
* @see #getNumericCollation
* @see #setNumericCollationDefault
* @stable ICU 2.8
*/
public RuleBasedCollator setNumericCollation(boolean flag)
public void setNumericCollation(boolean flag)
{
// sort substrings of digits as numbers
m_isNumericCollation_ = flag;
updateInternalState();
return this;
}
// public getters --------------------------------------------------------
@ -891,11 +857,11 @@ public final class RuleBasedCollator extends Collator
* @param contractions if not null, set to contain contractions
* @param expansions if not null, set to contain expansions
* @param addPrefixes add the prefix contextual elements to contractions
* @return
* @throws Exception
* @stable ICU 3.4
*/
public RuleBasedCollator getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions,
public void
getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions,
boolean addPrefixes) throws Exception {
if(contractions != null) {
contractions.clear();
@ -918,7 +884,6 @@ public final class RuleBasedCollator extends Collator
} catch (Exception e) {
throw e;
}
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2007, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -350,12 +350,11 @@ public final class StringSearch extends SearchIterator
* to be recalculated, but the iterator's position is unchanged.
* </p>
* @param collator to use for this StringSearch
* @return
* @exception IllegalArgumentException thrown when collator is null
* @see #getCollator
* @stable ICU 2.0
*/
public StringSearch setCollator(RuleBasedCollator collator)
public void setCollator(RuleBasedCollator collator)
{
if (collator == null) {
throw new IllegalArgumentException("Collator can not be null");
@ -368,7 +367,6 @@ public final class StringSearch extends SearchIterator
m_utilColEIter_.setCollator(m_collator_);
m_charBreakIter_ = BreakIterator.getCharacterInstance(/*collator.getLocale(ULocale.VALID_LOCALE)*/);
m_charBreakIter_.setText(targetText);
return this;
}
/**
@ -380,13 +378,12 @@ public final class StringSearch extends SearchIterator
* to be recalculated, but the iterator's position is unchanged.
* </p>
* @param pattern for searching
* @return
* @see #getPattern
* @exception IllegalArgumentException thrown if pattern is null or of
* length 0
* @stable ICU 2.0
*/
public StringSearch setPattern(String pattern)
public void setPattern(String pattern)
{
if (pattern == null || pattern.length() <= 0) {
throw new IllegalArgumentException(
@ -394,7 +391,6 @@ public final class StringSearch extends SearchIterator
}
m_pattern_.targetText = pattern;
initialize();
return this;
}
/**
@ -402,20 +398,18 @@ public final class StringSearch extends SearchIterator
* the start of the text string. This method is useful if you want to
* re-use an iterator to search within a different body of text.
* @param text new text iterator to look for match,
* @return
* @exception IllegalArgumentException thrown when text is null or has
* 0 length
* @see #getTarget
* @stable ICU 2.8
*/
public StringSearch setTarget(CharacterIterator text)
public void setTarget(CharacterIterator text)
{
super.setTarget(text);
m_textBeginOffset_ = targetText.getBeginIndex();
m_textLimitOffset_ = targetText.getEndIndex();
m_colEIter_.setText(targetText);
m_charBreakIter_.setText(targetText);
return this;
}
/**
@ -433,18 +427,16 @@ public final class StringSearch extends SearchIterator
* the class documentation.
* </p>
* @param position index to start next search from.
* @return
* @exception IndexOutOfBoundsException thrown if argument position is out
* of the target text range.
* @see #getIndex
* @stable ICU 2.8
*/
public StringSearch setIndex(int position)
public void setIndex(int position)
{
super.setIndex(position);
m_matchedIndex_ = DONE;
m_colEIter_.setExactOffset(position);
return this;
}
/**
@ -453,11 +445,10 @@ public final class StringSearch extends SearchIterator
* The default setting for this property is false.
* </p>
* @param allowCanonical flag indicator if canonical matches are allowed
* @return
* @see #isCanonical
* @stable ICU 2.8
*/
public StringSearch setCanonical(boolean allowCanonical)
public void setCanonical(boolean allowCanonical)
{
m_isCanonicalMatch_ = allowCanonical;
if (m_isCanonicalMatch_ == true) {
@ -476,7 +467,6 @@ public final class StringSearch extends SearchIterator
m_canonicalSuffixAccents_.length());
}
}
return this;
}
// public miscellaneous methods -----------------------------------------
@ -495,10 +485,9 @@ public final class StringSearch extends SearchIterator
* <p>
* Canonical match option will be reset to false, ie an exact match.
* </p>
* @return
* @stable ICU 2.8
*/
public StringSearch reset()
public void reset()
{
// reset is setting the attributes that are already in string search,
// hence all attributes in the collator should be retrieved without any
@ -511,7 +500,6 @@ public final class StringSearch extends SearchIterator
m_colEIter_.setCollator(m_collator_);
m_colEIter_.reset();
m_utilColEIter_.setCollator(m_collator_);
return this;
}
// protected methods -----------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -77,13 +77,11 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
}
/**
* @return
* @see UCharacterIterator#setIndex(int)
*/
public CharacterIteratorWrapper setIndex(int index) {
public void setIndex(int index) {
try{
iterator.setIndex(index);
return this;
}catch(IllegalArgumentException e){
throw new IndexOutOfBoundsException();
}
@ -92,9 +90,8 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#setToLimit()
*/
public CharacterIteratorWrapper setToLimit() {
public void setToLimit() {
iterator.setIndex(iterator.getEndIndex());
return this;
}
/**

View file

@ -62,18 +62,16 @@ public final class DateNumberFormat extends NumberFormat {
minusSign = elems[1];
}
public DateNumberFormat setMaximumIntegerDigits(int newValue) {
public void setMaximumIntegerDigits(int newValue) {
maxIntDigits = newValue;
return this;
}
public int getMaximumIntegerDigits() {
return maxIntDigits;
}
public DateNumberFormat setMinimumIntegerDigits(int newValue) {
public void setMinimumIntegerDigits(int newValue) {
minIntDigits = newValue;
return this;
}
public int getMinimumIntegerDigits() {

View file

@ -95,7 +95,7 @@ public class JavaTimeZone extends TimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#getOffset(long, boolean, int[])
*/
public JavaTimeZone getOffset(long date, boolean local, int[] offsets) {
public void getOffset(long date, boolean local, int[] offsets) {
synchronized (javacal) {
if (local) {
int fields[] = new int[6];
@ -135,7 +135,6 @@ public class JavaTimeZone extends TimeZone {
offsets[0] = javacal.get(java.util.Calendar.ZONE_OFFSET);
offsets[1] = javacal.get(java.util.Calendar.DST_OFFSET);
}
return this;
}
/* (non-Javadoc)
@ -155,9 +154,8 @@ public class JavaTimeZone extends TimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#setRawOffset(int)
*/
public JavaTimeZone setRawOffset(int offsetMillis) {
public void setRawOffset(int offsetMillis) {
javatz.setRawOffset(offsetMillis);
return this;
}
/* (non-Javadoc)

View file

@ -169,9 +169,9 @@ public class OlsonTimeZone extends BasicTimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#setRawOffset(int)
*/
public OlsonTimeZone setRawOffset(int offsetMillis) {
public void setRawOffset(int offsetMillis) {
if (getRawOffset() == offsetMillis) {
return this;
return;
}
long current = System.currentTimeMillis();
@ -246,7 +246,6 @@ public class OlsonTimeZone extends BasicTimeZone {
}
transitionRulesInitialized = false;
return this;
}
public Object clone() {
@ -263,9 +262,8 @@ public class OlsonTimeZone extends BasicTimeZone {
/**
* TimeZone API.
* @return
*/
public OlsonTimeZone getOffset(long date, boolean local, int[] offsets) {
public void getOffset(long date, boolean local, int[] offsets) {
// The check against finalMillis will suffice most of the time, except
// for the case in which finalMillis == DBL_MAX, date == DBL_MAX,
// and finalZone == 0. For this case we add "&& finalZone != 0".
@ -275,23 +273,20 @@ public class OlsonTimeZone extends BasicTimeZone {
getHistoricalOffset(date, local,
LOCAL_FORMER, LOCAL_LATTER, offsets);
}
return this;
}
/**
* {@inheritDoc}
* @return
* @internal
* @deprecated This API is ICU internal only.
*/
public OlsonTimeZone getOffsetFromLocal(long date,
public void getOffsetFromLocal(long date,
int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets) {
if (date >= finalMillis && finalZone != null) {
finalZone.getOffsetFromLocal(date, nonExistingTimeOpt, duplicatedTimeOpt, offsets);
} else {
getHistoricalOffset(date, true, nonExistingTimeOpt, duplicatedTimeOpt, offsets);
}
return this;
}
/* (non-Javadoc)
@ -533,13 +528,12 @@ public class OlsonTimeZone extends BasicTimeZone {
super.setID(id);
}
public OlsonTimeZone setID(String id){
public void setID(String id){
if(finalZone!= null){
finalZone.setID(id);
}
super.setID(id);
transitionRulesInitialized = false;
return this;
}
private static final int UNSIGNED_BYTE_MASK =0xFF;

View file

@ -123,7 +123,7 @@ public class RelativeDateFormat extends DateFormat {
/* (non-Javadoc)
* @see com.ibm.icu.text.DateFormat#parse(java.lang.String, com.ibm.icu.util.Calendar, java.text.ParsePosition)
*/
public RelativeDateFormat parse(String text, Calendar cal, ParsePosition pos) {
public void parse(String text, Calendar cal, ParsePosition pos) {
throw new UnsupportedOperationException("Relative Date parse is not implemented yet");
}

View file

@ -1,12 +1,15 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2005, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.impl;
import com.ibm.icu.text.*;
import com.ibm.icu.text.Replaceable;
import com.ibm.icu.text.ReplaceableString;
import com.ibm.icu.text.UTF16;
/**
* DLF docs must define behavior when Replaceable is mutated underneath
@ -165,18 +168,16 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* single UTF16 character at currentIndex.
* This assumes the text is stored as 16-bit code units.</p>
* @param currentIndex the currentIndex within the text.
* @return
* @exception IllegalArgumentException is thrown if an invalid currentIndex is
* supplied. i.e. currentIndex is out of bounds.
* @returns the character at the specified currentIndex or DONE if the specified
* currentIndex is equal to the end of the text.
*/
public ReplaceableUCharacterIterator setIndex(int currentIndex) throws IndexOutOfBoundsException{
public void setIndex(int currentIndex) throws IndexOutOfBoundsException{
if (currentIndex < 0 || currentIndex > replaceable.length()) {
throw new IndexOutOfBoundsException();
}
this.currentIndex = currentIndex;
return this;
}
public int getText(char[] fillIn, int offset){

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -130,17 +130,15 @@ public final class StringUCharacterIterator extends UCharacterIterator
* returns that single UTF16 character at currentIndex.
* This assumes the text is stored as 16-bit code units.</p>
* @param currentIndex the currentIndex within the text.
* @return
* @exception IndexOutOfBoundsException is thrown if an invalid currentIndex
* is supplied. i.e. currentIndex is out of bounds.
*/
public StringUCharacterIterator setIndex(int currentIndex) throws IndexOutOfBoundsException
public void setIndex(int currentIndex) throws IndexOutOfBoundsException
{
if (currentIndex < 0 || currentIndex > m_text_.length()) {
throw new IndexOutOfBoundsException();
}
m_currentIndex_ = currentIndex;
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
@ -129,9 +129,8 @@ public class TrieIterator implements RangeValueIterator
/**
* Resets the iterator to the beginning of the iteration
* @return
*/
public final TrieIterator reset()
public final void reset()
{
m_currentCodepoint_ = 0;
m_nextCodepoint_ = 0;
@ -145,7 +144,6 @@ public class TrieIterator implements RangeValueIterator
}
m_nextBlockIndex_ = 0;
m_nextTrailIndexOffset_ = TRAIL_SURROGATE_INDEX_BLOCK_LENGTH_;
return this;
}
// protected methods ----------------------------------------------

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -54,14 +54,13 @@ public final class UCharArrayIterator extends UCharacterIterator {
return pos > start ? text[--pos] : DONE;
}
public UCharArrayIterator setIndex(int index) {
public void setIndex(int index) {
if (index < 0 || index > limit - start) {
throw new IndexOutOfBoundsException("index: " + index +
" out of range [0, "
+ (limit - start) + ")");
}
pos = start + index;
return this;
}
public int getText(char[] fillIn, int offset) {

View file

@ -409,7 +409,7 @@ public abstract class BreakIterator implements Cloneable
* position is ignored, but its other state is significant).
* @stable ICU 2.0
*/
public abstract BreakIterator setText(CharacterIterator newText);
public abstract void setText(CharacterIterator newText);
/** @stable ICU 2.4 */
public static final int KIND_CHARACTER = 0;

View file

@ -543,7 +543,7 @@ public abstract class DateFormat extends UFormat {
* start position if the parse failed.
* @stable ICU 2.0
*/
public abstract DateFormat parse(String text, Calendar cal, ParsePosition pos);
public abstract void parse(String text, Calendar cal, ParsePosition pos);
/**
* Parse a date/time string according to the given parse position. For
@ -1104,13 +1104,11 @@ public abstract class DateFormat extends UFormat {
* Set the calendar to be used by this date format. Initially, the default
* calendar for the specified or default locale is used.
* @param newCalendar the new Calendar to be used by the date format
* @return
* @stable ICU 2.0
*/
public DateFormat setCalendar(Calendar newCalendar)
public void setCalendar(Calendar newCalendar)
{
this.calendar = newCalendar;
return this;
}
/**
@ -1126,17 +1124,15 @@ public abstract class DateFormat extends UFormat {
/**
* Allows you to set the number formatter.
* @param newNumberFormat the given new NumberFormat.
* @return
* @stable ICU 2.0
*/
public DateFormat setNumberFormat(NumberFormat newNumberFormat)
public void setNumberFormat(NumberFormat newNumberFormat)
{
this.numberFormat = newNumberFormat;
/*In order to parse String like "11.10.2001" to DateTime correctly
in Locale("fr","CH") [Richard/GCL]
*/
this.numberFormat.setParseIntegerOnly(true);
return this;
}
/**
@ -1153,13 +1149,11 @@ public abstract class DateFormat extends UFormat {
/**
* Sets the time zone for the calendar of this DateFormat object.
* @param zone the given new time zone.
* @return
* @stable ICU 2.0
*/
public DateFormat setTimeZone(TimeZone zone)
public void setTimeZone(TimeZone zone)
{
calendar.setTimeZone(zone);
return this;
}
/**
@ -1178,14 +1172,12 @@ public abstract class DateFormat extends UFormat {
* do not precisely match this object's format. With strict parsing,
* inputs must match this object's format.
* @param lenient when true, parsing is lenient
* @return
* @see com.ibm.icu.util.Calendar#setLenient
* @stable ICU 2.0
*/
public DateFormat setLenient(boolean lenient)
public void setLenient(boolean lenient)
{
calendar.setLenient(lenient);
return this;
}
/**

View file

@ -793,10 +793,9 @@ public class DateIntervalFormat extends UFormat {
/**
* Set the date time interval patterns.
* @param newItvPattern the given interval patterns to copy.
* @return
* @stable ICU 4.0
*/
public DateIntervalFormat setDateIntervalInfo(DateIntervalInfo newItvPattern)
public void setDateIntervalInfo(DateIntervalInfo newItvPattern)
{
// clone it. If it is frozen, the clone returns itself.
// Otherwise, clone returns a copy
@ -806,7 +805,6 @@ public class DateIntervalFormat extends UFormat {
if ( fDateFormat != null ) {
initializePattern();
}
return this;
}

View file

@ -520,14 +520,13 @@ public class DateIntervalInfo implements Cloneable, Freezable, Serializable {
* For example, if lrgDiffCalUnit is
* "year", the interval pattern for en_US when year
* is different could be "'from' yyyy 'to' yyyy".
* @return
* @throws IllegalArgumentException if setting interval pattern on
* a calendar field that is smaller
* than the MINIMUM_SUPPORTED_CALENDAR_FIELD
* @throws UnsupportedOperationException if the object is frozen
* @stable ICU 4.0
*/
public DateIntervalInfo setIntervalPattern(String skeleton,
public void setIntervalPattern(String skeleton,
int lrgDiffCalUnit,
String intervalPattern)
{
@ -554,7 +553,6 @@ public class DateIntervalInfo implements Cloneable, Freezable, Serializable {
CALENDAR_FIELD_TO_PATTERN_LETTER[Calendar.DATE],
ptnInfo);
}
return this;
}
@ -688,14 +686,13 @@ public class DateIntervalInfo implements Cloneable, Freezable, Serializable {
* This method provides a way for user to replace the fallback pattern.
*
* @param fallbackPattern fall-back interval pattern.
* @return
* @throws UnsupportedOperationException if the object is frozen
* @throws IllegalArgumentException if there is no pattern {0} or
* pattern {1} in fallbakckPattern
*
* @stable ICU 4.0
*/
public DateIntervalInfo setFallbackIntervalPattern(String fallbackPattern)
public void setFallbackIntervalPattern(String fallbackPattern)
{
if ( frozen ) {
throw new UnsupportedOperationException("no modification is allowed after DII is frozen");
@ -709,7 +706,6 @@ public class DateIntervalInfo implements Cloneable, Freezable, Serializable {
fFirstDateInPtnIsLaterDate = true;
}
fFallbackIntervalPattern = fallbackPattern;
return this;
}

View file

@ -554,13 +554,11 @@ public class DateTimePatternGenerator implements Freezable, Cloneable {
* @param dateTimeFormat
* message format pattern, where {1} will be replaced by the date
* pattern and {0} will be replaced by the time pattern.
* @return
* @stable ICU 3.6
*/
public DateTimePatternGenerator setDateTimeFormat(String dateTimeFormat) {
public void setDateTimeFormat(String dateTimeFormat) {
checkFrozen();
this.dateTimeFormat = dateTimeFormat;
return this;
}
/**
@ -582,13 +580,11 @@ public class DateTimePatternGenerator implements Freezable, Cloneable {
* "H:mm:ss,SSSS"
*
* @param decimal
* @return
* @stable ICU 3.6
*/
public DateTimePatternGenerator setDecimal(String decimal) {
public void setDecimal(String decimal) {
checkFrozen();
this.decimal = decimal;
return this;
}
/**
@ -758,13 +754,11 @@ public class DateTimePatternGenerator implements Freezable, Cloneable {
* such as ERA
* @param value
* pattern, such as "{0}, {1}"
* @return
* @stable ICU 3.6
*/
public DateTimePatternGenerator setAppendItemFormat(int field, String value) {
public void setAppendItemFormat(int field, String value) {
checkFrozen();
appendItemFormats[field] = value;
return this;
}
/**
@ -788,13 +782,11 @@ public class DateTimePatternGenerator implements Freezable, Cloneable {
*
* @param field
* @param value
* @return
* @stable ICU 3.6
*/
public DateTimePatternGenerator setAppendItemName(int field, String value) {
public void setAppendItemName(int field, String value) {
checkFrozen();
appendItemNames[field] = value;
return this;
}
/**

View file

@ -2682,15 +2682,13 @@ public class DecimalFormat extends NumberFormat {
*
* @param newSymbols
* desired DecimalFormatSymbols
* @return
* @see DecimalFormatSymbols
* @stable ICU 2.0
*/
public DecimalFormat setDecimalFormatSymbols(DecimalFormatSymbols newSymbols) {
public void setDecimalFormatSymbols(DecimalFormatSymbols newSymbols) {
symbols = (DecimalFormatSymbols) newSymbols.clone();
setCurrencyForSymbols();
expandAffixes(null);
return this;
}
/**
@ -2734,14 +2732,12 @@ public class DecimalFormat extends NumberFormat {
* Set the positive prefix.
* <P>
* Examples: +123, $123, sFr123
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setPositivePrefix(String newValue) {
public void setPositivePrefix(String newValue) {
positivePrefix = newValue;
posPrefixPattern = null;
return this;
}
/**
@ -2759,14 +2755,12 @@ public class DecimalFormat extends NumberFormat {
* Set the negative prefix.
* <P>
* Examples: -123, ($123) (with negative suffix), sFr-123
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setNegativePrefix(String newValue) {
public void setNegativePrefix(String newValue) {
negativePrefix = newValue;
negPrefixPattern = null;
return this;
}
/**
@ -2784,14 +2778,12 @@ public class DecimalFormat extends NumberFormat {
* Set the positive suffix.
* <P>
* Example: 123%
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setPositiveSuffix(String newValue) {
public void setPositiveSuffix(String newValue) {
positiveSuffix = newValue;
posSuffixPattern = null;
return this;
}
/**
@ -2809,14 +2801,12 @@ public class DecimalFormat extends NumberFormat {
* Set the positive suffix.
* <P>
* Examples: 123%
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setNegativeSuffix(String newValue) {
public void setNegativeSuffix(String newValue) {
negativeSuffix = newValue;
negSuffixPattern = null;
return this;
}
/**
@ -2838,16 +2828,14 @@ public class DecimalFormat extends NumberFormat {
* and the multiplier to be 1000.
* <P>
* Examples: with 100, 1.23 -> "123", and "123" -> 1.23
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setMultiplier(int newValue) {
public void setMultiplier(int newValue) {
if (newValue == 0) {
throw new IllegalArgumentException("Bad multiplier: " + newValue);
}
multiplier = newValue;
return this;
}
/**
@ -2871,7 +2859,6 @@ public class DecimalFormat extends NumberFormat {
* @param newValue
* A positive rounding increment, or <code>null</code> or <code>BigDecimal(0.0)</code> to disable
* rounding.
* @return
* @exception IllegalArgumentException
* if <code>newValue</code> is < 0.0
* @see #getRoundingIncrement
@ -2879,13 +2866,12 @@ public class DecimalFormat extends NumberFormat {
* @see #setRoundingMode
* @stable ICU 2.0
*/
public DecimalFormat setRoundingIncrement(java.math.BigDecimal newValue) {
public void setRoundingIncrement(java.math.BigDecimal newValue) {
if (newValue == null) {
setRoundingIncrement((BigDecimal) null);
} else {
setRoundingIncrement(new BigDecimal(newValue));
}
return this;
}
/**
@ -2894,7 +2880,6 @@ public class DecimalFormat extends NumberFormat {
* @param newValue
* A positive rounding increment, or <code>null</code> or <code>BigDecimal(0.0)</code> to disable
* rounding.
* @return
* @exception IllegalArgumentException
* if <code>newValue</code> is < 0.0
* @see #getRoundingIncrement
@ -2902,7 +2887,7 @@ public class DecimalFormat extends NumberFormat {
* @see #setRoundingMode
* @stable ICU 3.6
*/
public DecimalFormat setRoundingIncrement(BigDecimal newValue) {
public void setRoundingIncrement(BigDecimal newValue) {
int i = newValue == null ? 0 : newValue.compareTo(BigDecimal.ZERO);
if (i < 0) {
throw new IllegalArgumentException("Illegal rounding increment");
@ -2913,7 +2898,6 @@ public class DecimalFormat extends NumberFormat {
setInternalRoundingIncrement(newValue);
}
setRoundingDouble();
return this;
}
/**
@ -2921,7 +2905,6 @@ public class DecimalFormat extends NumberFormat {
*
* @param newValue
* A positive rounding increment, or 0.0 to disable rounding.
* @return
* @exception IllegalArgumentException
* if <code>newValue</code> is < 0.0
* @see #getRoundingIncrement
@ -2929,7 +2912,7 @@ public class DecimalFormat extends NumberFormat {
* @see #setRoundingMode
* @stable ICU 2.0
*/
public DecimalFormat setRoundingIncrement(double newValue) {
public void setRoundingIncrement(double newValue) {
if (newValue < 0.0) {
throw new IllegalArgumentException("Illegal rounding increment");
}
@ -2945,7 +2928,6 @@ public class DecimalFormat extends NumberFormat {
}
setInternalRoundingIncrement(new BigDecimal(newValue));
}
return this;
}
private void setRoundingDoubleReciprocal(double rawRoundedReciprocal) {
@ -2977,7 +2959,6 @@ public class DecimalFormat extends NumberFormat {
* @param roundingMode
* A rounding mode, between <code>BigDecimal.ROUND_UP</code> and
* <code>BigDecimal.ROUND_UNNECESSARY</code>.
* @return
* @exception IllegalArgumentException
* if <code>roundingMode</code> is unrecognized.
* @see #setRoundingIncrement
@ -2986,7 +2967,7 @@ public class DecimalFormat extends NumberFormat {
* @see java.math.BigDecimal
* @stable ICU 2.0
*/
public DecimalFormat setRoundingMode(int roundingMode) {
public void setRoundingMode(int roundingMode) {
if (roundingMode < BigDecimal.ROUND_UP || roundingMode > BigDecimal.ROUND_UNNECESSARY) {
throw new IllegalArgumentException("Invalid rounding mode: " + roundingMode);
}
@ -2996,7 +2977,6 @@ public class DecimalFormat extends NumberFormat {
if (getRoundingIncrement() == null) {
setRoundingIncrement(Math.pow(10.0, (double) -getMaximumFractionDigits()));
}
return this;
}
/**
@ -3020,7 +3000,6 @@ public class DecimalFormat extends NumberFormat {
*
* @param width
* the width to which to pad the result of <code>format()</code>, or zero to disable padding
* @return
* @exception IllegalArgumentException
* if <code>width</code> is < 0
* @see #getFormatWidth
@ -3030,12 +3009,11 @@ public class DecimalFormat extends NumberFormat {
* @see #setPadPosition
* @stable ICU 2.0
*/
public DecimalFormat setFormatWidth(int width) {
public void setFormatWidth(int width) {
if (width < 0) {
throw new IllegalArgumentException("Illegal format width");
}
formatWidth = width;
return this;
}
/**
@ -3059,7 +3037,6 @@ public class DecimalFormat extends NumberFormat {
*
* @param padChar
* the pad character
* @return
* @see #setFormatWidth
* @see #getFormatWidth
* @see #getPadCharacter
@ -3067,9 +3044,8 @@ public class DecimalFormat extends NumberFormat {
* @see #setPadPosition
* @stable ICU 2.0
*/
public DecimalFormat setPadCharacter(char padChar) {
public void setPadCharacter(char padChar) {
pad = padChar;
return this;
}
/**
@ -3100,7 +3076,6 @@ public class DecimalFormat extends NumberFormat {
* @param padPos
* the pad position, one of <code>PAD_BEFORE_PREFIX</code>, <code>PAD_AFTER_PREFIX</code>,
* <code>PAD_BEFORE_SUFFIX</code>, or <code>PAD_AFTER_SUFFIX</code>.
* @return
* @exception IllegalArgumentException
* if the pad position in unrecognized
* @see #setFormatWidth
@ -3114,12 +3089,11 @@ public class DecimalFormat extends NumberFormat {
* @see #PAD_AFTER_SUFFIX
* @stable ICU 2.0
*/
public DecimalFormat setPadPosition(int padPos) {
public void setPadPosition(int padPos) {
if (padPos < PAD_BEFORE_PREFIX || padPos > PAD_AFTER_SUFFIX) {
throw new IllegalArgumentException("Illegal pad position");
}
padPosition = padPos;
return this;
}
/**
@ -3144,7 +3118,6 @@ public class DecimalFormat extends NumberFormat {
*
* @param useScientific
* true if this object formats and parses scientific notation
* @return
* @see #isScientificNotation
* @see #getMinimumExponentDigits
* @see #setMinimumExponentDigits
@ -3152,9 +3125,8 @@ public class DecimalFormat extends NumberFormat {
* @see #setExponentSignAlwaysShown
* @stable ICU 2.0
*/
public DecimalFormat setScientificNotation(boolean useScientific) {
public void setScientificNotation(boolean useScientific) {
useExponentialNotation = useScientific;
return this;
}
/**
@ -3177,7 +3149,6 @@ public class DecimalFormat extends NumberFormat {
*
* @param minExpDig
* a value >= 1 indicating the fewest exponent digits that will be shown
* @return
* @exception IllegalArgumentException
* if <code>minExpDig</code> < 1
* @see #setScientificNotation
@ -3187,12 +3158,11 @@ public class DecimalFormat extends NumberFormat {
* @see #setExponentSignAlwaysShown
* @stable ICU 2.0
*/
public DecimalFormat setMinimumExponentDigits(byte minExpDig) {
public void setMinimumExponentDigits(byte minExpDig) {
if (minExpDig < 1) {
throw new IllegalArgumentException("Exponent digits must be >= 1");
}
minExponentDigits = minExpDig;
return this;
}
/**
@ -3217,7 +3187,6 @@ public class DecimalFormat extends NumberFormat {
* @param expSignAlways
* true if the exponent is always prefixed with either the localized minus sign or the localized plus
* sign, false if only negative exponents are prefixed with the localized minus sign.
* @return
* @see #setScientificNotation
* @see #isScientificNotation
* @see #setMinimumExponentDigits
@ -3225,9 +3194,8 @@ public class DecimalFormat extends NumberFormat {
* @see #isExponentSignAlwaysShown
* @stable ICU 2.0
*/
public DecimalFormat setExponentSignAlwaysShown(boolean expSignAlways) {
public void setExponentSignAlwaysShown(boolean expSignAlways) {
exponentSignAlwaysShown = expSignAlways;
return this;
}
/**
@ -3246,16 +3214,14 @@ public class DecimalFormat extends NumberFormat {
/**
* Set 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
*
* @see #getGroupingSize
* @see NumberFormat#setGroupingUsed
* @see DecimalFormatSymbols#setGroupingSeparator
* @stable ICU 2.0
*/
public DecimalFormat setGroupingSize(int newValue) {
public void setGroupingSize(int newValue) {
groupingSize = (byte) newValue;
return this;
}
/**
@ -3279,16 +3245,14 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the secondary grouping size. If set to a value less than 1, then secondary grouping is turned off, and the
* primary grouping size is used for all intervals, not just the least significant.
* @return
*
* @see #getSecondaryGroupingSize
* @see NumberFormat#setGroupingUsed
* @see DecimalFormatSymbols#setGroupingSeparator
* @stable ICU 2.0
*/
public DecimalFormat setSecondaryGroupingSize(int newValue) {
public void setSecondaryGroupingSize(int newValue) {
groupingSize2 = (byte) newValue;
return this;
}
/**
@ -3328,15 +3292,13 @@ public class DecimalFormat extends NumberFormat {
*
* @param newValue
* desired MathContext
* @return
* @see #mathContext
* @see #getMathContext
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public DecimalFormat setMathContextICU(MathContext newValue) {
public void setMathContextICU(MathContext newValue) {
mathContext = newValue;
return this;
}
/**
@ -3344,16 +3306,14 @@ public class DecimalFormat extends NumberFormat {
*
* @param newValue
* desired MathContext
* @return
* @see #mathContext
* @see #getMathContext
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public DecimalFormat setMathContext(java.math.MathContext newValue) {
public void setMathContext(java.math.MathContext newValue) {
mathContext = new MathContext(newValue.getPrecision(), MathContext.SCIENTIFIC, false, (newValue
.getRoundingMode()).ordinal());
return this;
}
/**
@ -3379,13 +3339,11 @@ public class DecimalFormat extends NumberFormat {
*
* <P>
* Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat setDecimalSeparatorAlwaysShown(boolean newValue) {
public void setDecimalSeparatorAlwaysShown(boolean newValue) {
decimalSeparatorAlwaysShown = newValue;
return this;
}
/**
@ -3412,15 +3370,13 @@ public class DecimalFormat extends NumberFormat {
*
* @param newInfo
* desired CurrencyPluralInfo
* @return
* @see CurrencyPluralInfo
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public DecimalFormat setCurrencyPluralInfo(CurrencyPluralInfo newInfo) {
public void setCurrencyPluralInfo(CurrencyPluralInfo newInfo) {
currencyPluralInfo = (CurrencyPluralInfo) newInfo.clone();
isReadyForParsing = false;
return this;
}
/**
@ -4082,13 +4038,11 @@ 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.
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat applyPattern(String pattern) {
public void applyPattern(String pattern) {
applyPattern(pattern, false);
return this;
}
/**
@ -4108,13 +4062,11 @@ 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.
* @return
*
* @stable ICU 2.0
*/
public DecimalFormat applyLocalizedPattern(String pattern) {
public void applyLocalizedPattern(String pattern) {
applyPattern(pattern, true);
return this;
}
/**
@ -4631,27 +4583,23 @@ public class DecimalFormat extends NumberFormat {
/**
* Sets the maximum number of digits allowed in the integer portion of a number. This override limits the integer
* digit count to 309.
* @return
*
* @see NumberFormat#setMaximumIntegerDigits
* @stable ICU 2.0
*/
public DecimalFormat setMaximumIntegerDigits(int newValue) {
public void setMaximumIntegerDigits(int newValue) {
super.setMaximumIntegerDigits(Math.min(newValue, DOUBLE_INTEGER_DIGITS));
return this;
}
/**
* Sets the minimum number of digits allowed in the integer portion of a number. This override limits the integer
* digit count to 309.
* @return
*
* @see NumberFormat#setMinimumIntegerDigits
* @stable ICU 2.0
*/
public DecimalFormat setMinimumIntegerDigits(int newValue) {
public void setMinimumIntegerDigits(int newValue) {
super.setMinimumIntegerDigits(Math.min(newValue, DOUBLE_INTEGER_DIGITS));
return this;
}
/**
@ -4683,10 +4631,9 @@ public class DecimalFormat extends NumberFormat {
*
* @param min
* the fewest significant digits to be shown
* @return
* @stable ICU 3.0
*/
public DecimalFormat setMinimumSignificantDigits(int min) {
public void setMinimumSignificantDigits(int min) {
if (min < 1) {
min = 1;
}
@ -4694,7 +4641,6 @@ public class DecimalFormat extends NumberFormat {
int max = Math.max(maxSignificantDigits, min);
minSignificantDigits = min;
maxSignificantDigits = max;
return this;
}
/**
@ -4704,10 +4650,9 @@ public class DecimalFormat extends NumberFormat {
*
* @param max
* the most significant digits to be shown
* @return
* @stable ICU 3.0
*/
public DecimalFormat setMaximumSignificantDigits(int max) {
public void setMaximumSignificantDigits(int max) {
if (max < 1) {
max = 1;
}
@ -4715,7 +4660,6 @@ public class DecimalFormat extends NumberFormat {
int min = Math.min(minSignificantDigits, max);
minSignificantDigits = min;
maxSignificantDigits = max;
return this;
}
/**
@ -4733,12 +4677,10 @@ public class DecimalFormat extends NumberFormat {
*
* @param useSignificantDigits
* true to use significant digits, or false to use integer and fraction digit counts
* @return
* @stable ICU 3.0
*/
public DecimalFormat setSignificantDigitsUsed(boolean useSignificantDigits) {
public void setSignificantDigitsUsed(boolean useSignificantDigits) {
this.useSignificantDigits = useSignificantDigits;
return this;
}
/**
@ -4748,10 +4690,9 @@ public class DecimalFormat extends NumberFormat {
*
* @param theCurrency
* new currency object to use. Must not be null.
* @return
* @stable ICU 2.2
*/
public DecimalFormat setCurrency(Currency theCurrency) {
public void setCurrency(Currency theCurrency) {
// If we are a currency format, then modify our affixes to
// encode the currency symbol for the given currency in our
// locale, and adjust the decimal digits and rounding for the
@ -4774,7 +4715,6 @@ public class DecimalFormat extends NumberFormat {
}
expandAffixes(null);
}
return this;
}
/**
@ -4795,27 +4735,23 @@ public class DecimalFormat extends NumberFormat {
/**
* Sets the maximum number of digits allowed in the fraction portion of a number. This override limits the fraction
* digit count to 340.
* @return
*
* @see NumberFormat#setMaximumFractionDigits
* @stable ICU 2.0
*/
public DecimalFormat setMaximumFractionDigits(int newValue) {
public void setMaximumFractionDigits(int newValue) {
super.setMaximumFractionDigits(Math.min(newValue, DOUBLE_FRACTION_DIGITS));
return this;
}
/**
* Sets the minimum number of digits allowed in the fraction portion of a number. This override limits the fraction
* digit count to 340.
* @return
*
* @see NumberFormat#setMinimumFractionDigits
* @stable ICU 2.0
*/
public DecimalFormat setMinimumFractionDigits(int newValue) {
public void setMinimumFractionDigits(int newValue) {
super.setMinimumFractionDigits(Math.min(newValue, DOUBLE_FRACTION_DIGITS));
return this;
}
/**
@ -4823,12 +4759,10 @@ public class DecimalFormat extends NumberFormat {
*
* @param value
* true if {@link #parse(String, ParsePosition)} method returns BigDecimal.
* @return
* @stable ICU 3.6
*/
public DecimalFormat setParseBigDecimal(boolean value) {
public void setParseBigDecimal(boolean value) {
parseBigDecimal = value;
return this;
}
/**

View file

@ -119,14 +119,12 @@ public class DictionaryBasedBreakIterator extends RuleBasedBreakIterator {
}
/** @return
* @stable ICU 2.0 */
public DictionaryBasedBreakIterator setText(CharacterIterator newText) {
/** @stable ICU 2.0 */
public void setText(CharacterIterator newText) {
super.setText(newText);
cachedBreakPositions = null;
fDictionaryCharCount = 0;
positionInCache = 0;
return this;
}
/**

View file

@ -458,11 +458,10 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
* {@link #formatToCharacterIterator formatToCharacterIterator} methods.
*
* @param locale the locale to be used when creating or comparing subformats
* @return
* @stable ICU 3.0
*/
public MessageFormat setLocale(Locale locale) {
return setLocale(ULocale.forLocale(locale));
public void setLocale(Locale locale) {
setLocale(ULocale.forLocale(locale));
}
/**
@ -473,17 +472,15 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
* {@link #formatToCharacterIterator formatToCharacterIterator} methods.
*
* @param locale the locale to be used when creating or comparing subformats
* @return
* @stable ICU 3.2
*/
public MessageFormat setLocale(ULocale locale) {
public void setLocale(ULocale locale) {
/* Save the pattern, and then reapply so that */
/* we pick up any changes in locale specific */
/* elements */
String existingPattern = toPattern(); /*ibm.3550*/
this.ulocale = locale;
applyPattern(existingPattern); /*ibm.3550*/
return this;
}
/**
@ -517,11 +514,10 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
* mixing them is not allowed.
*
* @param pttrn the pattern for this message format
* @return
* @throws IllegalArgumentException if the pattern is invalid
* @stable ICU 3.0
*/
public MessageFormat applyPattern(String pttrn) {
public void applyPattern(String pttrn) {
StringBuffer[] segments = new StringBuffer[4];
for (int i = 0; i < segments.length; ++i) {
segments[i] = new StringBuffer();
@ -588,7 +584,6 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
throw new IllegalArgumentException("Unmatched braces in the pattern.");
}
this.pattern = segments[0].toString();
return this;
}
@ -701,14 +696,13 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
*
* @param newFormats
* the new formats to use
* @return
* @throws NullPointerException
* if <code>newFormats</code> is null
* @throws IllegalArgumentException
* if this formatter uses named arguments
* @stable ICU 3.0
*/
public MessageFormat setFormatsByArgumentIndex(Format[] newFormats) {
public void setFormatsByArgumentIndex(Format[] newFormats) {
if (!argumentNamesAreNumeric) {
throw new IllegalArgumentException(
"This method is not available in MessageFormat objects " +
@ -720,7 +714,6 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
formats[i] = newFormats[j];
}
}
return this;
}
/**
@ -742,17 +735,15 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
*
* @param newFormats a map from String to Format providing new
* formats for named arguments.
* @return
* @stable ICU 3.8
*/
public MessageFormat setFormatsByArgumentName(Map<String, Format> newFormats) {
public void setFormatsByArgumentName(Map<String, Format> newFormats) {
for (int i = 0; i <= maxOffset; i++) {
if (newFormats.containsKey(argumentNames[i])) {
Format f = newFormats.get(argumentNames[i]);
formats[i] = f;
}
}
return this;
}
/**
@ -775,11 +766,10 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
* the <code>parse</code> methods.
*
* @param newFormats the new formats to use
* @return
* @exception NullPointerException if <code>newFormats</code> is null
* @stable ICU 3.0
*/
public MessageFormat setFormats(Format[] newFormats) {
public void setFormats(Format[] newFormats) {
int runsToCopy = newFormats.length;
if (runsToCopy > maxOffset + 1) {
runsToCopy = maxOffset + 1;
@ -787,7 +777,6 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
for (int i = 0; i < runsToCopy; i++) {
formats[i] = newFormats[i];
}
return this;
}
/**
@ -811,12 +800,11 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
* the argument index for which to use the new format
* @param newFormat
* the new format to use
* @return
* @exception IllegalArgumentException
* if alphanumeric arguments where used in MessageFormat.
* @stable ICU 3.0
*/
public MessageFormat setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
if (!argumentNamesAreNumeric) {
throw new IllegalArgumentException(
"This method is not available in MessageFormat objects " +
@ -827,7 +815,6 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
formats[j] = newFormat;
}
}
return this;
}
/**
@ -847,16 +834,14 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
*
* @param argumentName the name of the argument to change
* @param newFormat the new format to use
* @return
* @stable ICU 3.8
*/
public MessageFormat setFormatByArgumentName(String argumentName, Format newFormat) {
public void setFormatByArgumentName(String argumentName, Format newFormat) {
for (int i = 0; i <= maxOffset; ++i) {
if (argumentName.equals(argumentNames[i])) {
formats[i] = newFormat;
}
}
return this;
}
/**
@ -873,14 +858,12 @@ public class MessageFormat extends UFormat implements BaseFormat<Object,StringBu
*
* @param formatElementIndex the index of a format element within the pattern
* @param newFormat the format to use for the specified format element
* @return
* @exception ArrayIndexOutOfBoundsException if formatElementIndex is equal to or
* larger than the number of format elements in the pattern string
* @stable ICU 3.0
*/
public MessageFormat setFormat(int formatElementIndex, Format newFormat) {
public void setFormat(int formatElementIndex, Format newFormat) {
formats[formatElementIndex] = newFormat;
return this;
}
/**

View file

@ -1836,14 +1836,12 @@ public final class Normalizer implements Cloneable {
/**
* Reset the index to the beginning of the text.
* This is equivalent to setIndexOnly(startIndex)).
* @return
* @stable ICU 2.8
*/
public Normalizer reset() {
public void reset() {
text.setIndex(0);
currentIndex=nextIndex=0;
clearBuffer();
return this;
}
/**
@ -1853,14 +1851,12 @@ public final class Normalizer implements Cloneable {
* specified here.
*
* @param index the desired index in the input text.
* @return
* @stable ICU 2.8
*/
public Normalizer setIndexOnly(int index) {
public void setIndexOnly(int index) {
text.setIndex(index);
currentIndex=nextIndex=index; // validates index
clearBuffer();
return this;
}
/**
@ -2009,14 +2005,12 @@ public final class Normalizer implements Cloneable {
* <li>{@link #NONE} - Do nothing but return characters
* from the underlying input text.
* </ul>
* @return
*
* @see #getMode
* @stable ICU 2.8
*/
public Normalizer setMode(Mode newMode) {
public void setMode(Mode newMode) {
mode = newMode;
return this;
}
/**
* Return the basic operation performed by this <tt>Normalizer</tt>
@ -2041,18 +2035,16 @@ public final class Normalizer implements Cloneable {
* @param option the option whose value is to be set.
* @param value the new setting for the option. Use <tt>true</tt> to
* turn the option on and <tt>false</tt> to turn it off.
* @return
*
* @see #getOption
* @stable ICU 2.6
*/
public Normalizer setOption(int option,boolean value) {
public void setOption(int option,boolean value) {
if (value) {
options |= option;
} else {
options &= (~option);
}
return this;
}
/**
@ -2104,85 +2096,80 @@ public final class Normalizer implements Cloneable {
* Set the input text over which this <tt>Normalizer</tt> will iterate.
* The iteration position is set to the beginning of the input text->
* @param newText The new string to be normalized.
* @return
* @stable ICU 2.8
*/
public Normalizer setText(StringBuffer newText) {
public void setText(StringBuffer newText) {
UCharacterIterator newIter = UCharacterIterator.getInstance(newText);
if (newIter == null) {
throw new IllegalStateException("Could not create a new UCharacterIterator");
}
text = newIter;
return reset();
reset();
}
/**
* Set the input text over which this <tt>Normalizer</tt> will iterate.
* The iteration position is set to the beginning of the input text->
* @param newText The new string to be normalized.
* @return
* @stable ICU 2.8
*/
public Normalizer setText(char[] newText) {
public void setText(char[] newText) {
UCharacterIterator newIter = UCharacterIterator.getInstance(newText);
if (newIter == null) {
throw new IllegalStateException("Could not create a new UCharacterIterator");
}
text = newIter;
return reset();
reset();
}
/**
* Set the input text over which this <tt>Normalizer</tt> will iterate.
* The iteration position is set to the beginning of the input text->
* @param newText The new string to be normalized.
* @return
* @stable ICU 2.8
*/
public Normalizer setText(String newText) {
public void setText(String newText) {
UCharacterIterator newIter = UCharacterIterator.getInstance(newText);
if (newIter == null) {
throw new IllegalStateException("Could not create a new UCharacterIterator");
}
text = newIter;
return reset();
reset();
}
/**
* Set the input text over which this <tt>Normalizer</tt> will iterate.
* The iteration position is set to the beginning of the input text->
* @param newText The new string to be normalized.
* @return
* @stable ICU 2.8
*/
public Normalizer setText(CharacterIterator newText) {
public void setText(CharacterIterator newText) {
UCharacterIterator newIter = UCharacterIterator.getInstance(newText);
if (newIter == null) {
throw new IllegalStateException("Could not create a new UCharacterIterator");
}
text = newIter;
return reset();
reset();
}
/**
* Set the input text over which this <tt>Normalizer</tt> will iterate.
* The iteration position is set to the beginning of the string.
* @param newText The new string to be normalized.
* @return
* @stable ICU 2.8
*/
public Normalizer setText(UCharacterIterator newText) {
public void setText(UCharacterIterator newText) {
try{
UCharacterIterator newIter = (UCharacterIterator)newText.clone();
if (newIter == null) {
throw new IllegalStateException("Could not create a new UCharacterIterator");
}
text = newIter;
return reset();
reset();
}catch(CloneNotSupportedException e) {
throw new IllegalStateException("Could not clone the UCharacterIterator");
}

View file

@ -461,13 +461,11 @@ public abstract class NumberFormat extends UFormat {
/**
* Sets whether or not numbers should be parsed as integers only.
* @param value true if this should parse integers only
* @return
* @see #isParseIntegerOnly
* @stable ICU 2.0
*/
public NumberFormat setParseIntegerOnly(boolean value) {
public void setParseIntegerOnly(boolean value) {
parseIntegerOnly = value;
return this;
}
/**
@ -486,13 +484,11 @@ public abstract class NumberFormat extends UFormat {
* When strict parsing is off, leading zeros and all grouping separators are ignored.
* This is the default behavior.
* @param value True to enable strict parsing. Default is false.
* @return
* @see #isParseStrict
* @stable ICU 3.6
*/
public NumberFormat setParseStrict(boolean value) {
public void setParseStrict(boolean value) {
parseStrict = value;
return this;
}
/**
@ -1039,12 +1035,10 @@ public abstract class NumberFormat extends UFormat {
* affects both parsing and formatting.
* @see #isGroupingUsed
* @param newValue true to use grouping.
* @return
* @stable ICU 2.0
*/
public NumberFormat setGroupingUsed(boolean newValue) {
public void setGroupingUsed(boolean newValue) {
groupingUsed = newValue;
return this;
}
/**
@ -1069,15 +1063,13 @@ public abstract class NumberFormat extends UFormat {
* @param newValue the maximum number of integer digits to be shown; if
* less than zero, then zero is used. Subclasses might enforce an
* upper limit to this value appropriate to the numeric type being formatted.
* @return
* @see #getMaximumIntegerDigits
* @stable ICU 2.0
*/
public NumberFormat setMaximumIntegerDigits(int newValue) {
public void setMaximumIntegerDigits(int newValue) {
maximumIntegerDigits = Math.max(0,newValue);
if (minimumIntegerDigits > maximumIntegerDigits)
minimumIntegerDigits = maximumIntegerDigits;
return this;
}
/**
@ -1103,15 +1095,13 @@ public abstract class NumberFormat extends UFormat {
* @param newValue the minimum number of integer digits to be shown; if
* less than zero, then zero is used. Subclasses might enforce an
* upper limit to this value appropriate to the numeric type being formatted.
* @return
* @see #getMinimumIntegerDigits
* @stable ICU 2.0
*/
public NumberFormat setMinimumIntegerDigits(int newValue) {
public void setMinimumIntegerDigits(int newValue) {
minimumIntegerDigits = Math.max(0,newValue);
if (minimumIntegerDigits > maximumIntegerDigits)
maximumIntegerDigits = minimumIntegerDigits;
return this;
}
/**
@ -1137,15 +1127,13 @@ public abstract class NumberFormat extends UFormat {
* @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.
* @return
* @see #getMaximumFractionDigits
* @stable ICU 2.0
*/
public NumberFormat setMaximumFractionDigits(int newValue) {
public void setMaximumFractionDigits(int newValue) {
maximumFractionDigits = Math.max(0,newValue);
if (maximumFractionDigits < minimumFractionDigits)
minimumFractionDigits = maximumFractionDigits;
return this;
}
/**
@ -1171,15 +1159,13 @@ public abstract class NumberFormat extends UFormat {
* @param newValue the minimum number of fraction digits to be shown; if
* less than zero, then zero is used. Subclasses might enforce an
* upper limit to this value appropriate to the numeric type being formatted.
* @return
* @see #getMinimumFractionDigits
* @stable ICU 2.0
*/
public NumberFormat setMinimumFractionDigits(int newValue) {
public void setMinimumFractionDigits(int newValue) {
minimumFractionDigits = Math.max(0,newValue);
if (maximumFractionDigits < minimumFractionDigits)
maximumFractionDigits = minimumFractionDigits;
return this;
}
/**
@ -1190,12 +1176,10 @@ public abstract class NumberFormat extends UFormat {
* currency format.
* @param theCurrency new currency object to use. May be null for
* some subclasses.
* @return
* @stable ICU 2.6
*/
public NumberFormat setCurrency(Currency theCurrency) {
public void setCurrency(Currency theCurrency) {
currency = theCurrency;
return this;
}
/**
@ -1245,11 +1229,10 @@ public abstract class NumberFormat extends UFormat {
* @param roundingMode A rounding mode, between
* <code>BigDecimal.ROUND_UP</code> and
* <code>BigDecimal.ROUND_UNNECESSARY</code>.
* @return
* @see #getRoundingMode()
* @stable ICU 4.0
*/
public NumberFormat setRoundingMode(int roundingMode) {
public void setRoundingMode(int roundingMode) {
throw new UnsupportedOperationException("setRoundingMode must be implemented by the subclass implementation.");
}

View file

@ -315,11 +315,10 @@ public class PluralFormat extends UFormat {
* Patterns and their interpretation are specified in the class description.
*
* @param pttrn the pattern for this plural format.
* @return
* @throws IllegalArgumentException if the pattern is invalid.
* @stable ICU 3.8
*/
public PluralFormat applyPattern(String pttrn) {
public void applyPattern(String pttrn) {
pttrn = pttrn.trim();
this.pattern = pttrn;
@ -404,7 +403,6 @@ public class PluralFormat extends UFormat {
"Malformed formatting expression. Braces do not match.");
}
checkSufficientDefinition();
return this;
}
/**
@ -513,15 +511,13 @@ public class PluralFormat extends UFormat {
* @param ulocale the <code>ULocale</code> used to configure the
* formatter. If <code>ulocale</code> is <code>null</code>, the
* default locale will be used.
* @return
* @stable ICU 3.8
*/
public PluralFormat setLocale(ULocale ulocale) {
public void setLocale(ULocale ulocale) {
if (ulocale == null) {
ulocale = ULocale.getDefault();
}
init(null, ulocale);
return this;
}
/**
@ -529,12 +525,10 @@ public class PluralFormat extends UFormat {
* call this if you want a different number format than the default
* formatter for the locale.
* @param format the number format to use.
* @return
* @stable ICU 3.8
*/
public PluralFormat setNumberFormat(NumberFormat format) {
public void setNumberFormat(NumberFormat format) {
numberFormat = format;
return this;
}
/*

View file

@ -103,14 +103,12 @@ class Quantifier implements UnicodeMatcher {
* characters that may be matched by this object into the given
* set.
* @param toUnionTo the set into which to union the source characters
* @return
* @returns a reference to toUnionTo
*/
public Quantifier addMatchSetTo(UnicodeSet toUnionTo) {
public void addMatchSetTo(UnicodeSet toUnionTo) {
if (maxCount > 0) {
matcher.addMatchSetTo(toUnionTo);
}
return this;
}
}

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -103,7 +103,7 @@ public interface Replaceable {
* @param dstStart the start offset in the destination array.
* @stable ICU 2.0
*/
Replaceable getChars(int srcStart, int srcLimit, char dst[], int dstStart);
void getChars(int srcStart, int srcLimit, char dst[], int dstStart);
/**
* Replaces a substring of this object with the given text.
@ -123,7 +123,7 @@ public interface Replaceable {
* to <code>limit - 1</code>
* @stable ICU 2.0
*/
Replaceable replace(int start, int limit, String text);
void replace(int start, int limit, String text);
/**
* Replaces a substring of this object with the given text.
@ -146,7 +146,7 @@ public interface Replaceable {
* @param charsLen the number of characters of <code>chars</code>.
* @stable ICU 2.0
*/
Replaceable replace(int start, int limit, char[] chars,
void replace(int start, int limit, char[] chars,
int charsStart, int charsLen);
// Note: We use length rather than limit to conform to StringBuffer
// and System.arraycopy.
@ -172,7 +172,7 @@ public interface Replaceable {
* dest >= limit</code>.
* @stable ICU 2.0
*/
Replaceable copy(int start, int limit, int dest);
void copy(int start, int limit, int dest);
/**
* Returns true if this object contains metadata. If a

View file

@ -123,14 +123,12 @@ public class ReplaceableString implements Replaceable {
* <code>start <= limit <= length()</code>.
* @param dst the destination array.
* @param dstStart the start offset in the destination array.
* @return
* @stable ICU 2.0
*/
public ReplaceableString getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
if (srcStart != srcLimit) {
buf.getChars(srcStart, srcLimit, dst, dstStart);
}
return this;
}
/**
@ -142,12 +140,10 @@ public class ReplaceableString implements Replaceable {
* <= length()</code>.
* @param text new text to replace characters <code>start</code> to
* <code>limit - 1</code>
* @return
* @stable ICU 2.0
*/
public ReplaceableString replace(int start, int limit, String text) {
public void replace(int start, int limit, String text) {
buf.replace(start, limit, text);
return this;
}
/**
@ -161,14 +157,12 @@ public class ReplaceableString implements Replaceable {
* @param charsStart the beginning index into <code>chars</code>,
* inclusive; <code>0 <= start <= limit</code>.
* @param charsLen the number of characters of <code>chars</code>.
* @return
* @stable ICU 2.0
*/
public ReplaceableString replace(int start, int limit, char[] chars,
public void replace(int start, int limit, char[] chars,
int charsStart, int charsLen) {
buf.delete(start, limit);
buf.insert(start, chars, charsStart, charsLen);
return this;
}
/**
@ -184,17 +178,15 @@ public class ReplaceableString implements Replaceable {
* <code>start..limit-1</code> will be copied to <code>dest</code>.
* Implementations of this method may assume that <code>dest <= start ||
* dest >= limit</code>.
* @return
* @stable ICU 2.0
*/
public ReplaceableString copy(int start, int limit, int dest) {
public void copy(int start, int limit, int dest) {
if (start == limit && start >= 0 && start <= buf.length()) {
return this;
return;
}
char[] text = new char[limit - start];
getChars(start, limit, text, 0);
replace(dest, dest, text, 0, limit - start);
return this;
}
/**

View file

@ -786,13 +786,11 @@ public int getRuleStatusVec(int[] fillInArray) {
* Set the iterator to analyze a new piece of text. This function resets
* the current iteration position to the beginning of the text.
* @param newText An iterator over the text to analyze.
* @return
* @stable ICU 2.0
*/
public RuleBasedBreakIterator setText(CharacterIterator newText) {
public void setText(CharacterIterator newText) {
fText = newText;
this.first();
return this;
}
/**

View file

@ -1247,14 +1247,12 @@ public class RuleBasedNumberFormat extends NumberFormat {
* it is available on the classpath. Otherwise this will have no effect.
*
* @param enabled If true, turns lenient-parse mode on; if false, turns it off.
* @return
* @see RbnfLenientScanner
* @see RbnfLenientScannerProvider
* @stable ICU 2.0
*/
public RuleBasedNumberFormat setLenientParseMode(boolean enabled) {
public void setLenientParseMode(boolean enabled) {
lenientParse = enabled;
return this;
}
/**
@ -1273,14 +1271,12 @@ public class RuleBasedNumberFormat extends NumberFormat {
* {@link #setLenientParseMode}
* has no effect. This is necessary to decouple collation from format code.
* @param scannerProvider the provider
* @return
* @see #setLenientParseMode
* @see #getLenientScannerProvider
* @draft ICU 4.4
*/
public RuleBasedNumberFormat setLenientScannerProvider(RbnfLenientScannerProvider scannerProvider) {
public void setLenientScannerProvider(RbnfLenientScannerProvider scannerProvider) {
this.scannerProvider = scannerProvider;
return this;
}
/**
@ -1316,11 +1312,10 @@ public class RuleBasedNumberFormat extends NumberFormat {
* Override the default rule set to use. If ruleSetName is null, reset
* to the initial default rule set.
* @param ruleSetName the name of the rule set, or null to reset the initial default.
* @return
* @throws IllegalArgumentException if ruleSetName is not the name of a public ruleset.
* @stable ICU 2.0
*/
public RuleBasedNumberFormat setDefaultRuleSet(String ruleSetName) {
public void setDefaultRuleSet(String ruleSetName) {
if (ruleSetName == null) {
if (publicRuleSetNames.length > 0) {
defaultRuleSet = findRuleSet(publicRuleSetNames[0]);
@ -1334,7 +1329,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
currentName.equals("%duration")) {
defaultRuleSet = ruleSets[n];
return this;
return;
}
}
@ -1351,7 +1346,6 @@ public class RuleBasedNumberFormat extends NumberFormat {
} else {
defaultRuleSet = findRuleSet(ruleSetName);
}
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -147,13 +147,12 @@ public abstract class SearchIterator
* This method clears any previous match.
* </p>
* @param position position from which to start the next search
* @return
* @exception IndexOutOfBoundsException thrown if argument position is out
* of the target text range.
* @see #getIndex
* @stable ICU 2.8
*/
public SearchIterator setIndex(int position) {
public void setIndex(int position) {
if (position < targetText.getBeginIndex()
|| position > targetText.getEndIndex()) {
throw new IndexOutOfBoundsException(
@ -163,7 +162,6 @@ public abstract class SearchIterator
m_setOffset_ = position;
m_reset_ = false;
matchLength = 0;
return this;
}
/**
@ -175,14 +173,12 @@ public abstract class SearchIterator
* The default setting of this property is false
* </p>
* @param allowOverlap flag indicator if overlapping matches are allowed
* @return
* @see #isOverlapping
* @stable ICU 2.8
*/
public SearchIterator setOverlapping(boolean allowOverlap)
public void setOverlapping(boolean allowOverlap)
{
m_isOverlap_ = allowOverlap;
return this;
}
/**
@ -193,18 +189,16 @@ public abstract class SearchIterator
* See class documentation for more information.
* @param breakiter A BreakIterator that will be used to restrict the
* points at which matches are detected.
* @return
* @see #getBreakIterator
* @see BreakIterator
* @stable ICU 2.0
*/
public SearchIterator setBreakIterator(BreakIterator breakiter)
public void setBreakIterator(BreakIterator breakiter)
{
breakIterator = breakiter;
if (breakIterator != null) {
breakIterator.setText(targetText);
}
return this;
}
/**
@ -212,13 +206,12 @@ public abstract class SearchIterator
* the start of the text string. This method is useful if you want to
* reuse an iterator to search within a different body of text.
* @param text new text iterator to look for match,
* @return
* @exception IllegalArgumentException thrown when text is null or has
* 0 length
* @see #getTarget
* @stable ICU 2.4
*/
public SearchIterator setTarget(CharacterIterator text)
public void setTarget(CharacterIterator text)
{
if (text == null || text.getEndIndex() == text.getIndex()) {
throw new IllegalArgumentException("Illegal null or empty text");
@ -232,7 +225,6 @@ public abstract class SearchIterator
if (breakIterator != null) {
breakIterator.setText(targetText);
}
return this;
}
// public getters ----------------------------------------------------
@ -522,10 +514,9 @@ public abstract class SearchIterator
* start of the target text. Otherwise, if a backwards iteration is initiated,
* the next search will begin at the end of the target text.
* </p>
* @return
* @stable ICU 2.8
*/
public SearchIterator reset()
public void reset()
{
// reset is setting the attributes that are already in string search
matchLength = 0;
@ -534,7 +525,6 @@ public abstract class SearchIterator
m_isForwardSearching_ = true;
m_reset_ = true;
m_setOffset_ = DONE;
return this;
}
/**

View file

@ -596,12 +596,10 @@ public class SimpleDateFormat extends DateFormat {
* to begin on the date the user specifies.
* @param startDate During parsing, two digit years will be placed in the range
* <code>startDate</code> to <code>startDate + 100 years</code>.
* @return
* @stable ICU 2.0
*/
public SimpleDateFormat set2DigitYearStart(Date startDate) {
public void set2DigitYearStart(Date startDate) {
parseAmbiguousDatesAsAfter(startDate);
return this;
}
/**
@ -1522,14 +1520,12 @@ public class SimpleDateFormat extends DateFormat {
/**
* Overrides superclass method
* @return
* @stable ICU 2.0
*/
public SimpleDateFormat setNumberFormat(NumberFormat newNumberFormat) {
public void setNumberFormat(NumberFormat newNumberFormat) {
// Override this method to update local zero padding number formatter
super.setNumberFormat(newNumberFormat);
initLocalZeroPaddingNumberFormat();
return this;
}
private void initLocalZeroPaddingNumberFormat() {
@ -1611,11 +1607,10 @@ public class SimpleDateFormat extends DateFormat {
/**
* Overrides DateFormat
* @return
* @see DateFormat
* @stable ICU 2.0
*/
public SimpleDateFormat parse(String text, Calendar cal, ParsePosition parsePos)
public void parse(String text, Calendar cal, ParsePosition parsePos)
{
TimeZone backupTZ = null;
Calendar resultCal = null;
@ -1693,7 +1688,7 @@ public class SimpleDateFormat extends DateFormat {
if (backupTZ != null) {
calendar.setTimeZone(backupTZ);
}
return this;
return;
}
i = numericFieldStart;
pos = numericStartPos;
@ -1713,7 +1708,7 @@ public class SimpleDateFormat extends DateFormat {
if (backupTZ != null) {
calendar.setTimeZone(backupTZ);
}
return this;
return;
}
}
} else {
@ -1751,7 +1746,7 @@ public class SimpleDateFormat extends DateFormat {
if (backupTZ != null) {
calendar.setTimeZone(backupTZ);
}
return this;
return;
}
}
++i;
@ -1914,7 +1909,7 @@ public class SimpleDateFormat extends DateFormat {
if (backupTZ != null) {
calendar.setTimeZone(backupTZ);
}
return this;
return;
}
// Set the parsed result if local calendar is used
// instead of the input calendar
@ -1926,7 +1921,6 @@ public class SimpleDateFormat extends DateFormat {
if (backupTZ != null) {
calendar.setTimeZone(backupTZ);
}
return this;
}
/**
@ -2573,29 +2567,25 @@ public class SimpleDateFormat extends DateFormat {
/**
* Apply the given unlocalized pattern string to this date format.
* @return
* @stable ICU 2.0
*/
public SimpleDateFormat applyPattern(String pat)
public void applyPattern(String pat)
{
this.pattern = pat;
setLocale(null, null);
// reset parsed pattern items
patternItems = null;
return this;
}
/**
* Apply the given localized pattern string to this date format.
* @return
* @stable ICU 2.0
*/
public SimpleDateFormat applyLocalizedPattern(String pat) {
public void applyLocalizedPattern(String pat) {
this.pattern = translatePattern(pat,
formatData.localPatternChars,
DateFormatSymbols.patternChars);
setLocale(null, null);
return this;
}
/**
@ -2612,14 +2602,12 @@ public class SimpleDateFormat extends DateFormat {
/**
* Allows you to set the date/time formatting data.
* @param newFormatSymbols the new symbols
* @return
* @stable ICU 2.0
*/
public SimpleDateFormat setDateFormatSymbols(DateFormatSymbols newFormatSymbols)
public void setDateFormatSymbols(DateFormatSymbols newFormatSymbols)
{
this.formatData = (DateFormatSymbols)newFormatSymbols.clone();
gmtfmtCache = null;
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -90,10 +90,9 @@ public final class StringCharacterIterator implements CharacterIterator
* is called.
*
* @param text The String to be iterated over
* @return
* @deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
*/
public StringCharacterIterator setText(String text) {
public void setText(String text) {
if (text == null) {
throw new NullPointerException();
}
@ -101,7 +100,6 @@ public final class StringCharacterIterator implements CharacterIterator
this.begin = 0;
this.end = text.length();
this.pos = 0;
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -265,25 +265,22 @@ public abstract class UCharacterIterator
* supplied
* @stable ICU 2.4
*/
public abstract UCharacterIterator setIndex(int index);
public abstract void setIndex(int index);
/**
* Sets the current index to the limit.
* @stable ICU 2.4
*/
public UCharacterIterator setToLimit() {
public void setToLimit() {
setIndex(getLength());
return this;
}
/**
* Sets the current index to the start.
* @return
* @stable ICU 2.4
*/
public UCharacterIterator setToStart() {
public void setToStart() {
setIndex(0);
return this;
}
/**

View file

@ -73,13 +73,12 @@ public abstract class UFormat extends Format implements BaseFormat<Object,String
* data, or null
* @param actual the locale containing data used to construct this
* object, or null
* @return
* @see com.ibm.icu.util.ULocale
* @see com.ibm.icu.util.ULocale#VALID_LOCALE
* @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
* @internal
*/
final UFormat setLocale(ULocale valid, ULocale actual) {
final void setLocale(ULocale valid, ULocale actual) {
// Change the following to an assertion later
if ((valid == null) != (actual == null)) {
///CLOVER:OFF
@ -90,7 +89,6 @@ public abstract class UFormat extends Format implements BaseFormat<Object,String
// the same level or less specific than the valid locale.
this.validLocale = valid;
this.actualLocale = actual;
return this;
}
/**

View file

@ -2594,13 +2594,12 @@ public final class UTF16 {
* true for code point compare, false for code unit compare
* @stable ICU 2.4
*/
public StringComparator setCodePointCompare(boolean flag) {
public void setCodePointCompare(boolean flag) {
if (flag) {
m_codePointCompare_ = Normalizer.COMPARE_CODE_POINT_ORDER;
} else {
m_codePointCompare_ = 0;
}
return this;
}
/**
@ -2617,13 +2616,12 @@ public final class UTF16 {
* @see #FOLD_CASE_EXCLUDE_SPECIAL_I
* @stable ICU 2.4
*/
public StringComparator setIgnoreCase(boolean ignorecase, int foldcaseoption) {
public void setIgnoreCase(boolean ignorecase, int foldcaseoption) {
m_ignoreCase_ = ignorecase;
if (foldcaseoption < FOLD_CASE_DEFAULT || foldcaseoption > FOLD_CASE_EXCLUDE_SPECIAL_I) {
throw new IllegalArgumentException("Invalid fold case option");
}
m_foldCase_ = foldcaseoption;
return this;
}
// public getters ----------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2001-2009, International Business Machines Corporation and *
* Copyright (C) 2001-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -132,7 +132,7 @@ public interface UnicodeMatcher {
* @param toUnionTo the set into which to union the source characters
* @stable ICU 2.2
*/
public abstract UnicodeMatcher addMatchSetTo(UnicodeSet toUnionTo);
public abstract void addMatchSetTo(UnicodeSet toUnionTo);
}
//eof

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2009, International Business Machines Corporation
* Copyright (c) 2002, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -58,7 +58,7 @@ interface UnicodeReplacer {
* into the given set.
* @param toUnionTo the set into which to union the output characters
*/
public abstract UnicodeReplacer addReplacementSetTo(UnicodeSet toUnionTo);
public abstract void addReplacementSetTo(UnicodeSet toUnionTo);
}
//eof

View file

@ -1004,12 +1004,10 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
* characters that may be matched by this object into the given
* set.
* @param toUnionTo the set into which to union the source characters
* @return
* @stable ICU 2.2
*/
public UnicodeSet addMatchSetTo(UnicodeSet toUnionTo) {
public void addMatchSetTo(UnicodeSet toUnionTo) {
toUnionTo.addAll(this);
return this;
}
/**

View file

@ -186,20 +186,18 @@ public class UnicodeSetIterator {
* resets it to the start of that set. The iterator is valid only
* so long as <tt>set</tt> is valid.
* @param uset the set to iterate over.
* @return
* @stable ICU 2.0
*/
public UnicodeSetIterator reset(UnicodeSet uset) {
public void reset(UnicodeSet uset) {
set = uset;
return reset();
reset();
}
/**
* Resets this iterator to the start of the set.
* @return
* @stable ICU 2.0
*/
public UnicodeSetIterator reset() {
public void reset() {
endRange = set.getRangeCount() - 1;
range = 0;
endElement = -1;
@ -214,7 +212,6 @@ public class UnicodeSetIterator {
stringIterator = null;
}
}
return this;
}
/**

View file

@ -545,11 +545,10 @@ public abstract class BasicTimeZone extends TimeZone {
/**
* Get time zone offsets from local wall time.
* @return
* @internal
* @deprecated This API is ICU internal only.
*/
public BasicTimeZone getOffsetFromLocal(long date,
public void getOffsetFromLocal(long date,
int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets) {
throw new IllegalStateException("Not implemented");
}

View file

@ -2045,10 +2045,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
/**
* Sets this Calendar's current time from the given long value.
* @param millis the new time in UTC milliseconds from the epoch.
* @return
* @stable ICU 2.0
*/
public Calendar setTimeInMillis( long millis ) {
public void setTimeInMillis( long millis ) {
if (millis > MAX_MILLIS) {
millis = MAX_MILLIS;
} else if (millis < MIN_MILLIS) {
@ -2057,7 +2056,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
time = millis;
areFieldsSet = areAllFieldsSet = false;
isTimeSet = areFieldsVirtuallySet = true;
return this;
}
/**
@ -2656,7 +2654,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* <p>
* @param field the calendar field to roll.
* @param amount the amount by which the field should be rolled.
* @return
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
@ -2664,10 +2661,10 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* @see #add
* @stable ICU 2.0
*/
public Calendar roll(int field, int amount) {
public void roll(int field, int amount) {
if (amount == 0) {
return this; // Nothing to do
return; // Nothing to do
}
complete();
@ -2696,7 +2693,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
value += min;
set(field, value);
return this;
return;
}
case HOUR:
@ -2718,7 +2715,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
newHour += max + 1;
}
setTimeInMillis(start + ONE_HOUR * (newHour - oldHour));
return this;
return;
}
case MONTH:
@ -2739,7 +2736,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
// into the next month; e.g., we don't want jan31 + 1 mo -> feb31 ->
// mar3.
pinField(DAY_OF_MONTH);
return this;
return;
}
case YEAR:
@ -2749,7 +2746,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
set(field, internalGet(field) + amount);
pinField(MONTH);
pinField(DAY_OF_MONTH);
return this;
return;
case WEEK_OF_MONTH:
{
@ -2830,7 +2827,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
// the appropriate fields here so that DAY_OF_MONTH is attended
// to.
set(DAY_OF_MONTH, day_of_month);
return this;
return;
}
case WEEK_OF_YEAR:
{
@ -2887,7 +2884,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
// have to be updated as well.
set(DAY_OF_YEAR, day_of_year);
clear(MONTH);
return this;
return;
}
case DAY_OF_YEAR:
{
@ -2899,7 +2896,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
time = (time + delta - min2) % (yearLength*ONE_DAY);
if (time < 0) time += yearLength*ONE_DAY;
setTimeInMillis(time + min2);
return this;
return;
}
case DAY_OF_WEEK:
case DOW_LOCAL:
@ -2917,7 +2914,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
time = (time + delta - min2) % ONE_WEEK;
if (time < 0) time += ONE_WEEK;
setTimeInMillis(time + min2);
return this;
return;
}
case DAY_OF_WEEK_IN_MONTH:
{
@ -2939,11 +2936,11 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
time = (time + delta - min2) % gap2;
if (time < 0) time += gap2;
setTimeInMillis(time + min2);
return this;
return;
}
case JULIAN_DAY:
set(field, internalGet(field) + amount);
return this;
return;
default:
// Other fields cannot be rolled by this method
throw new IllegalArgumentException("Calendar.roll(" + fieldName(field) +
@ -2994,17 +2991,16 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* <p>
* @param field the time field.
* @param amount the amount to add to the field.
* @return
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
* @see #roll(int, int)
* @stable ICU 2.0
*/
public Calendar add(int field, int amount) {
public void add(int field, int amount) {
if (amount == 0) {
return this; // Do nothing!
return; // Do nothing!
}
// We handle most fields in the same way. The algorithm is to add
@ -3034,7 +3030,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
case ERA:
set(field, get(field) + amount);
pinField(ERA);
return this;
return;
case YEAR:
case EXTENDED_YEAR:
@ -3042,7 +3038,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
case MONTH:
set(field, get(field) + amount);
pinField(DAY_OF_MONTH);
return this;
return;
case WEEK_OF_YEAR:
case WEEK_OF_MONTH:
@ -3118,7 +3114,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
}
}
}
return this;
}
/**
@ -3758,10 +3753,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
/**
* Sets the time zone with the given time zone value.
* @param value the given time zone.
* @return
* @stable ICU 2.0
*/
public Calendar setTimeZone(TimeZone value)
public void setTimeZone(TimeZone value)
{
zone = value;
/* Recompute the fields from the time using the new zone. This also
@ -3774,7 +3768,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* AFTER it up to the next call to complete().
*/
areFieldsSet = false;
return this;
}
/**
@ -3793,15 +3786,13 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* treated as being equivalent to the 941st day after February 1, 1996.
* With strict interpretation, such dates will cause an exception to be
* thrown.
* @return
*
* @see DateFormat#setLenient
* @stable ICU 2.0
*/
public Calendar setLenient(boolean lenient)
public void setLenient(boolean lenient)
{
this.lenient = lenient;
return this;
}
/**
@ -3817,10 +3808,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* Sets what the first day of the week is; e.g., Sunday in US,
* Monday in France.
* @param value the given first day of the week.
* @return
* @stable ICU 2.0
*/
public Calendar setFirstDayOfWeek(int value)
public void setFirstDayOfWeek(int value)
{
if (firstDayOfWeek != value) {
if (value < SUNDAY || value > SATURDAY) {
@ -3829,7 +3819,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
firstDayOfWeek = value;
areFieldsSet = false;
}
return this;
}
/**
@ -3850,10 +3839,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* must be a full week, use value 7.
* @param value the given minimal days required in the first week
* of the year.
* @return
* @stable ICU 2.0
*/
public Calendar setMinimalDaysInFirstWeek(int value)
public void setMinimalDaysInFirstWeek(int value)
{
// Values less than 1 have the same effect as 1; values greater
// than 7 have the same effect as 7. However, we normalize values
@ -3867,7 +3855,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
minimalDaysInFirstWeek = value;
areFieldsSet = false;
}
return this;
}
/**

View file

@ -481,10 +481,9 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to handle leap months properly.
* @return
* @stable ICU 2.8
*/
public ChineseCalendar add(int field, int amount) {
public void add(int field, int amount) {
switch (field) {
case MONTH:
if (amount != 0) {
@ -498,15 +497,13 @@ public class ChineseCalendar extends Calendar {
super.add(field, amount);
break;
}
return this;
}
/**
* Override Calendar to handle leap months properly.
* @return
* @stable ICU 2.8
*/
public ChineseCalendar roll(int field, int amount) {
public void roll(int field, int amount) {
switch (field) {
case MONTH:
if (amount != 0) {
@ -558,7 +555,6 @@ public class ChineseCalendar extends Calendar {
super.roll(field, amount);
break;
}
return this;
}
//------------------------------------------------------------------

View file

@ -473,10 +473,9 @@ public class GregorianCalendar extends Calendar {
* set the change date to <code>Date(Long.MIN_VALUE)</code>.
*
* @param date the given Gregorian cutover date.
* @return
* @stable ICU 2.0
*/
public GregorianCalendar setGregorianChange(Date date) {
public void setGregorianChange(Date date) {
gregorianCutover = date.getTime();
// If the cutover has an extreme value, then create a pure
@ -497,7 +496,6 @@ public class GregorianCalendar extends Calendar {
cal.setTime(date);
gregorianCutoverYear = cal.get(EXTENDED_YEAR);
}
return this;
}
/**
@ -548,10 +546,9 @@ public class GregorianCalendar extends Calendar {
/**
* Roll a field by a signed amount.
* @return
* @stable ICU 2.0
*/
public GregorianCalendar roll(int field, int amount) {
public void roll(int field, int amount) {
switch (field) {
case WEEK_OF_YEAR:
@ -596,12 +593,12 @@ public class GregorianCalendar extends Calendar {
}
set(WEEK_OF_YEAR, woy);
set(YEAR, isoYear); // Why not YEAR_WOY? - Alan 11/6/00
return this;
return;
}
default:
super.roll(field, amount);
return this;
return;
}
}

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -432,13 +432,12 @@ public class HebrewCalendar extends Calendar {
* <p>
* @param field the time field.
* @param amount the amount to add to the field.
* @return
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
* @stable ICU 2.8
*/
public HebrewCalendar add(int field, int amount)
public void add(int field, int amount)
{
switch (field) {
case MONTH:
@ -490,7 +489,6 @@ public class HebrewCalendar extends Calendar {
super.add(field, amount);
break;
}
return this;
}
/**
@ -520,13 +518,12 @@ public class HebrewCalendar extends Calendar {
* <p>
* @param field the time field.
* @param amount the amount by which the field should be rolled.
* @return
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
* @stable ICU 2.8
*/
public HebrewCalendar roll(int field, int amount)
public void roll(int field, int amount)
{
switch (field) {
case MONTH:
@ -550,12 +547,11 @@ public class HebrewCalendar extends Calendar {
}
set(MONTH, (newMonth + 13) % 13);
pinField(DAY_OF_MONTH);
return this;
return;
}
default:
super.roll(field, amount);
}
return this;
}
//-------------------------------------------------------------------------

View file

@ -166,12 +166,10 @@ public final class LocaleData {
* methods of this locale data object will return
* an error when no data is available for that method,
* given the locale ID supplied to the constructor.
* @return
* @stable ICU 3.4
*/
public LocaleData setNoSubstitute(boolean setting) {
public void setNoSubstitute(boolean setting) {
noSubstitute = setting;
return this;
}
/**

View file

@ -35,24 +35,21 @@ public class RangeDateRule implements DateRule {
// }
/**
* @return
* @draft ICU 2.8
* @provisional This API might change or be removed in a future release.
*/
public RangeDateRule add(DateRule rule) {
return add(new Date(Long.MIN_VALUE), rule);
public void add(DateRule rule) {
add(new Date(Long.MIN_VALUE), rule);
}
/**
* @return
* @draft ICU 2.8
* @provisional This API might change or be removed in a future release.
*/
public RangeDateRule add(Date start, DateRule rule) {
public void add(Date start, DateRule rule) {
// TODO: Insert in the right place
// System.out.println("Add: " + start.toString());
ranges.addElement(new Range(start, rule));
return this;
}
//-----------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
@ -106,5 +106,5 @@ public interface RangeValueIterator
* Resets the iterator to the beginning of the iteration.
* @stable ICU 2.6
*/
public RangeValueIterator reset();
public void reset();
}

View file

@ -102,25 +102,21 @@ public class RuleBasedTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
*
* @stable ICU 3.8
*/
public RuleBasedTimeZone getOffset(long time, boolean local, int[] offsets) {
public void getOffset(long time, boolean local, int[] offsets) {
getOffset(time, local, LOCAL_FORMER, LOCAL_LATTER, offsets);
return this;
}
/**
* {@inheritDoc}
* @return
* @internal
* @deprecated This API is ICU internal only.
*/
public RuleBasedTimeZone getOffsetFromLocal(long date,
public void getOffsetFromLocal(long date,
int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets) {
getOffset(date, true, nonExistingTimeOpt, duplicatedTimeOpt, offsets);
return this;
}
/**
@ -150,12 +146,11 @@ public class RuleBasedTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
*
* @stable ICU 3.8
*/
///CLOVER:OFF
public RuleBasedTimeZone setRawOffset(int offsetMillis) {
public void setRawOffset(int offsetMillis) {
// TODO: Do nothing for now..
throw new UnsupportedOperationException("setRawOffset in RuleBasedTimeZone is not supported.");
}

View file

@ -236,15 +236,13 @@ public class SimpleTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
*
* @stable ICU 3.8
*/
public SimpleTimeZone setID(String ID) {
public void setID(String ID) {
super.setID(ID);
transitionRulesInitialized = false;
return this;
}
/**
@ -252,14 +250,12 @@ public class SimpleTimeZone extends BasicTimeZone {
* Sets the base time zone offset to GMT.
* This is the offset to add "to" UTC to get local time.
* @param offsetMillis the raw offset of the time zone
* @return
* @stable ICU 2.0
*/
public SimpleTimeZone setRawOffset(int offsetMillis) {
public void setRawOffset(int offsetMillis) {
raw = offsetMillis;
transitionRulesInitialized = false;
return this;
}
/**
@ -738,11 +734,10 @@ public class SimpleTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
* @internal
* @deprecated This API is ICU internal only.
*/
public SimpleTimeZone getOffsetFromLocal(long date,
public void getOffsetFromLocal(long date,
int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets) {
offsets[0] = getRawOffset();
int fields[] = new int[6];
@ -774,7 +769,6 @@ public class SimpleTimeZone extends BasicTimeZone {
fields[0], fields[1], fields[2],
fields[3], fields[5]) - offsets[0];
}
return this;
}
private static final int

View file

@ -253,11 +253,10 @@ abstract public class TimeZone implements Serializable, Cloneable {
* `rawOffset' to obtain the total offset between local and GMT
* time, in offsets[1]. If DST is not in effect, the DST offset is
* zero; otherwise it is a positive value, typically one hour.
* @return
*
* @stable ICU 2.8
*/
public TimeZone getOffset(long date, boolean local, int[] offsets) {
public void getOffset(long date, boolean local, int[] offsets) {
offsets[0] = getRawOffset();
if (!local) {
date += offsets[0]; // now in local standard millis
@ -288,7 +287,6 @@ abstract public class TimeZone implements Serializable, Cloneable {
// adjust to local standard millis
date -= offsets[1];
}
return this;
}
/**
@ -297,7 +295,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param offsetMillis the given base time zone offset to GMT.
* @stable ICU 2.0
*/
abstract public TimeZone setRawOffset(int offsetMillis);
abstract public void setRawOffset(int offsetMillis);
/**
* Gets unmodified offset, NOT modified in case of daylight savings.
@ -320,15 +318,13 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Sets the time zone ID. This does not change any other data in
* the time zone object.
* @param ID the new time zone ID.
* @return
* @stable ICU 2.0
*/
public TimeZone setID(String ID) {
public void setID(String ID) {
if (ID == null) {
throw new NullPointerException();
}
this.ID = ID;
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright (C) 2004-2009, International Business Machines Corporation and *
* Copyright (C) 2004-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
@ -77,13 +77,11 @@ public class UResourceBundleIterator{
/**
* Resets the internal context of a resource so that iteration starts from the first element.
* @return
* @stable ICU 3.8
*/
public UResourceBundleIterator reset(){
public void reset(){
//reset the internal context
index = 0;
return this;
}
/**

View file

@ -82,24 +82,20 @@ public class VTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
* @stable ICU 3.8
*/
public VTimeZone getOffset(long date, boolean local, int[] offsets) {
public void getOffset(long date, boolean local, int[] offsets) {
tz.getOffset(date, local, offsets);
return this;
}
/**
* {@inheritDoc}
* @return
* @internal
* @deprecated This API is ICU internal only.
*/
public VTimeZone getOffsetFromLocal(long date,
public void getOffsetFromLocal(long date,
int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets) {
tz.getOffsetFromLocal(date, nonExistingTimeOpt, duplicatedTimeOpt, offsets);
return this;
}
/**
@ -120,12 +116,10 @@ public class VTimeZone extends BasicTimeZone {
/**
* {@inheritDoc}
* @return
* @stable ICU 3.8
*/
public VTimeZone setRawOffset(int offsetMillis) {
public void setRawOffset(int offsetMillis) {
tz.setRawOffset(offsetMillis);
return this;
}
/**

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2002-2009, International Business Machines Corporation
* Copyright (c) 2002-2003, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -75,11 +75,9 @@ class FunctionReplacer implements UnicodeReplacer {
* Union the set of all characters that may output by this object
* into the given set.
* @param toUnionTo the set into which to union the output characters
* @return
*/
public FunctionReplacer addReplacementSetTo(UnicodeSet toUnionTo) {
public void addReplacementSetTo(UnicodeSet toUnionTo) {
toUnionTo.addAll(translit.getTargetSet());
return this;
}
}

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2001-2009, International Business Machines Corporation and *
* Copyright (C) 2001-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -214,9 +214,8 @@ class StringMatcher implements UnicodeMatcher, UnicodeReplacer {
* characters that may be matched by this object into the given
* set.
* @param toUnionTo the set into which to union the source characters
* @return
*/
public StringMatcher addMatchSetTo(UnicodeSet toUnionTo) {
public void addMatchSetTo(UnicodeSet toUnionTo) {
int ch;
for (int i=0; i<pattern.length(); i+=UTF16.getCharCount(ch)) {
ch = UTF16.charAt(pattern, i);
@ -227,7 +226,6 @@ class StringMatcher implements UnicodeMatcher, UnicodeReplacer {
matcher.addMatchSetTo(toUnionTo);
}
}
return this;
}
/**
@ -269,26 +267,22 @@ class StringMatcher implements UnicodeMatcher, UnicodeReplacer {
/**
* Remove any match data. This must be called before performing a
* set of matches with this segment.
* @return
*/
public StringMatcher resetMatch() {
public void resetMatch() {
matchStart = matchLimit = -1;
return this;
}
/**
* Union the set of all characters that may output by this object
* into the given set.
* @param toUnionTo the set into which to union the output characters
* @return
*/
public StringMatcher addReplacementSetTo(UnicodeSet toUnionTo) {
public void addReplacementSetTo(UnicodeSet toUnionTo) {
// The output of this replacer varies; it is the source text between
// matchStart and matchLimit. Since this varies depending on the
// input text, we can't compute it here. We can either do nothing
// or we can add ALL characters to the set. It's probably more useful
// to do nothing.
return this;
}
}

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2002-2009, International Business Machines Corporation
* Copyright (c) 2002-2007, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -315,9 +315,8 @@ class StringReplacer implements UnicodeReplacer {
* Union the set of all characters that may output by this object
* into the given set.
* @param toUnionTo the set into which to union the output characters
* @return
*/
public StringReplacer addReplacementSetTo(UnicodeSet toUnionTo) {
public void addReplacementSetTo(UnicodeSet toUnionTo) {
int ch;
for (int i=0; i<output.length(); i+=UTF16.getCharCount(ch)) {
ch = UTF16.charAt(output, i);
@ -328,7 +327,6 @@ class StringReplacer implements UnicodeReplacer {
r.addReplacementSetTo(toUnionTo);
}
}
return this;
}
}

View file

@ -368,15 +368,13 @@ public abstract class Transliterator implements StringTransform {
/**
* Copies the indices of this position from another.
* @return
* @stable ICU 2.6
*/
public Position set(Position pos) {
public void set(Position pos) {
contextStart = pos.contextStart;
contextLimit = pos.contextLimit;
start = pos.start;
limit = pos.limit;
return this;
}
/**
@ -809,9 +807,8 @@ public abstract class Transliterator implements StringTransform {
* incremental processing, as described above, and undo partial
* transliterations where necessary. If incremental is FALSE then this
* parameter is ignored.
* @return
*/
private Transliterator filteredTransliterate(Replaceable text,
private void filteredTransliterate(Replaceable text,
Position index,
boolean incremental,
boolean rollback) {
@ -819,7 +816,7 @@ public abstract class Transliterator implements StringTransform {
// non-incremental mode.
if (filter == null && !rollback) {
handleTransliterate(text, index, incremental);
return this;
return;
}
//----------------------------------------------------------------------
@ -1112,7 +1109,6 @@ public abstract class Transliterator implements StringTransform {
System.out.println("filteredTransliterate{"+getID()+"}: OUT=" +
UtilityExtensions.formatInput(text, index));
}
return this;
}
/**
@ -1124,13 +1120,12 @@ public abstract class Transliterator implements StringTransform {
* @param incremental if TRUE, then assume more characters may be inserted
* at index.limit, and postpone processing to accomodate future incoming
* characters
* @return
* @stable ICU 2.0
*/
public Transliterator filteredTransliterate(Replaceable text,
public void filteredTransliterate(Replaceable text,
Position index,
boolean incremental) {
return filteredTransliterate(text, index, incremental, false);
filteredTransliterate(text, index, incremental, false);
}
/**
@ -1312,12 +1307,10 @@ public abstract class Transliterator implements StringTransform {
* <p>Callers must take care if a transliterator is in use by
* multiple threads. The filter should not be changed by one
* thread while another thread may be transliterating.
* @return
* @stable ICU 2.0
*/
public Transliterator setFilter(UnicodeFilter filter) {
public void setFilter(UnicodeFilter filter) {
this.filter = filter;
return this;
}
/**

View file

@ -792,9 +792,8 @@ public class CollationAPITest extends TestFmwk {
return key;
}
public Collator setVariableTop(int ce)
public void setVariableTop(int ce)
{
return this;
}
public int setVariableTop(String str)

View file

@ -1251,7 +1251,7 @@ public class TimeZoneTest extends TestFmwk
*/
private static final long serialVersionUID = 8658654217433379343L;
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {return 0;}
public StubTimeZone setRawOffset(int offsetMillis) {return this;}
public void setRawOffset(int offsetMillis) {}
public int getRawOffset() {return 0;}
public boolean useDaylightTime() {return false;}
public boolean inDaylightTime(Date date) {return false;}

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2001-2009, International Business Machines Corporation and *
* Copyright (C) 2001-2007, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -123,27 +123,24 @@ public class ReplaceableTest extends TestFmwk {
return chars.char32At(offset);
}
public TestReplaceable getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
chars.getChars(srcStart, srcLimit, dst, dstStart);
return this;
}
public TestReplaceable replace(int start, int limit, String text) {
if (substring(start,limit).equals(text)) return this; // NO ACTION!
public void replace(int start, int limit, String text) {
if (substring(start,limit).equals(text)) return; // NO ACTION!
if (DEBUG) System.out.print(Utility.escape(toString() + " -> replace(" + start +
"," + limit + "," + text) + ") -> ");
chars.replace(start, limit, text);
fixStyles(start, limit, text.length());
if (DEBUG) System.out.println(Utility.escape(toString()));
return this;
}
public TestReplaceable replace(int start, int limit, char[] charArray,
public void replace(int start, int limit, char[] charArray,
int charsStart, int charsLen) {
if (substring(start,limit).equals(new String(charArray, charsStart, charsLen-charsStart))) return this; // NO ACTION!
if (substring(start,limit).equals(new String(charArray, charsStart, charsLen-charsStart))) return; // NO ACTION!
this.chars.replace(start, limit, charArray, charsStart, charsLen);
fixStyles(start, limit, charsLen);
return this;
}
void fixStyles(int start, int limit, int newLen) {
@ -170,10 +167,9 @@ public class ReplaceableTest extends TestFmwk {
styles.replace(start, limit, s.toString());
}
public TestReplaceable copy(int start, int limit, int dest) {
public void copy(int start, int limit, int dest) {
chars.copy(start, limit, dest);
styles.copy(start, limit, dest);
return this;
}
public boolean hasMetaData() {

View file

@ -81,22 +81,21 @@ public class RoundTripTest extends TestFmwk {
abbreviated = false;
}
public AbbreviatedUnicodeSetIterator reset(UnicodeSet newSet) {
return reset(newSet, false);
public void reset(UnicodeSet newSet) {
reset(newSet, false);
}
public AbbreviatedUnicodeSetIterator reset(UnicodeSet newSet, boolean abb) {
return reset(newSet, abb, 100);
public void reset(UnicodeSet newSet, boolean abb) {
reset(newSet, abb, 100);
}
public AbbreviatedUnicodeSetIterator reset(UnicodeSet newSet, boolean abb, int density) {
public void reset(UnicodeSet newSet, boolean abb, int density) {
super.reset(newSet);
abbreviated = abb;
perRange = newSet.getRangeCount();
if (perRange != 0) {
perRange = density / perRange;
}
return this;
}
protected void loadRange(int myRange) {

View file

@ -475,7 +475,7 @@ public class TransliteratorTest extends TestFmwk {
public boolean matchesIndexValue(int v) {
return false;
}
public UnicodeFilter addMatchSetTo(UnicodeSet toUnionTo) {return this;}
public void addMatchSetTo(UnicodeSet toUnionTo) {}
});
String s = "abcde";
String out = hex.transliterate(s);