Class ColumnDefinition<TYPE>

java.lang.Object
io.deephaven.engine.table.ColumnDefinition<TYPE>
All Implemented Interfaces:
LogOutputAppendable

public class ColumnDefinition<TYPE> extends Object implements LogOutputAppendable
Column definition for all Deephaven columns.
  • Field Details

    • ZERO_LENGTH_COLUMN_DEFINITION_ARRAY

      public static final ColumnDefinition<?>[] ZERO_LENGTH_COLUMN_DEFINITION_ARRAY
  • Method Details

    • ofBoolean

      public static ColumnDefinition<Boolean> ofBoolean(@NotNull @NotNull String name)
    • ofByte

      public static ColumnDefinition<Byte> ofByte(@NotNull @NotNull String name)
    • ofChar

      public static ColumnDefinition<Character> ofChar(@NotNull @NotNull String name)
    • ofShort

      public static ColumnDefinition<Short> ofShort(@NotNull @NotNull String name)
    • ofInt

      public static ColumnDefinition<Integer> ofInt(@NotNull @NotNull String name)
    • ofLong

      public static ColumnDefinition<Long> ofLong(@NotNull @NotNull String name)
    • ofFloat

      public static ColumnDefinition<Float> ofFloat(@NotNull @NotNull String name)
    • ofDouble

      public static ColumnDefinition<Double> ofDouble(@NotNull @NotNull String name)
    • ofString

      public static ColumnDefinition<String> ofString(@NotNull @NotNull String name)
    • ofTime

      public static ColumnDefinition<Instant> ofTime(@NotNull @NotNull String name)
    • of

      public static ColumnDefinition<?> of(String name, Type<?> type)
    • of

      public static ColumnDefinition<?> of(String name, PrimitiveType<?> type)
    • of

      public static ColumnDefinition<?> of(String name, GenericType<?> type)
    • ofVector

      public static <T extends Vector<?>> ColumnDefinition<T> ofVector(@NotNull @NotNull String name, @NotNull @NotNull Class<T> vectorType)
    • fromGenericType

      public static <T> ColumnDefinition<T> fromGenericType(@NotNull @NotNull String name, @NotNull @NotNull Class<T> dataType)
    • fromGenericType

      public static <T> ColumnDefinition<T> fromGenericType(@NotNull @NotNull String name, @NotNull @NotNull Class<T> dataType, @Nullable @Nullable Class<?> componentType)
    • fromGenericType

      public static <T> ColumnDefinition<T> fromGenericType(@NotNull @NotNull String name, @NotNull @NotNull Class<T> dataType, @Nullable @Nullable Class<?> componentType, @NotNull @NotNull ColumnDefinition.ColumnType columnType)
    • from

      public static ColumnDefinition<?> from(ColumnHeader<?> header)
    • getName

      @NotNull public @NotNull String getName()
    • getDataType

      @NotNull public @NotNull Class<TYPE> getDataType()
    • getComponentType

      @Nullable public @Nullable Class<?> getComponentType()
    • getColumnType

      @NotNull public @NotNull ColumnDefinition.ColumnType getColumnType()
    • withPartitioning

      public ColumnDefinition<TYPE> withPartitioning()
    • withNormal

      public ColumnDefinition<TYPE> withNormal()
    • withDataType

      public <Other> ColumnDefinition<Other> withDataType(@NotNull @NotNull Class<Other> newDataType)
    • withName

      public ColumnDefinition<?> withName(@NotNull @NotNull String newName)
    • isPartitioning

      public boolean isPartitioning()
    • isDirect

      public boolean isDirect()
    • isCompatible

      public boolean isCompatible(@NotNull @NotNull ColumnDefinition<?> other)
      Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of storage and derivation. Checks for equality of name, dataType, and componentType. As such, this method has an equivalence relation, ie A.isCompatible(B) == B.isCompatible(A).
      Parameters:
      other - The ColumnDefinition to compare to
      Returns:
      Whether the ColumnDefinition defines a column whose name and data are compatible with this ColumnDefinition
    • hasCompatibleDataType

      public boolean hasCompatibleDataType(@NotNull @NotNull ColumnDefinition<?> other)
      Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of name, storage and derivation. Checks for equality of dataType, and componentType. As such, this method has an equivalence relation, ie A.hasCompatibleDataType(B) == B.hasCompatibleDataType(A).
      Parameters:
      other - - The ColumnDefinition to compare to.
      Returns:
      True if the ColumnDefinition defines a column whose data is compatible with this ColumnDefinition.
    • describeForCompatibility

      public String describeForCompatibility()
      Describes the column definition with respect to the fields that are checked in isCompatible(ColumnDefinition).
      Returns:
      the description for compatibility
    • describeDifferences

      public void describeDifferences(@NotNull @NotNull List<String> differences, @NotNull @NotNull ColumnDefinition<?> other, @NotNull @NotNull String lhs, @NotNull @NotNull String rhs, @NotNull @NotNull String prefix, boolean includeColumnType)
      Enumerate the differences between this ColumnDefinition, and another one. Lines will be of the form "lhs attribute 'value' does not match rhs attribute 'value'.
      Parameters:
      differences - an array to which differences can be added
      other - the ColumnDefinition under comparison
      lhs - what to call "this" definition
      rhs - what to call the other definition
      prefix - begin each difference with this string
      includeColumnType - whether to include columnType comparisons
    • checkCastTo

      public final void checkCastTo(Class<?> destDataType)
      Checks if objects of type dataType can be cast to destDataType (equivalent to destDataType.isAssignableFrom(dataType)). If not, this throws a ClassCastException.
      Parameters:
      destDataType - the destination data type
    • checkCastTo

      public final void checkCastTo(Class<?> destDataType, @Nullable @Nullable Class<?> destComponentType)
      Checks if objects of type dataType can be cast to destDataType (equivalent to destDataType.isAssignableFrom(dataType)) and checks that objects of type componentType can be cast to destComponentType (both component types must be present and cast-able, or both must be null; when both present, is equivalent to destComponentType.isAssignableFrom(componentType)). If not, this throws a ClassCastException.
      Parameters:
      destDataType - the destination data type
      destComponentType - the destination component type, may be null
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • append

      public LogOutput append(LogOutput logOutput)
      Specified by:
      append in interface LogOutputAppendable