public class TAttributedString extends Object
Constructor and Description |
---|
TAttributedString(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) |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
TAttributedCharacterIterator |
getIterator()
Returns an
AttributedCharacterIterator that gives access to the
complete content of this attributed string. |
TAttributedCharacterIterator |
getIterator(TAttributedCharacterIterator.Attribute[] attributes)
Returns an
AttributedCharacterIterator that gives access to the
complete content of this attributed string. |
TAttributedCharacterIterator |
getIterator(TAttributedCharacterIterator.Attribute[] attributes,
int start,
int end)
Returns an
AttributedCharacterIterator that gives access to the
contents of this attributed string starting at index start up to
index end . |
public TAttributedString(TAttributedCharacterIterator iterator)
public TAttributedString(TAttributedCharacterIterator iterator, int start, int end)
public TAttributedString(TAttributedCharacterIterator iterator, int start, int end, TAttributedCharacterIterator.Attribute[] attributes)
public TAttributedString(String value)
public TAttributedString(String value, TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes)
public void addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value)
attribute
- the attribute that will be applied to this string.value
- the value of the attribute that will be applied to this
string.IllegalArgumentException
- if the length of this attributed string is 0.NullPointerException
- if attribute
is null
.public void addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value, int start, int end)
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.IllegalArgumentException
- if start < 0
, end
is greater than the length
of this string, or if start >= end
.NullPointerException
- if attribute
is null
.public void addAttributes(TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes, int start, int end)
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.IllegalArgumentException
- if start < 0
, end
is greater than the length
of this string, or if start >= end
.public TAttributedCharacterIterator getIterator()
AttributedCharacterIterator
that gives access to the
complete content of this attributed string.AttributedCharacterIterator
.public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes)
AttributedCharacterIterator
that gives access to the
complete content of this attributed string. Only attributes contained in
attributes
are available from this iterator if they are defined
for this text.attributes
- the array containing attributes that will be in the new
iterator if they are defined for this text.AttributedCharacterIterator
.public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes, int start, int end)
AttributedCharacterIterator
that gives access to the
contents of this attributed string starting at index start
up to
index end
. Only attributes contained in attributes
are
available from this iterator if they are defined for this text.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.AttributedCharacterIterator
.Copyright © 2019. All rights reserved.