Top Description Inners Methods
com.ibm.icu.impl.number

public Interface Modifier

Known Direct Implementers
com.ibm.icu.impl.number.MutablePatternModifier, com.ibm.icu.impl.number.SimpleModifier, com.ibm.icu.number.ScientificNotation.ScientificHandler, com.ibm.icu.number.ScientificNotation.ScientificModifier, com.ibm.icu.impl.number.ConstantAffixModifier, com.ibm.icu.impl.number.ConstantMultiFieldModifier
Imports
java.text.Format.Field, com.ibm.icu.impl.FormattedStringBuilder, .StandardPlural

A Modifier is an object that can be passed through the formatting pipeline until it is finally applied to the string builder. A Modifier usually contains a prefix and a suffix that are applied, but it could contain something else, like a com.ibm.icu.text.SimpleFormatter pattern. A Modifier is usually immutable, except in cases such as MutablePatternModifier, which are mutable for performance reasons.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Modifier.Parameters

A fill-in for getParameters().

public static enum

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The number of characters (UTF-16 code units) that were added to the string builder.
apply
(FormattedStringBuilder
The string builder to which to apply this modifier.
output
,
int
The left index of the string within the builder. Equal to 0 when only one number is being formatted.
leftIndex
,
int
The right index of the string within the string builder. Equal to length when only one number is being formatted.
rightIndex
)

Apply this Modifier to the string builder.

public boolean
containsField(Format.Field currency)

Whether the modifier contains at least one occurrence of the given field.

public int
getCodePointCount()

Returns the number of code points in the modifier, prefix plus suffix.

public Modifier.Parameters
getParameters()

Gets a set of "parameters" for this Modifier.

public int

Returns:

The number of characters (UTF-16 code units) in the prefix.
getPrefixLength
()

Gets the length of the prefix.

public boolean

Returns:

Whether the modifier is strong.
isStrong
()

Whether this modifier is strong.

public boolean
semanticallyEquivalent(Modifier other)

Returns whether this Modifier is *semantically equivalent* to the other Modifier; in many cases, this is the same as equal, but parameters should be ignored.

Method Detail

applyback to summary
public int apply(FormattedStringBuilder output, int leftIndex, int rightIndex)

Apply this Modifier to the string builder.

Parameters
output:FormattedStringBuilder

The string builder to which to apply this modifier.

leftIndex:int

The left index of the string within the builder. Equal to 0 when only one number is being formatted.

rightIndex:int

The right index of the string within the string builder. Equal to length when only one number is being formatted.

Returns:int

The number of characters (UTF-16 code units) that were added to the string builder.

containsFieldback to summary
public boolean containsField(Format.Field currency)

Whether the modifier contains at least one occurrence of the given field.

getCodePointCountback to summary
public int getCodePointCount()

Returns the number of code points in the modifier, prefix plus suffix.

getParametersback to summary
public Modifier.Parameters getParameters()

Gets a set of "parameters" for this Modifier.

getPrefixLengthback to summary
public int getPrefixLength()

Gets the length of the prefix. This information can be used in combination with apply to extract the prefix and suffix strings.

Returns:int

The number of characters (UTF-16 code units) in the prefix.

isStrongback to summary
public boolean isStrong()

Whether this modifier is strong. If a modifier is strong, it should always be applied immediately and not allowed to bubble up. With regard to padding, strong modifiers are considered to be on the inside of the prefix and suffix.

Returns:boolean

Whether the modifier is strong.

semanticallyEquivalentback to summary
public boolean semanticallyEquivalent(Modifier other)

Returns whether this Modifier is *semantically equivalent* to the other Modifier; in many cases, this is the same as equal, but parameters should be ignored.

com.ibm.icu.impl.number back to summary

public Class Modifier.Parameters

extends Object
Class Inheritance

A fill-in for getParameters(). obj will always be set; if non-null, the other two fields are also safe to read.

Field Summary

Modifier and TypeField and Description
public ModifierStore
public StandardPlural
public Modifier.Signum

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

objback to summary
public ModifierStore obj
pluralback to summary
public StandardPlural plural
signumback to summary
public Modifier.Signum signum

Constructor Detail

Parametersback to summary
public Parameters()
com.ibm.icu.impl.number back to summary

public final Enum Modifier.Signum

extends Enum<Modifier.Signum>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final int
public static final Modifier.Signum
public static final Modifier.Signum
public static final Modifier.Signum
public static final Modifier.Signum

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Modifier.Signum
public static Modifier.Signum[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COUNTback to summary
pack-priv static final int COUNT
NEGback to summary
public static final Modifier.Signum NEG
NEG_ZEROback to summary
public static final Modifier.Signum NEG_ZERO
POSback to summary
public static final Modifier.Signum POS
POS_ZEROback to summary
public static final Modifier.Signum POS_ZERO

Constructor Detail

Signumback to summary
private Signum()

Method Detail

valueOfback to summary
public static Modifier.Signum valueOf(String name)
valuesback to summary
public static Modifier.Signum[] values()