Package org.jline.utils
Class AttributedStringBuilder
java.lang.Object
org.jline.utils.AttributedCharSequence
org.jline.utils.AttributedStringBuilder
- All Implemented Interfaces:
Appendable,CharSequence
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 -
Method Summary
Modifier and TypeMethodDescriptionaltCharset(String altIn, String altOut) ansiAppend(String ansi) append(char c) append(char c, int repeat) append(CharSequence csq) static AttributedStringappend(CharSequence... strings) append(CharSequence csq, int start, int end) append(CharSequence csq, AttributedStyle style) append(AttributedCharSequence str, int start, int end) append(AttributedString str) append(AttributedString str, int start, int end) voidappendAnsi(String ansi) protected char[]buffer()charcharAt(int index) protected voidensureCapacity(int nl) protected voidintlength()protected intoffset()voidsetLength(int l) style()style(Function<AttributedStyle, AttributedStyle> style) style(AttributedStyle style) styleAt(int index) styled(Function<AttributedStyle, AttributedStyle> style, CharSequence cs) styled(Function<AttributedStyle, AttributedStyle> style, Consumer<AttributedStringBuilder> consumer) styled(AttributedStyle style, CharSequence cs) styleMatches(Pattern pattern, List<AttributedStyle> styles) styleMatches(Pattern pattern, AttributedStyle s) subSequence(int start, int end) tabs(int tabsize) Set the number of spaces a tab is expanded to.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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
AttributedStringBuilder
public AttributedStringBuilder() -
AttributedStringBuilder
public AttributedStringBuilder(int capacity)
-
-
Method Details
-
append
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence- Overrides:
charAtin classAttributedCharSequence
-
styleAt
- Specified by:
styleAtin classAttributedCharSequence
-
buffer
protected char[] buffer()- Specified by:
bufferin classAttributedCharSequence
-
offset
protected int offset()- Specified by:
offsetin classAttributedCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence- Specified by:
subSequencein classAttributedCharSequence
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
append
-
append
-
style
-
style
-
styled
public AttributedStringBuilder styled(Function<AttributedStyle, AttributedStyle> style, CharSequence cs) -
styled
-
styled
public AttributedStringBuilder styled(Function<AttributedStyle, AttributedStyle> style, Consumer<AttributedStringBuilder> consumer) -
style
-
append
-
append
-
append
-
append
-
ensureCapacity
protected void ensureCapacity(int nl) -
appendAnsi
-
ansiAppend
-
insertTab
-
setLength
public void setLength(int l) -
tabs
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
-
altCharset
-
styleMatches
-
styleMatches
-