Class BaseAppendableColumn<TYPE>

java.lang.Object
com.illumon.iris.db.tables.appendable.BaseAppendableColumn<TYPE>
All Implemented Interfaces:
AppendableColumn<TYPE>
Direct Known Subclasses:
LocalAppendableColumn, StreamAppendableColumn

public abstract class BaseAppendableColumn<TYPE> extends Object implements AppendableColumn<TYPE>
Base class for AppendableColumn implementations.
  • Field Details

    • name

      protected final String name
    • type

      protected final Class<TYPE> type
  • Constructor Details

    • BaseAppendableColumn

      public BaseAppendableColumn(@NotNull String name, @NotNull Class<TYPE> type)
  • Method Details

    • checkArrayAddBounds

      protected static void checkArrayAddBounds(int arrayLength, int startIndex, int length)
    • encodeSerializable

      protected static <VALUE_TYPE> byte[] encodeSerializable(@NotNull VALUE_TYPE value)
      Encode a value of a (assumed to be) serializable type.
      Parameters:
      value - The value to encode
      Returns:
      The value's serialized bytes
    • encodeExternalizable

      protected static <VALUE_TYPE extends Externalizable> byte[] encodeExternalizable(@NotNull VALUE_TYPE value)
    • getName

      public String getName()
      Description copied from interface: AppendableColumn
      The name of this column in the enclosing table.
      Specified by:
      getName in interface AppendableColumn<TYPE>
      Returns:
      The name of this column
    • getType

      public Class<TYPE> getType()
      Specified by:
      getType in interface AppendableColumn<TYPE>
      Returns:
      the type of object contained within this column.
    • getAddHelper

      public AppendableColumnAddHelper<TYPE> getAddHelper()
      Description copied from interface: AppendableColumn
      Get a type-appropriate helper instance for complex append operations.
      Specified by:
      getAddHelper in interface AppendableColumn<TYPE>
      Returns:
      An add-helper for this column
    • addBoolean

      public final void addBoolean(Boolean value)
      Description copied from interface: AppendableColumn
      Append a Boolean to this column.
      Specified by:
      addBoolean in interface AppendableColumn<TYPE>
      Parameters:
      value - The value to append
    • addBoolean

      public final void addBoolean(Boolean value, long count)
      Description copied from interface: AppendableColumn
      Append a Boolean to this column count times.
      Specified by:
      addBoolean in interface AppendableColumn<TYPE>
      Parameters:
      value - The value to append
      count - The number of times to append the value
    • addBooleans

      public final void addBooleans(@NotNull Boolean[] values, int startIndex, int length)
      Description copied from interface: AppendableColumn
      Add Boolean values from an array.
      Specified by:
      addBooleans in interface AppendableColumn<TYPE>
      Parameters:
      values - The array of values
      startIndex - The index of the first value to add
      length - The total number of values to add
    • add

      public void add(TYPE value)
      Description copied from interface: AppendableColumn
      Append a DATA_TYPE to this column.
      Specified by:
      add in interface AppendableColumn<TYPE>
      Parameters:
      value - The value to append
    • add

      public final void add(TYPE value, long count)
      Description copied from interface: AppendableColumn
      Append a DATA_TYPE to this column count times.
      Specified by:
      add in interface AppendableColumn<TYPE>
      Parameters:
      value - The value to append
      count - The number of times to append the value
    • add

      public final void add(@NotNull TYPE[] values, int startIndex, int length)
      Description copied from interface: AppendableColumn
      Add DATA_TYPE values from an array.
      Specified by:
      add in interface AppendableColumn<TYPE>
      Parameters:
      values - The array of values
      startIndex - The index of the first value to add
      length - The total number of values to add