Class AppendableCharSequence
java.lang.Object
io.netty.util.internal.AppendableCharSequence
- All Implemented Interfaces:
java.lang.Appendable, java.lang.CharSequence
public final class AppendableCharSequence
extends java.lang.Object
implements java.lang.CharSequence, java.lang.Appendable
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAppendableCharSequence(char[] chars) AppendableCharSequence(int length) -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(java.lang.CharSequence csq) append(java.lang.CharSequence csq, int start, int end) charcharAt(int index) charcharAtUnsafe(int index) Access a value in thisCharSequence.private static char[]expand(char[] array, int neededSpace, int size) intlength()voidreset()Reset theAppendableCharSequence.voidsetLength(int length) subSequence(int start, int end) java.lang.Stringsubstring(int start, int end) Create a newStringfrom the given start to end.java.lang.StringsubStringUnsafe(int start, int end) Create a newStringfrom the given start to end.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Field Details
-
chars
private char[] chars -
pos
private int pos
-
-
Constructor Details
-
AppendableCharSequence
public AppendableCharSequence(int length) -
AppendableCharSequence
private AppendableCharSequence(char[] chars)
-
-
Method Details
-
setLength
public void setLength(int length) -
length
public int length()- Specified by:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfacejava.lang.CharSequence
-
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
- Specified by:
subSequencein interfacejava.lang.CharSequence
-
append
- Specified by:
appendin interfacejava.lang.Appendable
-
append
- Specified by:
appendin interfacejava.lang.Appendable
-
append
- Specified by:
appendin interfacejava.lang.Appendable
-
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 java.lang.String toString()- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
substring
public java.lang.String substring(int start, int end) Create a newStringfrom the given start to end. -
subStringUnsafe
public java.lang.String subStringUnsafe(int start, int end) Create a newStringfrom 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. -
expand
private static char[] expand(char[] array, int neededSpace, int size)
-