SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.jdbc.schema
Class Index

java.lang.Object
  |
  +--kodo.jdbc.schema.ReferenceCounter
        |
        +--kodo.jdbc.schema.Constraint
              |
              +--kodo.jdbc.schema.Index

public class Index
extends Constraint

Represents a database index. This class is closely alligned with the index information available from DatabaseMetaData.


Constructor Summary
Index()
          Default constructor.
Index(String name, Table table)
          Constructor.
 
Method Summary
 void addColumn(Column col)
          Add a column to the index.
 boolean columnsMatch(Column[] idxCols)
          Return true if the given columns match the columns of this index.
 int compareTo(Object other)
          Order on name.
 boolean containsColumn(Column col)
          Return true if the index includes the given column.
 boolean equalsIndex(Index idx)
          Indexes are equal if they have the same name, the same columns, and are both unique/not unique.
 Column[] getColumns()
          Return all the columns the index spans.
 String getFullName()
          Return the index name, including schema.
 boolean isLogical()
          Return whether this constraint is a logical constraint only; i.e.
 boolean isUnique()
          Return true if this is a UNIQUE index.
 boolean removeColumn(Column col)
          Remove a column from the index.
 void setColumns(Column[] cols)
          Set the index's columns.
 void setUnique(boolean unique)
          Set whether this is a UNIQUE index.
 String toString()
          Returns the index name.
 
Methods inherited from class kodo.jdbc.schema.Constraint
deref, getColumnName, getName, getRefCount, getSchemaName, getTable, getTableName, isDeferred, ref, setColumnName, setDeferred, setName, setSchemaName, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Index

public Index()
Default constructor.

Index

public Index(String name,
             Table table)
Constructor.
Parameters:
name - the name of the index
table - the table of the index
Method Detail

isLogical

public boolean isLogical()
Description copied from class: Constraint
Return whether this constraint is a logical constraint only; i.e. if it does not exist in the database.
Overrides:
isLogical in class Constraint

getFullName

public String getFullName()
Return the index name, including schema.
Overrides:
getFullName in class Constraint

isUnique

public boolean isUnique()
Return true if this is a UNIQUE index.

setUnique

public void setUnique(boolean unique)
Set whether this is a UNIQUE index.

getColumns

public Column[] getColumns()
Return all the columns the index spans.

setColumns

public void setColumns(Column[] cols)
Set the index's columns.

addColumn

public void addColumn(Column col)
Add a column to the index.

removeColumn

public boolean removeColumn(Column col)
Remove a column from the index.
Returns:
true if the column was removed, false if not part of the index

containsColumn

public boolean containsColumn(Column col)
Return true if the index includes the given column.

compareTo

public int compareTo(Object other)
Order on name.

toString

public String toString()
Returns the index name.
Overrides:
toString in class Constraint

equalsIndex

public boolean equalsIndex(Index idx)
Indexes are equal if they have the same name, the same columns, and are both unique/not unique.

columnsMatch

public boolean columnsMatch(Column[] idxCols)
Return true if the given columns match the columns of this index.

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.