org.apache.torque.engine.database.model
Class Index

java.lang.Object
  extended byorg.apache.torque.engine.database.model.Index
Direct Known Subclasses:
Unique

public class Index
extends java.lang.Object

Information about indices of a table.

Version:
$Id: Index.java,v 1.20 2002/11/29 13:50:29 mpoeschl Exp $
Author:
Jason van Zyl,
Field Summary
private static boolean DEBUG
          enables debug output
private  java.util.List indexColumns
           
private  java.lang.String indexName
           
private  Table parentTable
           
 
Constructor Summary
  Index()
          Creates a new instance with default characteristics (no name or parent table, small column list size allocation, non-unique).
protected Index(Table table, java.util.List indexColumns)
          Creates a new instance for the list of columns composing an index.
 
Method Summary
 void addColumn(org.xml.sax.Attributes attrib)
          Adds a new column to an index.
private  void createName()
           
 java.lang.String getColumnList()
          Return a comma delimited string of the columns which compose this index.
protected  java.util.List getColumnNames()
          Returns the list of names of the columns referenced by this index.
 java.util.List getColumns()
          Return the list of local columns.
 java.lang.String getIndexColumnList()
          Deprecated. Use getColumnList() instead.
 java.util.List getIndexColumns()
          Deprecated. Use getColumns() instead.
 java.lang.String getIndexName()
          Deprecated. Use getName() instead.
 boolean getIsUnique()
          Deprecated. Use isUnique() instead.
 java.lang.String getName()
          Gets the name of this index.
 Table getTable()
          Get the parent Table of the index
 java.lang.String getTableName()
          Returns the Name of the table the index is in
 boolean isUnique()
          Returns the uniqueness of this index.
 void loadFromXML(org.xml.sax.Attributes attrib)
          Imports index from an XML specification
 void setIndexName(java.lang.String name)
          Deprecated. Use setName(String name) instead.
 void setName(java.lang.String name)
          Set the name of this index.
 void setTable(Table parent)
          Set the parent Table of the index
 java.lang.String toString()
          String representation of the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
enables debug output

See Also:
Constant Field Values

indexName

private java.lang.String indexName

parentTable

private Table parentTable

indexColumns

private java.util.List indexColumns
Constructor Detail

Index

public Index()
Creates a new instance with default characteristics (no name or parent table, small column list size allocation, non-unique).


Index

protected Index(Table table,
                java.util.List indexColumns)
         throws EngineException
Creates a new instance for the list of columns composing an index. Otherwise performs as Index().

Parameters:
table - The table this index is associated with.
indexColumns - The list of Column objects which make up this index. Cannot be empty.
Throws:
EngineException - Error generating name.
See Also:
Index()
Method Detail

createName

private void createName()
                 throws EngineException
Throws:
EngineException

loadFromXML

public void loadFromXML(org.xml.sax.Attributes attrib)
Imports index from an XML specification


getIsUnique

public boolean getIsUnique()
Deprecated. Use isUnique() instead.

See Also:
isUnique()

isUnique

public boolean isUnique()
Returns the uniqueness of this index.


getIndexName

public java.lang.String getIndexName()
Deprecated. Use getName() instead.

See Also:
getName()

getName

public java.lang.String getName()
Gets the name of this index.


setIndexName

public void setIndexName(java.lang.String name)
Deprecated. Use setName(String name) instead.

See Also:
setName(String name)

setName

public void setName(java.lang.String name)
Set the name of this index.


setTable

public void setTable(Table parent)
Set the parent Table of the index


getTable

public Table getTable()
Get the parent Table of the index


getTableName

public java.lang.String getTableName()
Returns the Name of the table the index is in


addColumn

public void addColumn(org.xml.sax.Attributes attrib)
Adds a new column to an index.


getIndexColumnList

public java.lang.String getIndexColumnList()
Deprecated. Use getColumnList() instead.

See Also:
getColumnList()

getColumnList

public java.lang.String getColumnList()
Return a comma delimited string of the columns which compose this index.


getIndexColumns

public java.util.List getIndexColumns()
Deprecated. Use getColumns() instead.

See Also:
getColumns()

getColumns

public java.util.List getColumns()
Return the list of local columns. You should not edit this list.


getColumnNames

protected java.util.List getColumnNames()
Returns the list of names of the columns referenced by this index. Slightly over-allocates the list's buffer (just in case more elements are going to be added, such as when a name is being generated). Feel free to modify this list.


toString

public java.lang.String toString()
String representation of the index. This is an xml representation.



Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.