jInfer

cz.cuni.mff.ksi.jinfer.functionalDependencies
Class TupleFactory

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.functionalDependencies.TupleFactory

public final class TupleFactory
extends Object

Support class responsible for creating and checking tree tuples.


Method Summary
static List<Tuple> createTuples(RXMLTree tree)
          Create all tuples for particular tree.
static List<PathAnswer> getFDSidePathAnswers(RXMLTree tree, Tuple tuple, SidePaths sidePaths, boolean isThesis)
          Get list of path answers of particular side of functional dependency of particular tuple.
static List<Pair<Tuple,Tuple>> getTuplePairNotSatisfyingFD(RXMLTree tree, FD fd)
          Get all tuple pairs which not satisfies provided functional dependency.
static List<Pair<Tuple,Tuple>> getTuplePairNotSatisfyingFDThesis(RXMLTree tree, FD fd)
          Get all tuple pairs which not satisfies provided functional dependency.
static List<Pair<Tuple,Tuple>> getTuplePairs(List<Tuple> tuples)
          Get all possible pair of provided tuples.
static boolean isTuple(RXMLTree tree, Tuple tuple)
          Check if provided tuple is a tree tuple.
static void removeTuple(RXMLTree tree, Tuple tuple)
          Removes tuple from tree.
static void removeTuples(RXMLTree tree, Set<Tuple> tuplesToRemove)
          Remove all tuples provided in a set from tree.
static Collection<Tuple> unmarkNodeFromAllTuples(RXMLTree tree, Node node)
          Unmark particular node from all tuples it is part of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isTuple

public static boolean isTuple(RXMLTree tree,
                              Tuple tuple)
Check if provided tuple is a tree tuple.

Parameters:
tree - Tree over which is tuple defined.
tuple - Tuple to be checked.
Returns:
true if tuple is tree tuple.

removeTuple

public static void removeTuple(RXMLTree tree,
                               Tuple tuple)
Removes tuple from tree. Also unmark nodes from tuple.

Parameters:
tree - Tree from which is tuple removed.
tuple - Tuple to be removed.

removeTuples

public static void removeTuples(RXMLTree tree,
                                Set<Tuple> tuplesToRemove)
Remove all tuples provided in a set from tree.

Parameters:
tree - Tree from which are tuples removed.
tuplesToRemove - Set of tuples to be removed.

createTuples

public static List<Tuple> createTuples(RXMLTree tree)
                                throws InterruptedException
Create all tuples for particular tree.

Parameters:
tree - Tree for which to create tuples.
Returns:
List of all created tuples.
Throws:
InterruptedException - if user interrupted repairing.

getTuplePairs

public static List<Pair<Tuple,Tuple>> getTuplePairs(List<Tuple> tuples)
                                             throws InterruptedException
Get all possible pair of provided tuples.

Parameters:
tuples - List of tuples from which are pairs created.
Returns:
List of pairs of tuples.
Throws:
InterruptedException - if user interrupted repairing.

getTuplePairNotSatisfyingFDThesis

public static List<Pair<Tuple,Tuple>> getTuplePairNotSatisfyingFDThesis(RXMLTree tree,
                                                                        FD fd)
                                                                 throws InterruptedException
Get all tuple pairs which not satisfies provided functional dependency. This method is suitable for thesis algorithm.

Parameters:
tree - Tree over which are tuples defined.
fd - Functional dependency for which is checking satisfaction.
Returns:
List of all pairs that do not satisfy functional dependency.
Throws:
InterruptedException - if user interrupted repairing.

getTuplePairNotSatisfyingFD

public static List<Pair<Tuple,Tuple>> getTuplePairNotSatisfyingFD(RXMLTree tree,
                                                                  FD fd)
                                                           throws InterruptedException
Get all tuple pairs which not satisfies provided functional dependency.

Parameters:
tree - Tree over which are tuples defined.
fd - Functional dependency for which is checking satisfaction.
Returns:
List of all pairs that do not satisfy functional dependency.
Throws:
InterruptedException - if user interrupted repairing.

getFDSidePathAnswers

public static List<PathAnswer> getFDSidePathAnswers(RXMLTree tree,
                                                    Tuple tuple,
                                                    SidePaths sidePaths,
                                                    boolean isThesis)
Get list of path answers of particular side of functional dependency of particular tuple.

Parameters:
tree - Tree over which is tuple defined.
tuple - Tuple for which is get answers.
sidePaths - Side of functional dependency for which is get answers.
isThesis - flag indicating if thesis algorithm is used.
Returns:
List of path answers of particular side.

unmarkNodeFromAllTuples

public static Collection<Tuple> unmarkNodeFromAllTuples(RXMLTree tree,
                                                        Node node)
Unmark particular node from all tuples it is part of.

Parameters:
tree - Tree from which node is.
node - Node wich is removed from all tuples.
Returns:
Collection of tuples which the node was associated with.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011