Top Description Fields Constructors Methods
com.ibm.icu.message2

public Class PlainStringFormattedValue

extends Object
implements FormattedValue
Class Inheritance
All Implemented Interfaces
com.ibm.icu.text.FormattedValue, java.lang.CharSequence
Annotations
@Deprecated
Imports
java.io.IOException, .UncheckedIOException, java.text.AttributedCharacterIterator, com.ibm.icu.text.ConstrainedFieldPosition, .FormattedValue

Deprecated

This API is for unit testing only.

Very-very rough implementation of FormattedValue, packaging a string. Expect it to change.
ICU Status
Internal ICU component: Visible For Testing.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
PlainStringFormattedValue(String
the string value to store
value
)

Deprecated This API is for unit testing only.
Constructor, taking the string to store.

Method Summary

Modifier and TypeMethod and Description
public <A extends Appendable> A
appendTo(A
The Appendable to which to append the string output.
appendable
)

Implements com.ibm.icu.text.FormattedValue.appendTo.

Deprecated This API is for unit testing only.
Appends the formatted string to an Appendable.
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Deprecated This API is for unit testing only.
Returns the char value at the specified index.
public int
length()

Implements java.lang.CharSequence.length.

Deprecated This API is for unit testing only.
Returns the length of this character sequence.
public boolean
nextPosition(ConstrainedFieldPosition
The object used for iteration state. This can provide constraints to iterate over only one specific field; see ConstrainedFieldPosition#constrainField.
cfpos
)

Implements com.ibm.icu.text.FormattedValue.nextPosition.

Deprecated This API is for unit testing only.
Not yet implemented.
public CharSequence
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Implements java.lang.CharSequence.subSequence.

Deprecated This API is for unit testing only.
Returns a CharSequence that is a subsequence of this sequence.
public AttributedCharacterIterator
toCharacterIterator()

Implements com.ibm.icu.text.FormattedValue.toCharacterIterator.

Deprecated This API is for unit testing only.
Not yet implemented.
public String
toString()

Overrides java.lang.Object.toString.

Implements com.ibm.icu.text.FormattedValue.toString.

Deprecated This API is for unit testing only.
Returns the formatted string as a Java String.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

valueback to summary
private final String value

Constructor Detail

PlainStringFormattedValueback to summary
public PlainStringFormattedValue(String value)

Deprecated

This API is for unit testing only.

Constructor, taking the string to store.

Parameters
value:String

the string value to store

Annotations
@Deprecated
ICU Status
Internal ICU component: Visible For Testing.

Method Detail

appendToback to summary
public <A extends Appendable> A appendTo(A appendable)

Implements com.ibm.icu.text.FormattedValue.appendTo.

Doc from com.ibm.icu.text.FormattedValue.appendTo.

Deprecated

This API is for unit testing only.

Appends the formatted string to an Appendable.

If an IOException occurs when appending to the Appendable, an unchecked ICUUncheckedIOException is thrown instead.

Parameters
appendable:A

The Appendable to which to append the string output.

Returns:A

The same Appendable, for chaining.

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Deprecated

This API is for unit testing only.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Deprecated

This API is for unit testing only.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
nextPositionback to summary
public boolean nextPosition(ConstrainedFieldPosition cfpos)

Implements com.ibm.icu.text.FormattedValue.nextPosition.

Doc from com.ibm.icu.text.FormattedValue.nextPosition.

Deprecated

This API is for unit testing only.

Not yet implemented. Iterates over field positions in the FormattedValue. This lets you determine the position of specific types of substrings, like a month or a decimal separator. To loop over all field positions:

    ConstrainedFieldPosition cfpos = new ConstrainedFieldPosition();
    while (fmtval.nextPosition(cfpos)) {
        // handle the field position; get information from cfpos
    }
Parameters
cfpos:ConstrainedFieldPosition

The object used for iteration state. This can provide constraints to iterate over only one specific field; see ConstrainedFieldPosition#constrainField.

Returns:boolean

true if a new occurrence of the field was found; false otherwise.

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
subSequenceback to summary
public CharSequence subSequence(int start, int end)

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Deprecated

This API is for unit testing only.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:CharSequence

the specified subsequence

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
toCharacterIteratorback to summary
public AttributedCharacterIterator toCharacterIterator()

Implements com.ibm.icu.text.FormattedValue.toCharacterIterator.

Doc from com.ibm.icu.text.FormattedValue.toCharacterIterator.

Deprecated

This API is for unit testing only.

Not yet implemented. Exports the formatted number as an AttributedCharacterIterator.

Consider using nextPosition if you are trying to get field information.

Returns:AttributedCharacterIterator

An AttributedCharacterIterator containing full field information.

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements com.ibm.icu.text.FormattedValue.toString.

Doc from com.ibm.icu.text.FormattedValue.toString.

Deprecated

This API is for unit testing only.

Returns the formatted string as a Java String. Consider using appendTo for greater efficiency.

Returns:String

The formatted string.

Annotations
@Deprecated
@Override
ICU Status
Internal ICU component: Visible For Testing.