de.fesenmeyer.dbnormalizer.core
Class Key

java.lang.Object
  extended by de.fesenmeyer.dbnormalizer.core.AbstractDBItem
      extended by de.fesenmeyer.dbnormalizer.core.Key
Direct Known Subclasses:
CandKey, PK

public abstract class Key
extends AbstractDBItem

Abstract base class for keys of a table. The attributes the key consists of are represented as a list, not as a set, because the order of the attributes is not arbitrary for a key. For example, when defining a foreign key (FK), the order of the referenced table's PK attributes must be considered.

Author:
DF

Field Summary
private  List<String> attributes
          The attributes this key consists of.
 
Constructor Summary
Key()
          Class Constructor.
 
Method Summary
 List<String> getAttributes()
          Gets the attributes this key consists of.
 void setAttributes(List<String> attributes)
          Sets the attributes this key consists of.
 String toString()
          Overridden method which returns an appropriate string representation of this key.
 
Methods inherited from class de.fesenmeyer.dbnormalizer.core.AbstractDBItem
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

private List<String> attributes
The attributes this key consists of.

Constructor Detail

Key

public Key()
Class Constructor.

Method Detail

getAttributes

public List<String> getAttributes()
Gets the attributes this key consists of.

Returns:
the attributes

setAttributes

public void setAttributes(List<String> attributes)
Sets the attributes this key consists of.

Parameters:
attributes - the attributes

toString

public String toString()
Overridden method which returns an appropriate string representation of this key.

Overrides:
toString in class AbstractDBItem
Returns:
the string representation of this key