- java.lang.Object
-
- io.netty5.util.internal.AppendableCharSequence
-
- All Implemented Interfaces:
Appendable
,CharSequence
public final class AppendableCharSequence extends Object implements CharSequence, Appendable
-
-
Constructor Summary
Constructors Constructor Description AppendableCharSequence(int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppendableCharSequence
append(char c)
AppendableCharSequence
append(CharSequence csq)
AppendableCharSequence
append(CharSequence csq, int start, int end)
char
charAt(int index)
char
charAtUnsafe(int index)
Access a value in thisCharSequence
.int
length()
void
reset()
Reset theAppendableCharSequence
.void
setLength(int length)
AppendableCharSequence
subSequence(int start, int end)
String
substring(int start, int end)
Create a newString
from the given start to end.String
subStringUnsafe(int start, int end)
Create a newString
from the given start to end.String
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
-
setLength
public void setLength(int length)
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
charAtUnsafe
public char charAtUnsafe(int index)
Access a value in thisCharSequence
. This method is considered unsafe as index values are assumed to be legitimate. Only underlying array bounds checking is done.- Parameters:
index
- The index to access the underlying array at.- Returns:
- The value at
index
.
-
subSequence
public AppendableCharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
append
public AppendableCharSequence append(char c)
- Specified by:
append
in interfaceAppendable
-
append
public AppendableCharSequence append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
-
append
public AppendableCharSequence append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
-
reset
public void reset()
Reset theAppendableCharSequence
. Be aware this will only reset the current internal position and not shrink the internal char array.
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
substring
public String substring(int start, int end)
Create a newString
from the given start to end.
-
-