Class ColumnOrderedKey

  • Direct Known Subclasses:
    CandidateKey, Index

    public abstract class ColumnOrderedKey
    extends Object
    Representation of a key that has columns with specified ordering (ascending/descending) for each column (if required).
    • Field Detail

      • columnOrdering

        protected List<Boolean> columnOrdering
        Column ordering. True implies ascending order.
      • name

        protected String name
        Name of the key.
      • table

        protected Table table
        Table that the key applies to.
      • columns

        protected List<Column> columns
        Columns that the key relates to.
    • Constructor Detail

    • Method Detail

      • getValueForExtension

        public String getValueForExtension​(String key)
      • addColumn

        public void addColumn​(Column col)
        Class to add a column to the key
        Parameters:
        col - The column to add
      • setColumnOrdering

        public void setColumnOrdering​(String ordering)
      • setColumn

        public void setColumn​(int seq,
                              Column col)
        Sets a column in a specified position seq for this index.
        Parameters:
        seq - the specified position for the col
        col - the Column
      • getColumnList

        public String getColumnList​(boolean includeOrdering)
        Method to return the list of columns which the key applies to.
        Parameters:
        includeOrdering - Whether to include ordering in the column list when it is specified
        Returns:
        The column list.
      • setName

        public void setName​(String name)
        Mutator for the key name.
        Parameters:
        name - The key name
      • getName

        public String getName()
        Accessor for the key name.
        Returns:
        Key name
      • getTable

        public Table getTable()
        Accessor for the table
        Returns:
        table
      • getColumns

        public List<Column> getColumns()
        Accessor for the columns that the key relates to.
        Returns:
        the List of columns.
      • getColumnList

        public String getColumnList()
        Accessor for the column list
        Returns:
        The column list
      • assertSameDatastoreObject

        protected void assertSameDatastoreObject​(Column col)
        Utility to assert if the column is for a different table.
        Parameters:
        col - The column to compare with
      • hashCode

        public int hashCode()
        Hashcode operator.
        Overrides:
        hashCode in class Object
        Returns:
        The hashcode
      • equals

        public boolean equals​(Object obj)
        Equality operator.
        Overrides:
        equals in class Object
        Parameters:
        obj - Object to compare against
        Returns:
        Whether they are equal.
      • setMinSize

        protected static void setMinSize​(List list,
                                         int size)
      • getColumnList

        public static String getColumnList​(List<Column> cols)
        Method to return the list of columns which the key applies to.
        Parameters:
        cols - The columns.
        Returns:
        The column list.