- java.lang.Object
-
- org.jline.utils.AttributedCharSequence
-
- org.jline.utils.AttributedString
-
- All Implemented Interfaces:
CharSequence
public class AttributedString extends AttributedCharSequence
Attributed string. Instances of this class are immutables. Substrings are created without any memory copy.- Author:
- Guillaume Nodet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jline.utils.AttributedCharSequence
AttributedCharSequence.ForceMode
-
-
Field Summary
Fields Modifier and Type Field Description static AttributedStringEMPTYstatic AttributedStringNEWLINE-
Fields inherited from class org.jline.utils.AttributedCharSequence
TRUE_COLORS
-
-
Constructor Summary
Constructors Constructor Description AttributedString(CharSequence str)AttributedString(CharSequence str, int start, int end)AttributedString(CharSequence str, int start, int end, AttributedStyle s)AttributedString(CharSequence str, AttributedStyle s)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected char[]buffer()booleanequals(Object o)static AttributedStringfromAnsi(String ansi)static AttributedStringfromAnsi(String ansi, int tabs)static AttributedStringfromAnsi(String ansi, List<Integer> tabs)inthashCode()static AttributedStringjoin(AttributedString delimiter, Iterable<AttributedString> elements)static AttributedStringjoin(AttributedString delimiter, AttributedString... elements)intlength()protected intoffset()static StringstripAnsi(String ansi)AttributedStylestyleAt(int index)AttributedStringstyleMatches(Pattern pattern, AttributedStyle style)AttributedStringsubSequence(int start, int end)-
Methods inherited from class org.jline.utils.AttributedCharSequence
charAt, codePointAt, codePointBefore, codePointCount, columnLength, columnSplitLength, columnSplitLength, columnSubSequence, contains, isHidden, print, println, rgbColor, roundColor, roundRgbColor, runLimit, runStart, substring, toAnsi, toAnsi, toAnsi, toAnsi, toAnsi, toAnsi, toAnsi, toAttributedString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Field Detail
-
EMPTY
public static final AttributedString EMPTY
-
NEWLINE
public static final AttributedString NEWLINE
-
-
Constructor Detail
-
AttributedString
public AttributedString(CharSequence str)
-
AttributedString
public AttributedString(CharSequence str, int start, int end)
-
AttributedString
public AttributedString(CharSequence str, AttributedStyle s)
-
AttributedString
public AttributedString(CharSequence str, int start, int end, AttributedStyle s)
-
-
Method Detail
-
fromAnsi
public static AttributedString fromAnsi(String ansi)
-
fromAnsi
public static AttributedString fromAnsi(String ansi, int tabs)
-
fromAnsi
public static AttributedString fromAnsi(String ansi, List<Integer> tabs)
-
buffer
protected char[] buffer()
- Specified by:
bufferin classAttributedCharSequence
-
offset
protected int offset()
- Specified by:
offsetin classAttributedCharSequence
-
length
public int length()
-
styleAt
public AttributedStyle styleAt(int index)
- Specified by:
styleAtin classAttributedCharSequence
-
subSequence
public AttributedString subSequence(int start, int end)
- Specified by:
subSequencein interfaceCharSequence- Specified by:
subSequencein classAttributedCharSequence
-
styleMatches
public AttributedString styleMatches(Pattern pattern, AttributedStyle style)
-
join
public static AttributedString join(AttributedString delimiter, AttributedString... elements)
-
join
public static AttributedString join(AttributedString delimiter, Iterable<AttributedString> elements)
-
-