Package io.deephaven.engine.table
Class ColumnDefinition<TYPE>
java.lang.Object
io.deephaven.engine.table.ColumnDefinition<TYPE>
- All Implemented Interfaces:
LogOutputAppendable
Column definition for all Deephaven columns.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
checkCastTo
(Class<?> destDataType) Checks if objects of typedataType
can be cast todestDataType
(equivalent todestDataType.isAssignableFrom(dataType)
).final void
checkCastTo
(Class<?> destDataType, @Nullable Class<?> destComponentType) Checks if objects of typedataType
can be cast todestDataType
(equivalent todestDataType.isAssignableFrom(dataType)
) and checks that objects of typecomponentType
can be cast todestComponentType
(both component types must be present and cast-able, or both must benull
; when both present, is equivalent todestComponentType.isAssignableFrom(componentType)
).void
describeDifferences
(@NotNull List<String> differences, @NotNull ColumnDefinition<?> other, @NotNull String lhs, @NotNull String rhs, @NotNull String prefix, boolean includeColumnType) Enumerate the differences between this ColumnDefinition, and another one.Describes the column definition with respect to the fields that are checked inisCompatible(ColumnDefinition)
.boolean
static ColumnDefinition<?>
from
(ColumnHeader<?> header) static <T> ColumnDefinition<T>
fromGenericType
(@NotNull String name, @NotNull Class<T> dataType) static <T> ColumnDefinition<T>
fromGenericType
(@NotNull String name, @NotNull Class<T> dataType, @Nullable Class<?> componentType) static <T> ColumnDefinition<T>
fromGenericType
(@NotNull String name, @NotNull Class<T> dataType, @Nullable Class<?> componentType, @NotNull ColumnDefinition.ColumnType columnType) @NotNull ColumnDefinition.ColumnType
@Nullable Class<?>
@NotNull String
getName()
boolean
hasCompatibleDataType
(@NotNull ColumnDefinition<?> other) Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of name, storage and derivation.int
hashCode()
boolean
isCompatible
(@NotNull ColumnDefinition<?> other) Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of storage and derivation.boolean
isDirect()
boolean
static ColumnDefinition<?>
of
(String name, GenericType<?> type) static ColumnDefinition<?>
of
(String name, PrimitiveType<?> type) static ColumnDefinition<?>
static ColumnDefinition<Boolean>
static ColumnDefinition<Byte>
static ColumnDefinition<Character>
static ColumnDefinition<Double>
static ColumnDefinition<Float>
static ColumnDefinition<Integer>
static ColumnDefinition<Long>
static ColumnDefinition<Short>
static ColumnDefinition<String>
static ColumnDefinition<Instant>
static <T extends Vector<?>>
ColumnDefinition<T>toString()
<Other> ColumnDefinition<Other>
withDataType
(@NotNull Class<Other> newDataType)
-
Field Details
-
ZERO_LENGTH_COLUMN_DEFINITION_ARRAY
-
-
Method Details
-
ofBoolean
-
ofByte
-
ofChar
-
ofShort
-
ofInt
-
ofLong
-
ofFloat
-
ofDouble
-
ofString
-
ofTime
-
of
-
of
-
of
-
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
-
getName
-
getDataType
-
getComponentType
-
getColumnType
-
withPartitioning
-
withNormal
-
withDataType
-
withName
-
isPartitioning
public boolean isPartitioning() -
isDirect
public boolean isDirect() -
isCompatible
Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of storage and derivation. Checks for equality ofname
,dataType
, andcomponentType
. As such, this method has an equivalence relation, ieA.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
Compares two ColumnDefinitions somewhat more permissively than equals, disregarding matters of name, storage and derivation. Checks for equality ofdataType
, andcomponentType
. As such, this method has an equivalence relation, ieA.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
Describes the column definition with respect to the fields that are checked inisCompatible(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 addedother
- the ColumnDefinition under comparisonlhs
- what to call "this" definitionrhs
- what to call the other definitionprefix
- begin each difference with this stringincludeColumnType
- whether to includecolumnType
comparisons
-
checkCastTo
Checks if objects of typedataType
can be cast todestDataType
(equivalent todestDataType.isAssignableFrom(dataType)
). If not, this throws aClassCastException
.- Parameters:
destDataType
- the destination data type
-
checkCastTo
public final void checkCastTo(Class<?> destDataType, @Nullable @Nullable Class<?> destComponentType) Checks if objects of typedataType
can be cast todestDataType
(equivalent todestDataType.isAssignableFrom(dataType)
) and checks that objects of typecomponentType
can be cast todestComponentType
(both component types must be present and cast-able, or both must benull
; when both present, is equivalent todestComponentType.isAssignableFrom(componentType)
). If not, this throws aClassCastException
.- Parameters:
destDataType
- the destination data typedestComponentType
- the destination component type, may benull
-
equals
-
hashCode
public int hashCode() -
toString
-
append
- Specified by:
append
in interfaceLogOutputAppendable
-