Package org.jline.utils
Class AttributedString
java.lang.Object
org.jline.utils.AttributedCharSequence
org.jline.utils.AttributedString
- All Implemented Interfaces:
CharSequence
Attributed string.
Instances of this class are immutables.
Substrings are created without any memory copy.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jline.utils.AttributedCharSequence
AttributedCharSequence.ForceMode
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final char[]
static final AttributedString
(package private) final int
static final AttributedString
(package private) final int
(package private) final long[]
Fields inherited from class org.jline.utils.AttributedCharSequence
DISABLE_ALTERNATE_CHARSET, TRUE_COLORS
-
Constructor Summary
ConstructorsConstructorDescriptionAttributedString
(char[] buffer, long[] style, int start, int end) AttributedString
(CharSequence str, int start, int end) AttributedString
(CharSequence str, int start, int end, AttributedStyle s) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
arrEq
(char[] a1, char[] a2, int s1, int s2, int l) private boolean
arrEq
(long[] a1, long[] a2, int s1, int s2, int l) protected char[]
buffer()
boolean
static AttributedString
static AttributedString
static AttributedString
int
hashCode()
static AttributedString
join
(AttributedString delimiter, Iterable<AttributedString> elements) static AttributedString
join
(AttributedString delimiter, AttributedString... elements) int
length()
protected int
offset()
static String
styleAt
(int index) (package private) long
styleCodeAt
(int index) styleMatches
(Pattern pattern, AttributedStyle style) subSequence
(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, isEmpty
-
Field Details
-
buffer
final char[] buffer -
style
final long[] style -
start
final int start -
end
final int end -
EMPTY
-
NEWLINE
-
-
Constructor Details
-
AttributedString
-
AttributedString
-
AttributedString
-
AttributedString
-
AttributedString
AttributedString(char[] buffer, long[] style, int start, int end)
-
-
Method Details
-
fromAnsi
-
fromAnsi
-
fromAnsi
-
stripAnsi
-
buffer
protected char[] buffer()- Specified by:
buffer
in classAttributedCharSequence
-
offset
protected int offset()- Specified by:
offset
in classAttributedCharSequence
-
length
public int length() -
styleAt
- Specified by:
styleAt
in classAttributedCharSequence
-
styleCodeAt
long styleCodeAt(int index) - Overrides:
styleCodeAt
in classAttributedCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
- Specified by:
subSequence
in classAttributedCharSequence
-
styleMatches
-
equals
-
arrEq
private boolean arrEq(char[] a1, char[] a2, int s1, int s2, int l) -
arrEq
private boolean arrEq(long[] a1, long[] a2, int s1, int s2, int l) -
hashCode
public int hashCode() -
join
-
join
public static AttributedString join(AttributedString delimiter, Iterable<AttributedString> elements)
-