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,HnswParams.Vector,IdUid.Vector,IntVector,JwtConfig.Vector,LongVector,Model.Vector,ModelEntity.Vector,ModelProperty.Vector,ModelRelation.Vector,ShortVector,StringVector,SyncServerOptions.Vector,UnionVector
public class BaseVector extends java.lang.ObjectAll vector access objects derive from this class, and add their own accessors.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.ByteBufferbbThe underlying ByteBuffer to hold the data of the vector.private intelement_sizeUsed to hold the vector element size in table.private intlengthUsed to hold the vector size.private intvectorUsed to hold the vector data position.
-
Constructor Summary
Constructors Constructor Description BaseVector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int__element(int j)Gets the element position in vector's ByteBuffer.protected void__reset(int _vector, int _element_size, java.nio.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.intlength()Get the length of a vector.voidreset()Resets the internal state with a nullByteBufferand a zero position.
-
-
-
Field Detail
-
vector
private int vector
Used to hold the vector data position.
-
length
private int length
Used to hold the vector size.
-
element_size
private int element_size
Used to hold the vector element size in table.
-
bb
protected java.nio.ByteBuffer bb
The underlying ByteBuffer to hold the data of the vector.
-
-
Method Detail
-
__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
protected void __reset(int _vector, int _element_size, java.nio.ByteBuffer _bb)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 toByteBufferreferences.
-
reset
public void reset()
Resets the internal state with a nullByteBufferand a zero position. This method exists primarily to allow recycling vector instances without risking memory leaks due toByteBufferreferences. 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.
-
-