Package com.gpudb

Class Type.Column

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    Type

    public static final class Type.Column
    extends Object
    implements Serializable
    Immutable collection of metadata about a column that is part of a GPUdb type.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_DECIMAL_PRECISION

        public static final int DEFAULT_DECIMAL_PRECISION
        See Also:
        Constant Field Values
      • DEFAULT_DECIMAL_MIN

        public static final BigDecimal DEFAULT_DECIMAL_MIN
      • DEFAULT_DECIMAL_MAX

        public static final BigDecimal DEFAULT_DECIMAL_MAX
    • Method Detail

      • getName

        public String getName()
        Gets the name of the column.
        Returns:
        the name of the column
      • getType

        public Class<?> getType()
        Gets the Java data type of the column.
        Returns:
        the Java data type of the column
      • getColumnBaseType

        public Type.Column.ColumnBaseType getColumnBaseType()
        Gets the enumeration of the *base* type of the column. This is far more efficient than using getType() 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) for Type.Column.ColumnType, this enumeration can be used to cover all string cases.
        Returns:
        the enumeration representing the *base* type of the column
      • getColumnType

        public Type.Column.ColumnType getColumnType()
        Gets the enumeration of the type of the column. This is far more efficient than using hasProperty(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 column
      • isDecimal

        public boolean isDecimal()
      • getDecimalPrecision

        public int getDecimalPrecision()
      • getDecimalScale

        public int getDecimalScale()
      • isNullable

        public boolean isNullable()
        Gets whether the column is nullable.
        Returns:
        whether the column is nullable
      • isArray

        public boolean isArray()
        Determine if the column is an Array type
        Returns:
        True if the column is an Array
      • getProperties

        public List<String> getProperties()
        Gets the list of properties that apply to the column.
        Returns:
        the list of properties that apply to the column
        See Also:
        ColumnProperty
      • isVector

        public boolean isVector()
        Determine if the column is a Vector type
        Returns:
        True if the column is a Vector type
      • getVectorDimensions

        public int getVectorDimensions()
        Get vector datatype dimensions, -1 if not a vector
        Returns:
        Size of the vector, -1 if not a vector
      • hasProperty

        public boolean hasProperty​(String property)
        Checks if the given property applies to the column.
        Returns:
        boolean indicating whether the given property exists in the column's properties.
        See Also:
        ColumnProperty
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object