Class AbstractIntType

java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.AbstractIntType
All Implemented Interfaces:
FixedWidthType, Type
Direct Known Subclasses:
DateType, IntegerType, RealType

public abstract class AbstractIntType extends AbstractType implements FixedWidthType
  • Constructor Details

    • AbstractIntType

      protected AbstractIntType(TypeSignature signature)
  • Method Details

    • getFixedSize

      public final int getFixedSize()
      Description copied from interface: FixedWidthType
      Gets the size of a value of this type in bytes. All values of a FixedWidthType are the same size.
      Specified by:
      getFixedSize in interface FixedWidthType
    • isComparable

      public boolean isComparable()
      Description copied from interface: Type
      True if the type supports equalTo and hash.
      Specified by:
      isComparable in interface Type
      Overrides:
      isComparable in class AbstractType
    • isOrderable

      public boolean isOrderable()
      Description copied from interface: Type
      True if the type supports compareTo.
      Specified by:
      isOrderable in interface Type
      Overrides:
      isOrderable in class AbstractType
    • getTypeOperatorDeclaration

      public TypeOperatorDeclaration getTypeOperatorDeclaration(TypeOperators typeOperators)
      Description copied from interface: Type
      Gets the declared type specific operators for this type.
      Specified by:
      getTypeOperatorDeclaration in interface Type
    • getLong

      public final long getLong(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a long.
      Specified by:
      getLong in interface Type
      Overrides:
      getLong in class AbstractType
    • getInt

      public final int getInt(Block block, int position)
    • writeLong

      public void writeLong(BlockBuilder blockBuilder, long value)
      Description copied from interface: Type
      Writes the long value into the BlockBuilder.
      Specified by:
      writeLong in interface Type
      Overrides:
      writeLong in class AbstractType
    • writeInt

      public BlockBuilder writeInt(BlockBuilder blockBuilder, int value)
    • checkValueValid

      protected static void checkValueValid(long value)
    • appendTo

      public final void appendTo(Block block, int position, BlockBuilder blockBuilder)
      Description copied from interface: Type
      Append the value at position in block to blockBuilder.
      Specified by:
      appendTo in interface Type
    • getFlatFixedSize

      public int getFlatFixedSize()
      Description copied from interface: Type
      Returns the fixed size of this type when written to a flat buffer.
      Specified by:
      getFlatFixedSize in interface Type
    • createBlockBuilder

      public final BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
      Description copied from interface: Type
      Creates the preferred block builder for this type. This is the builder used to store values after an expression projection within the query.
      Specified by:
      createBlockBuilder in interface Type
    • createBlockBuilder

      public final BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
      Description copied from interface: Type
      Creates the preferred block builder for this type. This is the builder used to store values after an expression projection within the query.
      Specified by:
      createBlockBuilder in interface Type
    • createFixedSizeBlockBuilder

      public final BlockBuilder createFixedSizeBlockBuilder(int positionCount)
      Description copied from interface: FixedWidthType
      Creates a block builder for this type sized to hold the specified number of positions.
      Specified by:
      createFixedSizeBlockBuilder in interface FixedWidthType