Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1364)

Unified Diff: icu4j/main/classes/core/src/com/ibm/icu/impl/number/SimpleModifier.java

Issue 335150043: Refreshing Number Parsing: ICU4J Base URL: svn+icussh://source.icu-project.org/repos/icu/trunk/
Patch Set: Replying to Andy feedback round one. See commit message. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: icu4j/main/classes/core/src/com/ibm/icu/impl/number/SimpleModifier.java
===================================================================
--- icu4j/main/classes/core/src/com/ibm/icu/impl/number/SimpleModifier.java (revision 40724)
+++ icu4j/main/classes/core/src/com/ibm/icu/impl/number/SimpleModifier.java (working copy)
@@ -6,8 +6,8 @@
import com.ibm.icu.text.NumberFormat.Field;
/**
- * The second primary implementation of {@link Modifier}, this one consuming a {@link com.ibm.icu.text.SimpleFormatter}
- * pattern.
+ * The second primary implementation of {@link Modifier}, this one consuming a
+ * {@link com.ibm.icu.text.SimpleFormatter} pattern.
*/
public class SimpleModifier implements Modifier {
private final String compiledPattern;
@@ -59,7 +59,8 @@
count += Character.codePointCount(compiledPattern, 2, 2 + prefixLength);
}
if (suffixLength > 0) {
- count += Character.codePointCount(compiledPattern, 1 + suffixOffset, 1 + suffixOffset + suffixLength);
+ count += Character
+ .codePointCount(compiledPattern, 1 + suffixOffset, 1 + suffixOffset + suffixLength);
}
return count;
}
@@ -71,12 +72,13 @@
/**
* TODO: This belongs in SimpleFormatterImpl. The only reason I haven't moved it there yet is because
- * DoubleSidedStringBuilder is an internal class and SimpleFormatterImpl feels like it should not depend on it.
+ * DoubleSidedStringBuilder is an internal class and SimpleFormatterImpl feels like it should not
+ * depend on it.
*
* <p>
- * Formats a value that is already stored inside the StringBuilder <code>result</code> between the indices
- * <code>startIndex</code> and <code>endIndex</code> by inserting characters before the start index and after the
- * end index.
+ * Formats a value that is already stored inside the StringBuilder <code>result</code> between the
+ * indices <code>startIndex</code> and <code>endIndex</code> by inserting characters before the start
+ * index and after the end index.
*
* <p>
* This is well-defined only for patterns with exactly one argument.
@@ -89,12 +91,19 @@
* The right index of the value within the string builder.
* @return The number of characters (UTF-16 code points) that were added to the StringBuilder.
*/
- public int formatAsPrefixSuffix(NumberStringBuilder result, int startIndex, int endIndex, Field field) {
+ public int formatAsPrefixSuffix(
+ NumberStringBuilder result,
+ int startIndex,
+ int endIndex,
+ Field field) {
if (prefixLength > 0) {
result.insert(startIndex, compiledPattern, 2, 2 + prefixLength, field);
}
if (suffixLength > 0) {
- result.insert(endIndex + prefixLength, compiledPattern, 1 + suffixOffset, 1 + suffixOffset + suffixLength,
+ result.insert(endIndex + prefixLength,
+ compiledPattern,
+ 1 + suffixOffset,
+ 1 + suffixOffset + suffixLength,
field);
}
return prefixLength + suffixLength;

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b