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