@API(type=EXTENDABLE,
src=PRIVATE)
public class AttributedString
extends java.lang.Object
AttributedString
.Modifier and Type | Class and Description |
---|---|
static class |
AttributedString.AttributedInterval
A text interval from the string, with a specific attribute.
|
Constructor and Description |
---|
AttributedString(java.lang.String string)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(TextAttribute textAttribute,
java.lang.Object value)
Adds an attribute on the entire string.
|
void |
addAttribute(TextAttribute attribute,
java.lang.Object value,
int beginIndex,
int endIndex)
Adds an attribute to a subrange of the string.
|
void |
addAttributedInterval(AttributedString.AttributedInterval interval)
Adds an attribute to a subrange of the string.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<AttributedString.AttributedInterval> |
getIntervals() |
java.lang.String |
getString() |
int |
hashCode() |
int |
length() |
void |
removeAllAttributes(TextAttribute attrribute)
Remove all intervals having a value for the specified attribute key.
|
AttributedString[] |
toMultiLineAttributeStrings()
Convert this attributed string to an array of attributed strings, one for each line of content.
|
java.lang.String |
toString() |
public AttributedString(java.lang.String string)
string
- The stringpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public void addAttribute(TextAttribute attribute, java.lang.Object value, int beginIndex, int endIndex)
attribute
- the attribute keyvalue
- The value of the attribute. Should not be null
.beginIndex
- Index of the first character of the range.endIndex
- Index of the character following the last character of the range.public void addAttributedInterval(AttributedString.AttributedInterval interval)
interval
- the attributed interval.public java.lang.String getString()
public java.util.List<AttributedString.AttributedInterval> getIntervals()
public int length()
public void addAttribute(TextAttribute textAttribute, java.lang.Object value)
textAttribute
- The text attribute.value
- The value of the attribute.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void removeAllAttributes(TextAttribute attrribute)
attrribute
- The attribute key.public AttributedString[] toMultiLineAttributeStrings()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.