Package io.objectbox.flatbuffers
Class BaseVector
java.lang.Object
io.objectbox.flatbuffers.BaseVector
- Direct Known Subclasses:
BooleanVector
,ByteVector
,ClusterPeerConfig.Vector
,Credentials.Vector
,DoubleVector
,FlatStoreOptions.Vector
,FloatVector
,IntVector
,JwtConfig.Vector
,LongVector
,ShortVector
,StringVector
,SyncServerOptions.Vector
,UnionVector
All vector access objects derive from this class, and add their own accessors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteBuffer
The underlying ByteBuffer to hold the data of the vector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
__element
(int j) Gets the element position in vector's ByteBuffer.protected void
__reset
(int _vector, int _element_size, ByteBuffer _bb) Re-init the internal state with an external bufferByteBuffer
, an offset within and element size.protected int
__vector()
Get the start data of a vector.int
length()
Get the length of a vector.void
reset()
Resets the internal state with a nullByteBuffer
and a zero position.
-
Field Details
-
bb
The underlying ByteBuffer to hold the data of the vector.
-
-
Constructor Details
-
BaseVector
public BaseVector()
-
-
Method Details
-
__vector
protected int __vector()Get the start data of a vector.- Returns:
- Returns the start of the vector data.
-
__element
protected int __element(int j) Gets the element position in vector's ByteBuffer.- Parameters:
j
- An `int` index of element into a vector.- Returns:
- Returns the position of the vector element in a ByteBuffer.
-
__reset
Re-init the internal state with an external bufferByteBuffer
, an offset within and element size. This method exists primarily to allow recycling vector instances without risking memory leaks due toByteBuffer
references. -
reset
public void reset()Resets the internal state with a nullByteBuffer
and a zero position. This method exists primarily to allow recycling vector instances without risking memory leaks due toByteBuffer
references. The instance will be unusable until it is assigned again to aByteBuffer
. -
length
public int length()Get the length of a vector.- Returns:
- Returns the length of the vector.
-