ch.sahits.model.db
Class DataBaseTableIndex

java.lang.Object
  extended by ch.sahits.model.db.DataBaseTableIndex

public class DataBaseTableIndex
extends java.lang.Object

This class represents a database index

Since:
0.9.0
Author:
Andi Hotz

Constructor Summary
DataBaseTableIndex()
          Default constructor
DataBaseTableIndex(java.lang.String _indexName)
          Constructor initializing the index name
 
Method Summary
 void addField(DataBaseTableField field)
          Add a field to the fields
 boolean contains(DataBaseTableField field)
          Check wether a field is contained in this index
 boolean contains(java.lang.String fieldName)
          Check if the field is part of the index
 boolean equals(java.lang.Object obj)
          Two indices are equal when they have the same type, the same name and the same fields
 java.util.List<DataBaseTableField> getFields()
          Retrieve the fields of this index
 EDBIndexConstrains getIndexConstrains()
          Retrieve the constraint of the index
 java.lang.String getIndexName()
          Retrieve the name of the index
 IDataBaseTable getTable()
          Retrieves the table object this index belongs to
 int hashCode()
           
 void setFieldAt(int i, DataBaseTableField field)
          Add a field to the fields at position i
 void setFields(java.util.List<DataBaseTableField> _fields)
          Set the fields of this index
 void setIndexConstrains(EDBIndexConstrains _indexConstrains)
          Set the index constraint
 void setIndexName(java.lang.String _indexName)
          Set the name of the index
 void setTable(IDataBaseTable _table)
          Set the table object
 java.lang.String toString()
          Convert this object into a string representations
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataBaseTableIndex

public DataBaseTableIndex()
Default constructor


DataBaseTableIndex

public DataBaseTableIndex(java.lang.String _indexName)
Constructor initializing the index name

Parameters:
_indexName -
Method Detail

toString

public java.lang.String toString()
Convert this object into a string representations

Overrides:
toString in class java.lang.Object

getIndexConstrains

public EDBIndexConstrains getIndexConstrains()
Retrieve the constraint of the index

Returns:
index constraint

setIndexConstrains

public void setIndexConstrains(EDBIndexConstrains _indexConstrains)
Set the index constraint

Parameters:
_indexConstrains -

getTable

public IDataBaseTable getTable()
Retrieves the table object this index belongs to

Returns:
database table

setTable

public void setTable(IDataBaseTable _table)
Set the table object

Parameters:
_table - IDataBaseTable

getFields

public java.util.List<DataBaseTableField> getFields()
Retrieve the fields of this index

Returns:
fields of the index

setFields

public void setFields(java.util.List<DataBaseTableField> _fields)
Set the fields of this index

Parameters:
_fields - List of DataBaseTableField s

setFieldAt

public void setFieldAt(int i,
                       DataBaseTableField field)
Add a field to the fields at position i

Parameters:
i - position of where to add
field - DataBaseTableField to add

addField

public void addField(DataBaseTableField field)
Add a field to the fields

Parameters:
field - DataBaseTableField

getIndexName

public java.lang.String getIndexName()
Retrieve the name of the index

Returns:
name of the index

setIndexName

public void setIndexName(java.lang.String _indexName)
Set the name of the index

Parameters:
_indexName -

contains

public boolean contains(java.lang.String fieldName)
Check if the field is part of the index

Parameters:
fieldName - name of the field
Returns:
true if the field is part of the index

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Two indices are equal when they have the same type, the same name and the same fields

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

contains

public boolean contains(DataBaseTableField field)
Check wether a field is contained in this index

Parameters:
field - to be checked
Returns:
true if the field is contained
See Also:
DataBaseTableField.equals(Object)