public abstract class Synthese extends java.lang.Object implements NormalizationAlgorithm
Constructor and Description |
---|
Synthese() |
Modifier and Type | Method and Description |
---|---|
protected RelationSchema |
getFullyContainedRelation(java.util.ArrayList<RelationSchema> schemata)
Returns one fully contained relation at a time
|
protected java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> |
getGroupsWithSameLeftSide(java.util.ArrayList<FunctionalDependency> fds)
Functional Depdendencies with the same left side get a own group
|
protected java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> |
getMutualDependentGroups(java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> groups)
Returns two mutual dependent Groups
|
protected int |
getNumberOfMatchingFds(RelationSchema schema1,
RelationSchema schema2)
Returns the number of matching fds of two relations
|
protected RelationSchema |
getSchemaFromFds(java.util.ArrayList<FunctionalDependency> fds)
Creates and returns a new RelationSchema from a given List of Fds
|
protected boolean |
isAnyRelationContainingAKey(java.util.ArrayList<RelationSchema> schemata,
java.util.ArrayList<Key> candidateKeys)
Looks up, if at least any of the relations contains a candidate
Key for everything
|
protected void |
uniteMutualDepdendentGroups(java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> groups)
Unites groups of fd's that are mutual dependent
|
void |
updatePrimaryAndForeignKeys(java.util.ArrayList<RelationSchema> relations,
java.util.ArrayList<ForeignKeyConstraint> foreignKeys)
Updates the primary- and foreignKeys of the given relations
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
normalize
protected void uniteMutualDepdendentGroups(java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> groups)
groups
- the groups of functional dependencies to work withprotected java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> getMutualDependentGroups(java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> groups)
groups
- the overall list of FunctionalDependencies to work withprotected RelationSchema getFullyContainedRelation(java.util.ArrayList<RelationSchema> schemata)
schemata
- all relationSchemata to work withprotected RelationSchema getSchemaFromFds(java.util.ArrayList<FunctionalDependency> fds)
fds
- the list of functional dependencies to work withprotected boolean isAnyRelationContainingAKey(java.util.ArrayList<RelationSchema> schemata, java.util.ArrayList<Key> candidateKeys)
schemata
- the ArrayList of Relations to search incandidateKeys
- the candidateKeys to look for in the relationsprotected java.util.ArrayList<java.util.ArrayList<FunctionalDependency>> getGroupsWithSameLeftSide(java.util.ArrayList<FunctionalDependency> fds)
fds
- the set of functional dependencies to work withprotected int getNumberOfMatchingFds(RelationSchema schema1, RelationSchema schema2)
schema1
- first relation to compareschema2
- second relation to comparepublic void updatePrimaryAndForeignKeys(java.util.ArrayList<RelationSchema> relations, java.util.ArrayList<ForeignKeyConstraint> foreignKeys)
relations
- the relations to work withforeignKeys
- the foreign keys to take into account