java.lang.Object
com.gpudb.Type.Column
All Implemented Interfaces:
Enclosing class:
Immutable collection of metadata about a column that is part of a GPUdb type.
See Also:
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration of base types for column (excluding any property-related subtypes).static enumAn enumeration of all the Kinetica column types (including sub-types that are determined by the properties used).Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final BigDecimalstatic final BigDecimalstatic final intstatic final intMethod Summary
Modifier and TypeMethodDescriptionbooleanGet the sub-type of the arrayGets the enumeration of the *base* type of the column.Gets the enumeration of the type of the column.intintReturns the column’s default expressiongetName()Gets the name of the column.Gets the list of properties that apply to the column.Class<?> getType()Gets the Java data type of the column.intGet vector datatype dimensions, -1 if not a vectorbooleanDetermine if the column has a default expressioninthashCode()booleanhasProperty(String property) Checks if the given property applies to the column.booleanisArray()Determine if the column is an Array typebooleanbooleanGets whether the column is nullable.booleanisVector()Determine if the column is a Vector typetoString()
Field Details
DEFAULT_DECIMAL_MIN
DEFAULT_DECIMAL_MAX
Constructor Details
Column
Creates aType.Columnobject with the specified metadata.Parameters:name- the name of the columntype- the Java data type of the columnproperties- the list of properties that apply to the column; defaults to noneThrows:IllegalArgumentException- ifnameor anypropertiesare invalid, or iftypeis not one of the following:ByteBuffer,Double,Float,Integer,Long, orStringSee Also:Column
Creates aType.Columnobject with the specified metadata.Parameters:name- the name of the columntype- the Java data type of the columnproperties- the list of properties that apply to the column; defaults to noneThrows:IllegalArgumentException- ifnameor anypropertiesare invalid, or iftypeis not one of the following:ByteBuffer,Double,Float,Integer,Long, orStringSee Also:
Method Details
getColumnBaseType
Gets the enumeration of the *base* type of the column. This is far more efficient than usinggetType()and then comparing it to various Java classes, e.g. Integer.class. With this enumeration, switch statements can be used to do different things for different column types. This enumeration is preferred when the same thing needs to be done for all sub-types of a given base type. For example, string has a lot of sub-types; rather than having to group multiple case statements (and ensuring that no applicable enumeration is missed) forType.Column.ColumnType, this enumeration can be used to cover all string cases.Returns:the enumeration representing the *base* type of the columngetColumnType
Gets the enumeration of the type of the column. This is far more efficient than usinghasProperty(String)to check for given column properties. With this enumeration, switch statements can be used to do different things for different column types.Returns:the enumeration representing the type of the columnisDecimal
public boolean isDecimal()getDecimalPrecision
public int getDecimalPrecision()getDecimalScale
public int getDecimalScale()hasDefault
public boolean hasDefault()Determine if the column has a default expressionReturns:True if the column has a default expressionisNullable
public boolean isNullable()Gets whether the column is nullable.Returns:whether the column is nullableisArray
public boolean isArray()Determine if the column is an Array typeReturns:True if the column is an ArraygetArrayType
Get the sub-type of the arrayReturns:The ColumnBaseType of the array sub-type. Returns null if column is not an ArrayThrows:isVector
public boolean isVector()Determine if the column is a Vector typeReturns:True if the column is a Vector typegetVectorDimensions
public int getVectorDimensions()Get vector datatype dimensions, -1 if not a vectorReturns:Size of the vector, -1 if not a vector