com.googlecode.jdbw.metadata
Class Index
java.lang.Object
com.googlecode.jdbw.metadata.Index
- All Implemented Interfaces:
- Comparable<Index>
public class Index
- extends Object
- implements Comparable<Index>
An index on a database is a kind of fast lookup-table over (usually) one or
(sometimes) more columns in a database table. By adding an index, we can
make searching for rows matching particular criteria a lot faster, since the
lookup table can be used instead of looking through every row.
This class represents such an index created on a database server. You
normally don't create instances of this class yourself, but get them by
asking a table to provide you with all the indexes that are created on this
table.
- Author:
- Martin Berglund
- See Also:
Table
|
Constructor Summary |
Index(String indexName,
boolean unique,
boolean clustered,
boolean primaryKey,
Table table,
Column firstColumn)
|
Index
public Index(String indexName,
boolean unique,
boolean clustered,
boolean primaryKey,
Table table,
Column firstColumn)
addColumn
public void addColumn(Column column)
compareTo
public int compareTo(Index o)
- Specified by:
compareTo in interface Comparable<Index>
isClustered
public boolean isClustered()
getNrOfColumns
public int getNrOfColumns()
getColumnNames
public List<String> getColumnNames()
getColumns
public List<Column> getColumns()
getColumn
public Column getColumn(int index)
getName
public String getName()
isUnique
public boolean isUnique()
isPrimaryKey
public boolean isPrimaryKey()
getTable
public Table getTable()
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2012. All Rights Reserved.