| java.lang.Object org.apache.torque.engine.database.model.Index
All known Subclasses: org.apache.torque.engine.database.model.Unique,
Index | public class Index (Code) | | Information about indices of a table.
author: Jason van Zyl author: Greg Monroe version: $Id: Index.java 473814 2006-11-11 22:30:30Z tv $ |
Constructor Summary | |
public | Index() Creates a new instance with default characteristics (no name or
parent table, small column list size allocation, non-unique). | protected | Index(Table table, List indexColumns) Creates a new instance for the list of columns composing an
index. |
Method Summary | |
public void | addColumn(Attributes attrib) Adds a new column to an index. | public void | addOption(String key, String value) Add an XML Specified option key/value pair to this element's option set. | public String | getColumnList() Return a comma delimited string of the columns which compose this index. | protected List | getColumnNames() Returns the list of names of the columns referenced by this
index. | public List | getColumns() Return the list of local columns. | public String | getName() Gets the name of this index. | public String | getOption(String key) Get the value that was associated with this key in an XML option
element.
Parameters: key - the key of the option. | public Map | getOptions() Gets the full ordered hashtable array of items specified by XML option
statements under this element.
Note, this is not thread save but since it's only used for
generation which is single threaded, there should be minimum
danger using this in Velocity.
An Map of all options. | public Table | getTable() | public String | getTableName() | public boolean | isUnique() Returns the uniqueness of this index. | public void | loadFromXML(Attributes attrib) | public void | setName(String name) Set the name of this index. | public void | setTable(Table parent) | public String | toString() String representation of the index. |
Index | public Index()(Code) | | Creates a new instance with default characteristics (no name or
parent table, small column list size allocation, non-unique).
|
addColumn | public void addColumn(Attributes attrib)(Code) | | Adds a new column to an index.
Parameters: attrib - xml attributes for the column |
addOption | public void addOption(String key, String value)(Code) | | Add an XML Specified option key/value pair to this element's option set.
Parameters: key - the key of the option. Parameters: value - the value of the option. |
getColumnList | public String getColumnList()(Code) | | Return a comma delimited string of the columns which compose this index.
a list of column names |
getColumnNames | protected List getColumnNames()(Code) | | 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.
a list of column names |
getColumns | public List getColumns()(Code) | | Return the list of local columns. You should not edit this list.
a list of columns |
getName | public String getName()(Code) | | Gets the name of this index.
the name of this index |
getOption | public String getOption(String key)(Code) | | Get the value that was associated with this key in an XML option
element.
Parameters: key - the key of the option. The value for the key or a null. |
getOptions | public Map getOptions()(Code) | | Gets the full ordered hashtable array of items specified by XML option
statements under this element.
Note, this is not thread save but since it's only used for
generation which is single threaded, there should be minimum
danger using this in Velocity.
An Map of all options. Will not be null but may be empty. |
getTable | public Table getTable()(Code) | | Get the parent Table of the index
the table |
getTableName | public String getTableName()(Code) | | Returns the Name of the table the index is in
the name of the table |
isUnique | public boolean isUnique()(Code) | | Returns the uniqueness of this index.
the uniqueness of this index |
loadFromXML | public void loadFromXML(Attributes attrib)(Code) | | Imports index from an XML specification
Parameters: attrib - the xml attributes |
setName | public void setName(String name)(Code) | | Set the name of this index.
Parameters: name - the name of this index |
setTable | public void setTable(Table parent)(Code) | | Set the parent Table of the index
Parameters: parent - the table |
toString | public String toString()(Code) | | String representation of the index. This is an xml representation.
a xml representation |
|
|