org.apache.ddlutils.model
Class NonUniqueIndex

java.lang.Object
  extended byorg.apache.ddlutils.model.NonUniqueIndex
All Implemented Interfaces:
Cloneable, Index, Serializable
Direct Known Subclasses:
UniqueIndex

public class NonUniqueIndex
extends Object
implements Index

Represents an index definition for a table.

Version:
$Revision: 289996 $
Author:
Thomas Dudziak
See Also:
Serialized Form

Field Summary
protected  ArrayList _columns
          The columns making up the index.
protected  String _name
          The name of the index.
 
Constructor Summary
NonUniqueIndex()
           
 
Method Summary
 void addColumn(IndexColumn column)
          Adds a column that makes up this index.
protected  Object clone()
          
 boolean equals(Object obj)
          
 IndexColumn getColumn(int idx)
          Returns the indicated column making up this index.
 int getColumnCount()
          Returns the number of columns that make up this index.
 IndexColumn[] getColumns()
          Returns the columns that make up this index.
 String getName()
          Returns the name of the index.
 int hashCode()
          
 boolean isUnique()
          Determines whether this index is unique or not.
 void removeColumn(IndexColumn column)
          Removes the given index column from this index.
 void removeColumn(int idx)
          Removes the column at the specified position in this index.
 void setName(String name)
          Sets the name of the index.
 String toString()
          
 String toVerboseString()
          Returns a verbose string representation of this index.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected String _name
The name of the index.


_columns

protected ArrayList _columns
The columns making up the index.

Constructor Detail

NonUniqueIndex

public NonUniqueIndex()
Method Detail

isUnique

public boolean isUnique()
Determines whether this index is unique or not.

Specified by:
isUnique in interface Index
Returns:
true if the index is an unique one

getName

public String getName()
Returns the name of the index.

Specified by:
getName in interface Index
Returns:
The name

setName

public void setName(String name)
Sets the name of the index.

Specified by:
setName in interface Index
Parameters:
name - The name

getColumnCount

public int getColumnCount()
Returns the number of columns that make up this index.

Specified by:
getColumnCount in interface Index
Returns:
The number of index columns

getColumn

public IndexColumn getColumn(int idx)
Returns the indicated column making up this index.

Specified by:
getColumn in interface Index
Parameters:
idx - The index of the column
Returns:
The column

getColumns

public IndexColumn[] getColumns()
Returns the columns that make up this index.

Specified by:
getColumns in interface Index
Returns:
The columns

addColumn

public void addColumn(IndexColumn column)
Adds a column that makes up this index.

Specified by:
addColumn in interface Index
Parameters:
column - The column to add

removeColumn

public void removeColumn(IndexColumn column)
Removes the given index column from this index.

Specified by:
removeColumn in interface Index
Parameters:
column - The column to remove

removeColumn

public void removeColumn(int idx)
Removes the column at the specified position in this index.

Specified by:
removeColumn in interface Index
Parameters:
idx - The position of the index column to remove

clone

protected Object clone()
                throws CloneNotSupportedException

Throws:
CloneNotSupportedException

equals

public boolean equals(Object obj)


hashCode

public int hashCode()


toString

public String toString()


toVerboseString

public String toVerboseString()
Returns a verbose string representation of this index.

Specified by:
toVerboseString in interface Index
Returns:
The string representation


Copyright © 2005 Apache Software Foundation. All Rights Reserved.