APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.org.jline.utils

public Class AttributedStringBuilder

extends AttributedCharSequence
implements Appendable
Class Inheritance
All Implemented Interfaces
java.lang.Appendable
Imports
java.util.ArrayList, .Arrays, .List, java.util.function.Consumer, .Function, java.util.regex.Matcher, .Pattern

Attributed string builder
Author
Guillaume Nodet

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private char[]
private char[]
private char[]
private AttributedStyle
private boolean
private int
private int
private long[]
private AttributedStringBuilder.TabStops
Inherited from jdk.internal.org.jline.utils.AttributedCharSequence:
DISABLE_ALTERNATE_CHARSETTRUE_COLORS

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public AttributedStringBuilder
altCharset(String altIn, String altOut)

public AttributedStringBuilder
public static AttributedString
append(CharSequence... strings)

public AttributedStringBuilder
append(CharSequence csq)

Implements java.lang.Appendable.append.

Appends the specified character sequence to this Appendable.

public AttributedStringBuilder
append(CharSequence csq, int start, int end)

Implements java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this Appendable.

public AttributedStringBuilder
append(char c)

Implements java.lang.Appendable.append.

Appends the specified character to this Appendable.

public AttributedStringBuilder
append(char c, int repeat)

public AttributedStringBuilder
public AttributedStringBuilder
public AttributedStringBuilder
append(AttributedString str, int start, int end)

public AttributedStringBuilder
public AttributedStringBuilder
append(AttributedCharSequence str, int start, int end)

public void
protected char[]
public char
charAt(int index)

Overrides jdk.internal.org.jline.utils.AttributedCharSequence.charAt.

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

protected void
private static boolean
equals(char[] a, int aFromIndex, char[] b, int bFromIndex, int length)

protected void
public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

protected int
public void
setLength(int l)

public AttributedStringBuilder
public AttributedStringBuilder
public AttributedStyle
public AttributedStyle
pack-priv long
public AttributedStringBuilder
public AttributedStringBuilder
public AttributedStringBuilder
public AttributedStringBuilder
public AttributedStringBuilder
public AttributedString
subSequence(int start, int end)

Implements abstract jdk.internal.org.jline.utils.AttributedCharSequence.subSequence.

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public AttributedStringBuilder

Returns:

this
tabs
(int
Spaces per tab or 0 for no tab expansion. Must be non-negative
tabsize
)

Set the number of spaces a tab is expanded to.

public AttributedStringBuilder
tabs(List<Integer> tabs)

Inherited from jdk.internal.org.jline.utils.AttributedCharSequence:
codePointAtcodePointBeforecodePointCountcolumnLengthcolumnSplitLengthcolumnSplitLengthcolumnSubSequencecontainsisHiddenprintprintlnrgbColorroundColorroundRgbColorrunLimitrunStartsubstringtoAnsitoAnsitoAnsitoAnsitoAnsitoAnsitoAnsitoAttributedStringtoString

Field Detail

altInback to summary
private char[] altIn
altOutback to summary
private char[] altOut
bufferback to summary
private char[] buffer
currentback to summary
private AttributedStyle current
inAltCharsetback to summary
private boolean inAltCharset
lastLineLengthback to summary
private int lastLineLength
lengthback to summary
private int length
styleback to summary
private long[] style
tabsback to summary
private AttributedStringBuilder.TabStops tabs

Constructor Detail

AttributedStringBuilderback to summary
public AttributedStringBuilder()
AttributedStringBuilderback to summary
public AttributedStringBuilder(int capacity)

Method Detail

altCharsetback to summary
public AttributedStringBuilder altCharset(String altIn, String altOut)
ansiAppendback to summary
public AttributedStringBuilder ansiAppend(String ansi)
appendback to summary
public static AttributedString append(CharSequence... strings)
appendback to summary
public AttributedStringBuilder append(CharSequence csq)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends the specified character sequence to this Appendable.

Depending on which class implements the character sequence csq, the entire sequence may not be appended. For instance, if csq is a java.nio.CharBuffer then the subsequence to append is defined by the buffer's position and limit.

The contents of this Appendable are unspecified if the CharSequence is modified during the method call or an exception is thrown when accessing the CharSequence.

Annotations
@Override
appendback to summary
public AttributedStringBuilder append(CharSequence csq, int start, int end)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this Appendable.

An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in exactly the same way as the invocation

    out.append(csq.subSequence(start, end)) 

The contents of this Appendable are unspecified if the CharSequence is modified during the method call or an exception is thrown when accessing the CharSequence.

Annotations
@Override
appendback to summary
public AttributedStringBuilder append(char c)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends the specified character to this Appendable.

Annotations
@Override
appendback to summary
public AttributedStringBuilder append(char c, int repeat)
appendback to summary
public AttributedStringBuilder append(CharSequence csq, AttributedStyle style)
appendback to summary
public AttributedStringBuilder append(AttributedString str)
appendback to summary
public AttributedStringBuilder append(AttributedString str, int start, int end)
appendback to summary
public AttributedStringBuilder append(AttributedCharSequence str)
appendback to summary
public AttributedStringBuilder append(AttributedCharSequence str, int start, int end)
appendAnsiback to summary
public void appendAnsi(String ansi)
bufferback to summary
protected char[] buffer()

Implements abstract jdk.internal.org.jline.utils.AttributedCharSequence.buffer.

Annotations
@Override
charAtback to summary
public char charAt(int index)

Overrides jdk.internal.org.jline.utils.AttributedCharSequence.charAt.

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Annotations
@Override
ensureCapacityback to summary
protected void ensureCapacity(int nl)
equalsback to summary
private static boolean equals(char[] a, int aFromIndex, char[] b, int bFromIndex, int length)
insertTabback to summary
protected void insertTab(AttributedStyle s)
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Annotations
@Override
offsetback to summary
protected int offset()

Implements abstract jdk.internal.org.jline.utils.AttributedCharSequence.offset.

Annotations
@Override
setLengthback to summary
public void setLength(int l)
styleback to summary
public AttributedStringBuilder style(AttributedStyle style)
styleback to summary
public AttributedStringBuilder style(Function<AttributedStyle, AttributedStyle> style)
styleback to summary
public AttributedStyle style()
styleAtback to summary
public AttributedStyle styleAt(int index)

Implements abstract jdk.internal.org.jline.utils.AttributedCharSequence.styleAt.

Annotations
@Override
styleCodeAtback to summary
pack-priv long styleCodeAt(int index)

Overrides jdk.internal.org.jline.utils.AttributedCharSequence.styleCodeAt.

Annotations
@Override
styledback to summary
public AttributedStringBuilder styled(Function<AttributedStyle, AttributedStyle> style, CharSequence cs)
styledback to summary
public AttributedStringBuilder styled(AttributedStyle style, CharSequence cs)
styledback to summary
public AttributedStringBuilder styled(Function<AttributedStyle, AttributedStyle> style, Consumer<AttributedStringBuilder> consumer)
styleMatchesback to summary
public AttributedStringBuilder styleMatches(Pattern pattern, AttributedStyle s)
styleMatchesback to summary
public AttributedStringBuilder styleMatches(Pattern pattern, List<AttributedStyle> styles)
subSequenceback to summary
public AttributedString subSequence(int start, int end)

Implements abstract jdk.internal.org.jline.utils.AttributedCharSequence.subSequence.

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Annotations
@Override
tabsback to summary
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:int

Spaces per tab or 0 for no tab expansion. Must be non-negative

Returns:AttributedStringBuilder

this

tabsback to summary
public AttributedStringBuilder tabs(List<Integer> tabs)
jdk.internal.org.jline.utils back to summary

private Class AttributedStringBuilder.TabStops

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.internal.org.jline.utils.AttributedStringBuilder.TabStops

Field Summary

Modifier and TypeField and Description
private int
private int
private List<Integer>

Constructor Summary

AccessConstructor and Description
public
TabStops(int tabs)

public

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
pack-priv int
spaces(int lastLineLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastSizeback to summary
private int lastSize
lastStopback to summary
private int lastStop
tabsback to summary
private List<Integer> tabs

Constructor Detail

TabStopsback to summary
public TabStops(int tabs)
TabStopsback to summary
public TabStops(List<Integer> tabs)

Method Detail

definedback to summary
pack-priv boolean defined()
spacesback to summary
pack-priv int spaces(int lastLineLength)