Class Key

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<Column> columns
      Columns that the key relates to.
      protected java.lang.String name
      Name of the key.
      protected Table table
      Table that the key applies to.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Key​(Table table)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addColumn​(Column col)
      Class to add a column to the key
      protected void assertSameDatastoreObject​(Column col)
      Utility to assert if the column is for a different table.
      boolean equals​(java.lang.Object obj)
      Equality operator.
      java.lang.String getColumnList()
      Accessor for the column list
      static java.lang.String getColumnList​(java.util.List<Column> cols)
      Method to return the list of columns which the key applies to.
      java.util.List<Column> getColumns()
      Accessor for the columns that the key relates to.
      java.lang.String getName()
      Accessor for the key name.
      int getNumberOfColumns()
      Accessor for the number of columns.
      Table getTable()
      Accessor for the table
      int hashCode()
      Hashcode operator.
      void setColumn​(int seq, Column col)
      Sets a column in a specified position seq for this index.
      protected static void setListMinimumSize​(java.util.List<?> list, int size)  
      void setName​(java.lang.String name)
      Mutator for the key name.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
        Name of the key.
      • table

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

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

      • Key

        protected Key​(Table table)
        Constructor.
        Parameters:
        table - The table
    • Method Detail

      • setName

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

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

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

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

        public java.lang.String getColumnList()
        Accessor for the column list
        Returns:
        The column list
      • getNumberOfColumns

        public int getNumberOfColumns()
        Accessor for the number of columns.
        Returns:
        The number of columns.
      • addColumn

        public void addColumn​(Column col)
        Class to add a column to the key
        Parameters:
        col - The column to add
      • 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
      • 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 java.lang.Object
        Returns:
        The hashcode
      • equals

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

        protected static void setListMinimumSize​(java.util.List<?> list,
                                                 int size)
      • getColumnList

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