Class Index

    • Constructor Detail

      • Index

        public Index​(Table table,
                     boolean isUnique,
                     Map<String,​String> extensions)
        Constructor.
        Parameters:
        table - The table
        isUnique - Whether the index is unique
        extensions - Any extensions for the index
      • Index

        public Index​(CandidateKey ck)
        Constructor for an index for the specified candidate key.
        Parameters:
        ck - Candidate key to use as a basis
      • Index

        public Index​(ForeignKey fk)
        Constructor for an index for the specified foreign key.
        Parameters:
        fk - Foreign key to use as a basis
    • Method Detail

      • getUnique

        public boolean getUnique()
        Accessor for whether the index is unique
        Returns:
        Whether it is unique.
      • hashCode

        public int hashCode()
        Hashcode operator.
        Returns:
        The hashcode
      • equals

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

        public String toString()
        Stringify method.
        Overrides:
        toString in class Object
        Returns:
        String version of this object.
      • 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
      • 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.