- 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 AppendableCharSequenceappend(char c)AppendableCharSequenceappend(CharSequence csq)AppendableCharSequenceappend(CharSequence csq, int start, int end)charcharAt(int index)charcharAtUnsafe(int index)Access a value in thisCharSequence.intlength()voidreset()Reset theAppendableCharSequence.voidsetLength(int length)AppendableCharSequencesubSequence(int start, int end)Stringsubstring(int start, int end)Create a newStringfrom the given start to end.StringsubStringUnsafe(int start, int end)Create a newStringfrom the given start to end.StringtoString()-
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:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin 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:
subSequencein interfaceCharSequence
-
append
public AppendableCharSequence append(char c)
- Specified by:
appendin interfaceAppendable
-
append
public AppendableCharSequence append(CharSequence csq)
- Specified by:
appendin interfaceAppendable
-
append
public AppendableCharSequence append(CharSequence csq, int start, int end)
- Specified by:
appendin 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:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
substring
public String substring(int start, int end)
Create a newStringfrom the given start to end.
-
-