Package top.focess.qq.api.command.data
Class StringBuffer
- java.lang.Object
-
- top.focess.qq.api.command.data.DataBuffer<String>
-
- top.focess.qq.api.command.data.StringBuffer
-
public class StringBuffer extends DataBuffer<String>
Represent a buffer of String.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringBufferallocate(int size)Allocate a StringBuffer with fixed sizevoidflip()Flip all the buffers.Stringget()Get element in the buffer in orderStringget(int index)Get element in the buffer by indexvoidput(String s)Put the element into the buffer
-
-
-
Method Detail
-
allocate
@NotNull @Contract("_ -> new") public static StringBuffer allocate(int size)Allocate a StringBuffer with fixed size- Parameters:
size- the target buffer size- Returns:
- a StringBuffer with fixed size
-
flip
public void flip()
Description copied from class:DataBufferFlip all the buffers. Make them all readable.- Specified by:
flipin classDataBuffer<String>
-
put
public void put(@NotNull String s)Description copied from class:DataBufferPut the element into the buffer- Specified by:
putin classDataBuffer<String>- Parameters:
s- the element need to be put in the buffer
-
get
@NotNull public String get()
Description copied from class:DataBufferGet element in the buffer in order- Specified by:
getin classDataBuffer<String>- Returns:
- element in the buffer in order
-
get
@NotNull public String get(int index)
Description copied from class:DataBufferGet element in the buffer by index- Specified by:
getin classDataBuffer<String>- Parameters:
index- the element index- Returns:
- element in the index of the buffer
-
-