public final class UInt1Vector extends BaseFixedWidthVector implements BaseIntVector
| Modifier and Type | Field and Description |
|---|---|
static byte |
MAX_UINT1
The maximum 8-bit unsigned integer.
|
static int |
PROMOTION_MASK
The mask to use when promoting the unsigned byte value to an integer.
|
static byte |
TYPE_WIDTH |
actualValueCapacity, field, lastValueCapacity, validityBuffer, valueBuffer, valueCountallocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY| Constructor and Description |
|---|
UInt1Vector(Field field,
BufferAllocator allocator)
Constructor for UInt1Vector.
|
UInt1Vector(String name,
BufferAllocator allocator) |
UInt1Vector(String name,
FieldType fieldType,
BufferAllocator allocator) |
| Modifier and Type | Method and Description |
|---|---|
byte |
get(int index)
Get the element at the given index from the vector.
|
void |
get(int index,
NullableUInt1Holder holder)
Get the element at the given index from the vector and
sets the state in holder.
|
Types.MinorType |
getMinorType() |
static short |
getNoOverflow(ArrowBuf buffer,
int index)
Given a data buffer, get the value stored at a particular position
in the vector.
|
Byte |
getObject(int index)
Same as
get(int). |
Short |
getObjectNoOverflow(int index)
Returns the value stored at index without the potential for overflow.
|
protected FieldReader |
getReaderImpl()
Each vector has a different reader that implements the FieldReader interface.
|
TransferPair |
getTransferPair(Field field,
BufferAllocator allocator)
Construct a TransferPair comprising this and a target vector of
the same type.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator)
Construct a transfer pair of this vector and another vector of same type.
|
long |
getValueAsLong(int index)
Gets the value at index.
|
TransferPair |
makeTransferPair(ValueVector to)
Makes a new transfer pair used to transfer underlying buffers.
|
void |
set(int index,
byte value)
Set the element at the given index to the given value.
|
void |
set(int index,
int value)
Set the element at the given index to the given value.
|
void |
set(int index,
int isSet,
byte value)
Sets the value at index to value isSet > 0, otherwise sets the index position
to invalid/null.
|
void |
set(int index,
NullableUInt1Holder holder)
Set the element at the given index to the value set in data holder.
|
void |
set(int index,
UInt1Holder holder)
Set the element at the given index to the value set in data holder.
|
void |
setSafe(int index,
byte value)
Same as
set(int, byte) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity(). |
void |
setSafe(int index,
int value)
Same as
set(int, int) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity(). |
void |
setSafe(int index,
int isSet,
byte value)
Same as
set(int, int, byte) but will reallocate the buffer if index
is larger than current capacity. |
void |
setSafe(int index,
NullableUInt1Holder holder)
Same as
set(int, NullableUInt1Holder) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity(). |
void |
setSafe(int index,
UInt1Holder holder)
Same as
set(int, UInt1Holder) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity(). |
void |
setUnsafeWithPossibleTruncate(int index,
long value)
Sets the value at index, note this value may need to be truncated.
|
void |
setWithPossibleTruncate(int index,
long value)
Sets the value at index, note this value may need to be truncated.
|
String |
toString()
Representation of vector suitable for debugging.
|
accept, allocateNew, allocateNew, allocateNewSafe, clear, close, copyFrom, copyFromSafe, decrementAllocationMonitor, getBuffers, getBufferSize, getBufferSizeFor, getChildrenFromFields, getDataBuffer, getDataBufferAddress, getDataPointer, getDataPointer, getField, getFieldBuffers, getFieldInnerVectors, getName, getNullCount, getOffsetBuffer, getOffsetBufferAddress, getTransferPair, getTransferPair, getTransferPair, getTypeWidth, getValidityBuffer, getValidityBufferAddress, getValidityBufferValueCapacity, getValueBufferValueCapacity, getValueCapacity, getValueCount, handleSafe, hashCode, hashCode, incrementAllocationMonitor, initializeChildrenFromFields, isNull, isSafe, isSet, loadFieldBuffers, reAlloc, refreshValueCapacity, reset, set, set, setIndexDefined, setInitialCapacity, setNull, setSafe, setSafe, setValueCount, splitAndTransferTo, transferTo, validateScalars, zeroVectorcheckBufRefs, getAllocator, getReader, getValidityBufferSizeFromCount, iterator, releaseBuffer, transferBufferclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexportBuffer, exportCDataBuffers, getChildrenFromFields, getDataBufferAddress, getFieldBuffers, getFieldInnerVectors, getOffsetBufferAddress, getValidityBufferAddress, initializeChildrenFromFields, loadFieldBuffers, setNullaccept, allocateNew, allocateNewSafe, clear, close, copyFrom, copyFromSafe, getAllocator, getBuffers, getBufferSize, getBufferSizeFor, getDataBuffer, getField, getName, getNullCount, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, reAlloc, reset, setInitialCapacity, setValueCount, validate, validateFullforEach, iterator, spliteratorpublic static final int PROMOTION_MASK
public static final byte MAX_UINT1
public static final byte TYPE_WIDTH
public UInt1Vector(String name, BufferAllocator allocator)
public UInt1Vector(String name, FieldType fieldType, BufferAllocator allocator)
public UInt1Vector(Field field, BufferAllocator allocator)
field - Field typeallocator - Allocator typeprotected FieldReader getReaderImpl()
BaseValueVectorgetReaderImpl in class BaseValueVectorpublic Types.MinorType getMinorType()
getMinorType in interface ValueVectorpublic static short getNoOverflow(ArrowBuf buffer, int index)
To avoid overflow, the returned type is one step up from the signed type.
This method is mainly meant for integration tests.
buffer - data bufferindex - position of the element.public byte get(int index)
throws IllegalStateException
index - position of elementIllegalStateExceptionpublic void get(int index,
NullableUInt1Holder holder)
index - position of elementpublic Byte getObject(int index)
get(int).getObject in interface ValueVectorindex - position of elementpublic Short getObjectNoOverflow(int index)
index - position of elementpublic void set(int index,
int value)
index - position of elementvalue - value of elementpublic void set(int index,
byte value)
index - position of elementvalue - value of elementpublic void set(int index,
NullableUInt1Holder holder)
throws IllegalArgumentException
index - position of elementholder - nullable data holder for value of elementIllegalArgumentExceptionpublic void set(int index,
UInt1Holder holder)
index - position of elementholder - data holder for value of elementpublic void setSafe(int index,
int value)
set(int, int) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity().index - position of elementvalue - value of elementpublic void setSafe(int index,
byte value)
set(int, byte) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity().index - position of elementvalue - value of elementpublic void setSafe(int index,
NullableUInt1Holder holder)
throws IllegalArgumentException
set(int, NullableUInt1Holder) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity().index - position of elementholder - nullable data holder for value of elementIllegalArgumentExceptionpublic void setSafe(int index,
UInt1Holder holder)
set(int, UInt1Holder) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity().index - position of elementholder - data holder for value of elementpublic void set(int index,
int isSet,
byte value)
public void setSafe(int index,
int isSet,
byte value)
set(int, int, byte) but will reallocate the buffer if index
is larger than current capacity.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
BaseFixedWidthVectorgetTransferPair in interface ValueVectorgetTransferPair in class BaseFixedWidthVectorref - name of the target vectorallocator - allocator for the target vectorpublic TransferPair getTransferPair(Field field, BufferAllocator allocator)
getTransferPair in interface ValueVectorgetTransferPair in class BaseFixedWidthVectorfield - Field object used by the target vectorallocator - allocator for the target vectorTransferPairpublic TransferPair makeTransferPair(ValueVector to)
ValueVectormakeTransferPair in interface ValueVectorto - the target for the transfertransfer pair that is used to transfer underlying
buffers into the target vector.public void setWithPossibleTruncate(int index,
long value)
BaseIntVectorsetWithPossibleTruncate in interface BaseIntVectorpublic void setUnsafeWithPossibleTruncate(int index,
long value)
BaseIntVectorsetUnsafeWithPossibleTruncate in interface BaseIntVectorpublic long getValueAsLong(int index)
BaseIntVectorNullPointerException
if the value is null. Note null check could be turned off via NullCheckingForGet.getValueAsLong in interface BaseIntVectorpublic String toString()
BaseValueVectortoString in class BaseValueVectorCopyright © 2024 The Apache Software Foundation. All rights reserved.