Skip to content

Commit

Permalink
fix: formatting AbstractVariableWidthVector class
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed Mar 28, 2024
1 parent 76a01a8 commit 4c36aaf
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,32 @@
import org.apache.arrow.vector.VariableWidthVector;
import org.apache.arrow.vector.VectorDefinitionSetter;

/**
* A base class for common functionalities in variable width vectors.
*/
public abstract class AbstractVariableWidthVector extends BaseValueVector
implements VariableWidthVector, FieldVector, VectorDefinitionSetter {

/**
* Instantiate a AbstractVariableWidthVector.
*
* @param allocator The allocator to use for creating/reallocating buffers
*/
protected AbstractVariableWidthVector(BufferAllocator allocator) {
super(allocator);
}

/**
* Set the variable length element at the specified index to the supplied byte array.
*
* @param index position of the element to set
* @param value array of bytes with data
*/
public abstract void set(int index, byte[] value);

/**
* Set the variable length element at the specified index to the supplied byte array.
*
* @param index position of the element to set
* @param value array of bytes with data
* @param start start position in the array
Expand All @@ -51,6 +61,7 @@ protected AbstractVariableWidthVector(BufferAllocator allocator) {

/**
* Set the variable length element at the specified index to the supplied ByteBuffer.
*
* @param index position of the element to set
* @param value ByteBuffer with data
* @param start start position in the ByteBuffer
Expand All @@ -71,6 +82,7 @@ protected AbstractVariableWidthVector(BufferAllocator allocator) {
/**
* Set the variable length element at the specified index to the supplied byte array, and it
* handles the case where index and length of new element are beyond the existing capacity.
*
* @param index position of the element to set
* @param value array of bytes with data
* @param start start position in the array
Expand All @@ -90,16 +102,17 @@ protected AbstractVariableWidthVector(BufferAllocator allocator) {

/**
* Get the variable length element at the specified index.
*
* @param index position of the element to get
* @return byte array with the data
*/
public abstract byte[] get(int index);

/**
* Get the variable length element at the specified index using a ReusableBuffer.
* Get the variable length element at the specified index using a ReusableBuffer.
* @param index position of the element to get
* @param buffer ReusableBuffer to write the data to
*/
*/
public abstract void read(int index, ReusableBuffer<?> buffer);

/**
Expand All @@ -111,14 +124,15 @@ protected AbstractVariableWidthVector(BufferAllocator allocator) {

/**
* Set the index of last non-null element in the vector.
*
* @param value desired index of last non-null element
*/
public abstract void setLastSet(int value);

/**
* Get the variable length element at specified index as Text.
*
* @param index position of element to get
* @param index position of element to get
* @return greater than 0 length for non-null element, 0 otherwise
*/
public abstract int getValueLength(int index);
Expand All @@ -135,8 +149,8 @@ protected AbstractVariableWidthVector(BufferAllocator allocator) {
/**
* Sets the value length for an element.
*
* @param index position of the element to set
* @param length length of the element
* @param index position of the element to set
* @param length length of the element
*/
public abstract void setValueLengthSafe(int index, int length);
}

0 comments on commit 4c36aaf

Please sign in to comment.