de.fesenmeyer.dbnormalizer.core
Class FD

java.lang.Object
  extended by de.fesenmeyer.dbnormalizer.core.AbstractDBItem
      extended by de.fesenmeyer.dbnormalizer.core.FD
All Implemented Interfaces:
Comparable<FD>

public class FD
extends AbstractDBItem
implements Comparable<FD>

This class represents a Functional Dependency (FD). A FD consists of a LHS (left hand side) and RHS (right hand side) of attributes. Furthermore it has a state, which specifies, if the FD has been checked, and if it has been checked, if the associated table satisfies the FD. This state can be get and set by means of the getFdCheckState() and setFdCheckState(FDCheckState) methods.

Author:
DF

Field Summary
private  FDCheckState fdCheckState
          The check state of this FD.
private  AttributeStringSet LHS
          The LHS of this FD.
private  AttributeStringSet RHS
          The RHS of this FD.
 
Constructor Summary
FD()
           
 
Method Summary
 int compareTo(FD fd)
          Compares this FD to another FD, based on the toString() method.
 FD copy()
          Makes a deep copy of this FD.
 FDCheckState getFdCheckState()
          Gets the check state of this FD.
 AttributeStringSet getLHS()
          Gets the LHS.
 AttributeStringSet getRHS()
          Gets the RHS.
 void setFdCheckState(FDCheckState fdCheckState)
          Sets the check state of this FD
 void setLHS(AttributeStringSet lhs)
          Sets the LHS.
 void setRHS(AttributeStringSet rhs)
          Sets the RHS.
 String toString()
          Overridden method, mainly for debugging purposes.
 
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

fdCheckState

private FDCheckState fdCheckState
The check state of this FD.


LHS

private AttributeStringSet LHS
The LHS of this FD.


RHS

private AttributeStringSet RHS
The RHS of this FD.

Constructor Detail

FD

public FD()
Method Detail

getLHS

public AttributeStringSet getLHS()
Gets the LHS.

Returns:
the LHS

setLHS

public void setLHS(AttributeStringSet lhs)
Sets the LHS.

Parameters:
lhs - the LHS

getRHS

public AttributeStringSet getRHS()
Gets the RHS.

Returns:
the RHS

setRHS

public void setRHS(AttributeStringSet rhs)
Sets the RHS.

Parameters:
rhs - the RHS

toString

public String toString()
Overridden method, mainly for debugging purposes. Creates a String such as [A,B] -> [C].

Overrides:
toString in class AbstractDBItem
Returns:
the String describing this FD.

compareTo

public int compareTo(FD fd)
Compares this FD to another FD, based on the toString() method.

Specified by:
compareTo in interface Comparable<FD>
Parameters:
fd - the FD to which this FD should be compared

copy

public FD copy()
Makes a deep copy of this FD.

Returns:
the deep copy of this FD

getFdCheckState

public FDCheckState getFdCheckState()
Gets the check state of this FD.

Returns:
the check state of this FD

setFdCheckState

public void setFdCheckState(FDCheckState fdCheckState)
Sets the check state of this FD

Parameters:
fdCheckState - the check state of this FD