Top Fields Constructors Methods
io.netty5.util.internal

public final Class AppendableCharSequence

extends Object
implements CharSequence, Appendable
Class Inheritance
All Implemented Interfaces
java.lang.Appendable, java.lang.CharSequence
Imports
java.util.Arrays

Field Summary

Modifier and TypeField and Description
private char[]
private int

Constructor Summary

AccessConstructor and Description
public
private
AppendableCharSequence(char[] chars)

Method Summary

Modifier and TypeMethod and Description
public AppendableCharSequence
append(char
The character to append
c
)

Implements java.lang.Appendable.append.

Appends the specified character to this Appendable.
public AppendableCharSequence
append(CharSequence
The character sequence to append. If csq is null, then the four characters "null" are appended to this Appendable.
csq
)

Implements java.lang.Appendable.append.

Appends the specified character sequence to this Appendable.
public AppendableCharSequence
append(CharSequence
The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".
csq
,
int
The index of the first character in the subsequence
start
,
int
The index of the character following the last character in the subsequence
end
)

Implements java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this Appendable.
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.
public char

Returns:

The value at index.
charAtUnsafe
(int
The index to access the underlying array at.
index
)

Access a value in this CharSequence.

private static char[]
expand(char[] array, int neededSpace, int size)

public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.
public void
public void
setLength(int length)

public AppendableCharSequence
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.
public String
substring(int start, int end)

Create a new String from the given start to end.

public String
subStringUnsafe(int start, int end)

Create a new String from the given start to end.

public String
toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

charsback to summary
private char[] chars
posback to summary
private int pos

Constructor Detail

AppendableCharSequenceback to summary
public AppendableCharSequence(int length)
AppendableCharSequenceback to summary
private AppendableCharSequence(char[] chars)

Method Detail

appendback to summary
public AppendableCharSequence append(char c)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends the specified character to this Appendable.

Parameters
c:char

The character to append

Returns:AppendableCharSequence

A reference to this Appendable

Annotations
@Override
appendback to summary
public AppendableCharSequence 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.

Parameters
csq:CharSequence

The character sequence to append. If csq is null, then the four characters "null" are appended to this Appendable.

Returns:AppendableCharSequence

A reference to this Appendable

Annotations
@Override
appendback to summary
public AppendableCharSequence 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.

Parameters
csq:CharSequence

The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".

start:int

The index of the first character in the subsequence

end:int

The index of the character following the last character in the subsequence

Returns:AppendableCharSequence

A reference to this Appendable

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

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.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
charAtUnsafeback to summary
public char charAtUnsafe(int index)

Access a value in this CharSequence. This method is considered unsafe as index values are assumed to be legitimate. Only underlying array bounds checking is done.

Parameters
index:int

The index to access the underlying array at.

Returns:char

The value at index.

expandback to summary
private static char[] expand(char[] array, int neededSpace, int size)
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.

Returns:int

the number of chars in this sequence

Annotations
@Override
resetback to summary
public void reset()

Reset the AppendableCharSequence. Be aware this will only reset the current internal position and not shrink the internal char array.

setLengthback to summary
public void setLength(int length)
subSequenceback to summary
public AppendableCharSequence subSequence(int start, int end)

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.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:AppendableCharSequence

the specified subsequence

Annotations
@Override
substringback to summary
public String substring(int start, int end)

Create a new String from the given start to end.

subStringUnsafeback to summary
public String subStringUnsafe(int start, int end)

Create a new String from the given start to end. This method is considered unsafe as index values are assumed to be legitimate. Only underlying array bounds checking is done.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Doc from java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

Returns:String

a string consisting of exactly this sequence of characters

Annotations
@Override