public final class BooleanType extends AbstractPrimitiveType implements FixedWidthType
| Modifier and Type | Field and Description |
|---|---|
static BooleanType |
BOOLEAN |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(Block block,
int position,
BlockBuilder blockBuilder)
Append the value at
position in block to blockBuilder. |
int |
compareTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Compare the values in the specified block at the specified positions equal.
|
BlockBuilder |
createBlockBuilder(BlockBuilderStatus blockBuilderStatus,
int expectedEntries)
Creates the preferred block builder for this type.
|
BlockBuilder |
createBlockBuilder(BlockBuilderStatus blockBuilderStatus,
int expectedEntries,
int expectedBytesPerEntry)
Creates the preferred block builder for this type.
|
static Block |
createBlockForSingleNonNullValue(boolean value) |
BlockBuilder |
createFixedSizeBlockBuilder(int positionCount)
Creates a block builder for this type sized to hold the specified number
of positions.
|
boolean |
equals(Object other) |
boolean |
equalTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Are the values in the specified blocks at the specified positions equal?
|
boolean |
getBoolean(Block block,
int position)
Gets the value at the
block position as a boolean. |
boolean |
getBooleanUnchecked(UncheckedBlock block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a boolean
without boundary checks. |
int |
getFixedSize()
Gets the size of a value of this type is bytes.
|
Object |
getObjectValue(SqlFunctionProperties properties,
Block block,
int position)
Gets an object representation of the type value in the
block
position. |
long |
hash(Block block,
int position)
Calculates the hash code of the value at the specified position in the
specified block.
|
int |
hashCode() |
boolean |
isComparable()
True if the type supports equalTo and hash.
|
boolean |
isOrderable()
True if the type supports compareTo.
|
static Block |
wrapByteArrayAsBooleanBlockWithoutNulls(byte[] booleansAsBytes)
This method signifies a contract to callers that as an optimization, they can encode BooleanType blocks as a byte[] directly
and potentially bypass the BlockBuilder / BooleanType abstraction in the name of efficiency.
|
void |
writeBoolean(BlockBuilder blockBuilder,
boolean value)
Writes the boolean value into the
BlockBuilder. |
getTypeSignaturegetBlockUnchecked, getDisplayName, getDouble, getDoubleUnchecked, getJavaType, getLong, getLongUnchecked, getObject, getSlice, getSliceUnchecked, getTypeParameters, toString, writeDouble, writeLong, writeObject, writeSlice, writeSliceclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBlockUnchecked, getDisplayName, getDouble, getDoubleUnchecked, getJavaType, getLong, getLongUnchecked, getObject, getSlice, getSliceUnchecked, getTypeParameters, getTypeSignature, writeDouble, writeLong, writeObject, writeSlice, writeSlicepublic static final BooleanType BOOLEAN
public static Block wrapByteArrayAsBooleanBlockWithoutNulls(byte[] booleansAsBytes)
ByteArrayBlock is not always a valid or efficient representation, then this method must be
removed and any usages changedpublic static Block createBlockForSingleNonNullValue(boolean value)
public int getFixedSize()
FixedWidthTypegetFixedSize in interface FixedWidthTypepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
TypecreateBlockBuilder in interface Typepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
TypecreateBlockBuilder in interface Typepublic BlockBuilder createFixedSizeBlockBuilder(int positionCount)
FixedWidthTypecreateFixedSizeBlockBuilder in interface FixedWidthTypepublic boolean isComparable()
TypeisComparable in interface TypeisComparable in class AbstractTypepublic boolean isOrderable()
TypeisOrderable in interface TypeisOrderable in class AbstractTypepublic Object getObjectValue(SqlFunctionProperties properties, Block block, int position)
Typeblock
position. This is the value returned to the user via the
REST endpoint and therefore must be JSON serializable.getObjectValue in interface Typepublic boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypeThis method assumes input is not null.
equalTo in interface TypeequalTo in class AbstractTypepublic long hash(Block block, int position)
Typehash in interface Typehash in class AbstractTypepublic int compareTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypecompareTo in interface TypecompareTo in class AbstractTypepublic void appendTo(Block block, int position, BlockBuilder blockBuilder)
Typeposition in block to blockBuilder.public boolean getBoolean(Block block, int position)
Typeblock position as a boolean.getBoolean in interface TypegetBoolean in class AbstractTypepublic boolean getBooleanUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a boolean
without boundary checks.getBooleanUnchecked in interface TypegetBooleanUnchecked in class AbstractTypepublic void writeBoolean(BlockBuilder blockBuilder, boolean value)
TypeBlockBuilder.writeBoolean in interface TypewriteBoolean in class AbstractTypepublic boolean equals(Object other)
equals in class AbstractTypepublic int hashCode()
hashCode in class AbstractTypeCopyright © 2012–2022. All rights reserved.