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, int start, int end) TAttributedString(TAttributedCharacterIterator iterator, int start, int end, TAttributedCharacterIterator.Attribute[] attributes) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(TAttributedCharacterIterator.Attribute attribute, Object value) Applies a given attribute to this string.voidaddAttribute(TAttributedCharacterIterator.Attribute attribute, Object value, int start, int end) Applies a given attribute to the given range of this string.voidaddAttributes(TMap<? extends TAttributedCharacterIterator.Attribute, ?> attributes, int start, int end) Applies a given set of attributes to the given range of the string.Returns anAttributedCharacterIteratorthat gives access to the complete content of this attributed string.getIterator(TAttributedCharacterIterator.Attribute[] attributes) Returns anAttributedCharacterIteratorthat gives access to the complete content of this attributed string.getIterator(TAttributedCharacterIterator.Attribute[] attributes, int start, int end) Returns anAttributedCharacterIteratorthat gives access to the contents of this attributed string starting at indexstartup 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- ifattributeisnull.
-
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,endis greater than the length of this string, or ifstart >= end.NullPointerException- ifattributeisnull.
-
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,endis greater than the length of this string, or ifstart >= end.
-
getIterator
Returns anAttributedCharacterIteratorthat gives access to the complete content of this attributed string.- Returns:
- the newly created
AttributedCharacterIterator.
-
getIterator
public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes) Returns anAttributedCharacterIteratorthat gives access to the complete content of this attributed string. Only attributes contained inattributesare 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 anAttributedCharacterIteratorthat gives access to the contents of this attributed string starting at indexstartup to indexend. Only attributes contained inattributesare 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.
-