Interface ToIntegerCast<T extends Any>

All Superinterfaces:
AutoCloseable, SafeCloseable, ToIntFunctor<T>

public interface ToIntegerCast<T extends Any> extends ToIntFunctor<T>
  • Method Details

    • apply

      IntChunk<? extends T> apply(Chunk<? extends T> input)
      Description copied from interface: ToIntFunctor
      Apply this function to the input chunk, returning an output chunk. The result is owned by this ToIntFunctor.
      Specified by:
      apply in interface ToIntFunctor<T extends Any>
      Parameters:
      input - the chunk to transform
      Returns:
      the result IntChunk
    • makeToIntegerCast

      static <T extends Any> ToIntFunctor<T> makeToIntegerCast(ChunkType type, int size, int offset)
      Create an IntFunctor that casts the values in an input chunk to an int. An optional offset is applied to each value after the cast.
      Type Parameters:
      T - the chunk's attribute
      Parameters:
      type - the type of chunk, must be an integral primitive type
      size - the size of the largest chunk that can be cast by this functor
      offset - an offset to add to each casted result
      Returns:
      a ToIntFunctor that can be applied to chunks of type in order to produce an IntChunk of values
    • makeToIntegerCastNullAware

      static <T extends Any> ToIntFunctor<T> makeToIntegerCastNullAware(ChunkType type, int size)
      Create an IntFunctor that casts the values in an input chunk to an int, mapping the source type's null sentinel to QueryConstants.NULL_INT.
      Type Parameters:
      T - the chunk's attribute
      Parameters:
      type - the type of chunk, must be an integral primitive type
      size - the size of the largest chunk that can be cast by this functor
      Returns:
      a ToIntFunctor that can be applied to chunks of type in order to produce an IntChunk of values
    • castInto

      static <T extends Any> void castInto(Chunk<? extends T> src, WritableIntChunk<T> dst)
      Cast src into dst, performing a raw (non-null-aware) widening or narrowing conversion.
      Type Parameters:
      T - the chunk's attribute
      Parameters:
      src - the source chunk, must be an integral primitive type
      dst - the destination chunk
    • castIntoNullAware

      static <T extends Any> void castIntoNullAware(Chunk<? extends T> src, WritableIntChunk<T> dst)
      Cast src into dst, mapping the source type's null sentinel to QueryConstants.NULL_INT.
      Type Parameters:
      T - the chunk's attribute
      Parameters:
      src - the source chunk, must be an integral primitive type
      dst - the destination chunk