- java.lang.Object
-
- org.jline.utils.AttributedCharSequence
-
- org.jline.utils.AttributedStringBuilder
-
- All Implemented Interfaces:
Appendable
,CharSequence
public class AttributedStringBuilder extends AttributedCharSequence implements Appendable
Attributed string builder- Author:
- Guillaume Nodet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jline.utils.AttributedCharSequence
AttributedCharSequence.ForceMode
-
-
Field Summary
-
Fields inherited from class org.jline.utils.AttributedCharSequence
TRUE_COLORS
-
-
Constructor Summary
Constructors Constructor Description AttributedStringBuilder()
AttributedStringBuilder(int capacity)
-
Method Summary
-
Methods inherited from class org.jline.utils.AttributedCharSequence
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Method Detail
-
append
public static AttributedString append(CharSequence... strings)
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
- Overrides:
charAt
in classAttributedCharSequence
-
styleAt
public AttributedStyle styleAt(int index)
- Specified by:
styleAt
in classAttributedCharSequence
-
buffer
protected char[] buffer()
- Specified by:
buffer
in classAttributedCharSequence
-
offset
protected int offset()
- Specified by:
offset
in classAttributedCharSequence
-
subSequence
public AttributedString subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
- Specified by:
subSequence
in classAttributedCharSequence
-
append
public AttributedStringBuilder append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
-
append
public AttributedStringBuilder append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
-
append
public AttributedStringBuilder append(char c)
- Specified by:
append
in interfaceAppendable
-
append
public AttributedStringBuilder append(CharSequence csq, AttributedStyle style)
-
style
public AttributedStringBuilder style(AttributedStyle style)
-
style
public AttributedStringBuilder style(Function<AttributedStyle,AttributedStyle> style)
-
styled
public AttributedStringBuilder styled(Function<AttributedStyle,AttributedStyle> style, CharSequence cs)
-
styled
public AttributedStringBuilder styled(AttributedStyle style, CharSequence cs)
-
styled
public AttributedStringBuilder styled(Function<AttributedStyle,AttributedStyle> style, Consumer<AttributedStringBuilder> consumer)
-
style
public AttributedStyle style()
-
append
public AttributedStringBuilder append(AttributedString str)
-
append
public AttributedStringBuilder append(AttributedString str, int start, int end)
-
append
public AttributedStringBuilder append(AttributedCharSequence str)
-
append
public AttributedStringBuilder append(AttributedCharSequence str, int start, int end)
-
ensureCapacity
protected void ensureCapacity(int nl)
-
appendAnsi
public void appendAnsi(String ansi)
-
ansiAppend
public AttributedStringBuilder ansiAppend(String ansi)
-
insertTab
protected void insertTab(AttributedStyle s)
-
setLength
public void setLength(int l)
-
tabs
public AttributedStringBuilder tabs(int tabsize)
Set the number of spaces a tab is expanded to. Tab size cannot be changed after text has been added to prevent inconsistent indentation. If tab size is set to 0, tabs are not expanded (the default).- Parameters:
tabsize
- Spaces per tab or 0 for no tab expansion. Must be non-negative- Returns:
- this
-
tabs
public AttributedStringBuilder tabs(List<Integer> tabs)
-
styleMatches
public AttributedStringBuilder styleMatches(Pattern pattern, AttributedStyle s)
-
styleMatches
public AttributedStringBuilder styleMatches(Pattern pattern, List<AttributedStyle> styles)
-
-