Class Index


public class Index extends ColumnOrderedKey
Representation of an INDEX.
  • Field Details

    • EXTENSION_INDEX_EXTENDED_SETTING

      public static final String EXTENSION_INDEX_EXTENDED_SETTING
      See Also:
    • EXTENSION_INDEX_TYPE

      public static final String EXTENSION_INDEX_TYPE
      See Also:
    • isUnique

      private final boolean isUnique
  • Constructor Details

    • 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 Details

    • getUnique

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

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

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

      public String toString()
      Stringify method. Generates a form of the index ready to be used in a DDL statement. e.g
      INDEX (col1, col2)
      Overrides:
      toString in class Object
      Returns:
      String version of this object.