Modifier, containing a prefix and suffix string.
| Modifier and Type | Field and Description |
|---|---|
| public static final ConstantAffixModifier | |
| private final Format. | |
| private final String | |
| private final boolean | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | ConstantAffixModifier(String
The prefix string. prefix, String The suffix string. suffix, Format.The field type to be associated with this modifier. Can be null. field,Whether this modifier should be strongly applied. strong)Constructs an instance with the given strings. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | 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)Implements com. |
| public boolean | containsField(Format.
Implements com. |
| public int | getCodePointCount()
Implements com. |
| public Modifier. | getParameters()
Implements com. |
| public int | getPrefixLength()
Implements com. |
| public boolean | |
| public boolean | semanticallyEquivalent(Modifier other)
Implements com. |
| public String |
| EMPTY | back to summary |
|---|---|
| public static final ConstantAffixModifier EMPTY | |
| field | back to summary |
|---|---|
| private final Format. | |
| prefix | back to summary |
|---|---|
| private final String prefix | |
| strong | back to summary |
|---|---|
| private final boolean strong | |
| suffix | back to summary |
|---|---|
| private final String suffix | |
| ConstantAffixModifier | back to summary |
|---|---|
| public ConstantAffixModifier(String prefix, String suffix, Format. Constructs an instance with the given strings. The arguments need to be Strings, not CharSequences, because Strings are immutable but CharSequences are not. | |
| ConstantAffixModifier | back to summary |
|---|---|
| public ConstantAffixModifier() Constructs a new instance with an empty prefix, suffix, and field. | |
| apply | back to summary |
|---|---|
| public int apply(FormattedStringBuilder output, int leftIndex, int rightIndex) Implements com. Doc from com. Apply this Modifier to the string builder.
| |
| containsField | back to summary |
|---|---|
| public boolean containsField(Format. Implements com. Doc from com. Whether the modifier contains at least one occurrence of the given field.
| |
| getCodePointCount | back to summary |
|---|---|
| public int getCodePointCount() Implements com. Doc from com. Returns the number of code points in the modifier, prefix plus suffix.
| |
| getParameters | back to summary |
|---|---|
| public Modifier. Implements com. Doc from com. Gets a set of "parameters" for this Modifier.
| |
| getPrefixLength | back to summary |
|---|---|
| public int getPrefixLength() Implements com. Doc from com. Gets the length of the prefix. This information can be used in combination with
| |
| isStrong | back to summary |
|---|---|
| public boolean isStrong() Implements com. Doc from com. 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.
| |
| semanticallyEquivalent | back to summary |
|---|---|
| public boolean semanticallyEquivalent(Modifier other) Implements com. Doc from com. 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.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |