Package org.teavm.classlib.java.text
Class TAttributedString
java.lang.Object
org.teavm.classlib.java.text.TAttributedString
-
Constructor Summary
ConstructorsConstructorDescriptionTAttributedString(String value)
TAttributedString(String value, TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes)
TAttributedString(TAttributedCharacterIterator iterator)
TAttributedString(TAttributedCharacterIterator iterator, int start, int end)
TAttributedString(TAttributedCharacterIterator iterator, int start, int end, TAttributedCharacterIterator.Attribute[] attributes)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value)
Applies a given attribute to this string.void
addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value, int start, int end)
Applies a given attribute to the given range of this string.void
addAttributes(TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes, int start, int end)
Applies a given set of attributes to the given range of the string.Returns anAttributedCharacterIterator
that gives access to the complete content of this attributed string.getIterator(TAttributedCharacterIterator.Attribute[] attributes)
Returns anAttributedCharacterIterator
that gives access to the complete content of this attributed string.getIterator(TAttributedCharacterIterator.Attribute[] attributes, int start, int end)
Returns anAttributedCharacterIterator
that gives access to the contents of this attributed string starting at indexstart
up to indexend
.
-
Constructor Details
-
TAttributedString
-
TAttributedString
-
TAttributedString
public TAttributedString(TAttributedCharacterIterator iterator, int start, int end, TAttributedCharacterIterator.Attribute[] attributes) -
TAttributedString
-
TAttributedString
public TAttributedString(String value, TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes)
-
-
Method Details
-
addAttribute
Applies a given attribute to this string.- Parameters:
attribute
- the attribute that will be applied to this string.value
- the value of the attribute that will be applied to this string.- Throws:
IllegalArgumentException
- if the length of this attributed string is 0.NullPointerException
- ifattribute
isnull
.
-
addAttribute
public void addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value, int start, int end)Applies a given attribute to the given range of this string.- Parameters:
attribute
- the attribute that will be applied to this string.value
- the value of the attribute that will be applied to this string.start
- the start of the range where the attribute will be applied.end
- the end of the range where the attribute will be applied.- Throws:
IllegalArgumentException
- ifstart < 0
,end
is greater than the length of this string, or ifstart >= end
.NullPointerException
- ifattribute
isnull
.
-
addAttributes
public void addAttributes(TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes, int start, int end)Applies a given set of attributes to the given range of the string.- Parameters:
attributes
- the set of attributes that will be applied to this string.start
- the start of the range where the attribute will be applied.end
- the end of the range where the attribute will be applied.- Throws:
IllegalArgumentException
- ifstart < 0
,end
is greater than the length of this string, or ifstart >= end
.
-
getIterator
Returns anAttributedCharacterIterator
that gives access to the complete content of this attributed string.- Returns:
- the newly created
AttributedCharacterIterator
.
-
getIterator
public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes)Returns anAttributedCharacterIterator
that gives access to the complete content of this attributed string. Only attributes contained inattributes
are available from this iterator if they are defined for this text.- Parameters:
attributes
- the array containing attributes that will be in the new iterator if they are defined for this text.- Returns:
- the newly created
AttributedCharacterIterator
.
-
getIterator
public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes, int start, int end)Returns anAttributedCharacterIterator
that gives access to the contents of this attributed string starting at indexstart
up to indexend
. Only attributes contained inattributes
are available from this iterator if they are defined for this text.- Parameters:
attributes
- the array containing attributes that will be in the new iterator if they are defined for this text.start
- the start index of the iterator on the underlying text.end
- the end index of the iterator on the underlying text.- Returns:
- the newly created
AttributedCharacterIterator
.
-