jInfer

cz.cuni.mff.ksi.jinfer.functionalDependencies.newRepairer
Class RepairCandidate

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.functionalDependencies.newRepairer.RepairCandidate
All Implemented Interfaces:
Repair

public class RepairCandidate
extends Object
implements Repair

Implementation of the Repair interface for the thesis algorithm. This class represents repair candidate.


Constructor Summary
RepairCandidate(Pair<Tuple,Tuple> tuplePair)
          Constructor of the repair candidate.
RepairCandidate(Pair<Tuple,Tuple> tuplePair, Node unreliableNode, RXMLTree tree, double coeffK, String path)
          This constructor creates a repair candidate which marks provided node as unreliable.
RepairCandidate(Pair<Tuple,Tuple> tuplePair, Node valueNode, String changedValue, RXMLTree tree, double coeffK, String path, boolean isNewValue)
          This constructor creates a repair candidate which modifies node value.
 
Method Summary
 void addToRepairGroup(RepairGroup repairGroup)
          Adds this candidate to the provided repair group.
 void addUnreliableNode(Node node)
          Add node that will be marked as unreliable by this repair.
 void addUnreliableNodes(Set<Node> nodes)
          Add set of nodes that will be marked as unreliable by this repair.
 void addValueNode(Node node, NodeValue value)
          Add node and the new node value to this repair.
 boolean equals(Object obj)
           
 String getContentAfterRepair()
          Get the string representation of the modified part of the tree by this repair.
 FD getFD()
          Get functional dependency this candidate is repairing validation for.
 Collection<String> getNodePaths()
          Get paths of all nodes that are modified by this candidate.
 int getNodeSize()
          Get number of nodes this repair is modifying.
 Pair<Tuple,Tuple> getTuplePair()
          Get tuple pair this candidate is defined for.
 Node getUnreliableNode()
          Get the root node which was marked as unreliable by this repair.
 Set<Node> getUnreliableNodes()
          Get set of all nodes marked as unreliable by this repair.
 Map<Node,NodeValue> getValueNodes()
          Get map of all nodes and theirs new values that have been modified by this repair.
 double getWeight()
          Get weight of the repair candidate.
 int hashCode()
           
 boolean hasReliabilityRepair()
          Check if this repair contains reliability modification of the XML tree node.
 boolean hasValueRepair()
          Check ig this repair contains value modification of the XML tree node.
 boolean isNewValue(Node node)
          Check if provided node value is modified to the newly generated one/
 void setWeight(double weight)
          Set weight of the repair candidate.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepairCandidate

public RepairCandidate(Pair<Tuple,Tuple> tuplePair)
Constructor of the repair candidate. Provided argument represents tuple pair for which is this candidate created.

Parameters:
tuplePair - Tuple pair for which is this candidate created.

RepairCandidate

public RepairCandidate(Pair<Tuple,Tuple> tuplePair,
                       Node unreliableNode,
                       RXMLTree tree,
                       double coeffK,
                       String path)
This constructor creates a repair candidate which marks provided node as unreliable.

Parameters:
tuplePair - Tuple pair for which is this candidate created.
unreliableNode - Node to be marked as unreliable.
tree - Tree for which is candidate created.
coeffK - coefficient k from thesis algorithm.
path - Path of the modified node for user selection purpose.

RepairCandidate

public RepairCandidate(Pair<Tuple,Tuple> tuplePair,
                       Node valueNode,
                       String changedValue,
                       RXMLTree tree,
                       double coeffK,
                       String path,
                       boolean isNewValue)
This constructor creates a repair candidate which modifies node value.

Parameters:
tuplePair - Tuple pair for which is this candidate created.
valueNode - Node to be modified.
changedValue - New value of the modified node.
tree - Tree for which is candidate created.
coeffK - coefficient k from thesis algorithm.
path - Path of the modified node for user selection purpose.
isNewValue - flag indicating if the new value is generated.
Method Detail

hasReliabilityRepair

public boolean hasReliabilityRepair()
Description copied from interface: Repair
Check if this repair contains reliability modification of the XML tree node.

Specified by:
hasReliabilityRepair in interface Repair
Returns:
true if contains reliability modification.

getUnreliableNodes

public Set<Node> getUnreliableNodes()
Description copied from interface: Repair
Get set of all nodes marked as unreliable by this repair. If this repair is not a reliability repair, empty set is returned.

Specified by:
getUnreliableNodes in interface Repair
Returns:
Set of all nodes marked as unreliable.

getUnreliableNode

public Node getUnreliableNode()
Description copied from interface: Repair
Get the root node which was marked as unreliable by this repair. If this repair is not a reliability repair, null is returned.

Specified by:
getUnreliableNode in interface Repair
Returns:
The root node which is marked as unreliable.

getValueNodes

public Map<Node,NodeValue> getValueNodes()
Description copied from interface: Repair
Get map of all nodes and theirs new values that have been modified by this repair. If this repair is not a value repair, empty map is returned.

Specified by:
getValueNodes in interface Repair
Returns:
Map of all nodes and theirs new values.

addUnreliableNodes

public void addUnreliableNodes(Set<Node> nodes)
Description copied from interface: Repair
Add set of nodes that will be marked as unreliable by this repair.

Specified by:
addUnreliableNodes in interface Repair
Parameters:
nodes - Set of nodes to be marked as unreliable.

hasValueRepair

public boolean hasValueRepair()
Description copied from interface: Repair
Check ig this repair contains value modification of the XML tree node.

Specified by:
hasValueRepair in interface Repair
Returns:
true if contains value modification.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

addUnreliableNode

public void addUnreliableNode(Node node)
Description copied from interface: Repair
Add node that will be marked as unreliable by this repair.

Specified by:
addUnreliableNode in interface Repair
Parameters:
node - Node to be marked as unreliable.

addValueNode

public void addValueNode(Node node,
                         NodeValue value)
Description copied from interface: Repair
Add node and the new node value to this repair.

Specified by:
addValueNode in interface Repair
Parameters:
node - Node to be changed by this repair.
value - New value of the changed node.

toString

public String toString()
Overrides:
toString in class Object

setWeight

public void setWeight(double weight)
Set weight of the repair candidate.

Parameters:
weight - Weight to be set.

getWeight

public double getWeight()
Get weight of the repair candidate.

Returns:
Weight of the repair candidate.

addToRepairGroup

public void addToRepairGroup(RepairGroup repairGroup)
Adds this candidate to the provided repair group.

Parameters:
repairGroup - Repair group to be added this candidate.

getContentAfterRepair

public String getContentAfterRepair()
                             throws InterruptedException
Get the string representation of the modified part of the tree by this repair.

Returns:
String representation of the modified part.
Throws:
InterruptedException

getNodePaths

public Collection<String> getNodePaths()
Get paths of all nodes that are modified by this candidate.

Returns:
Collection of paths of all nodes modified by this candidate.

getFD

public FD getFD()
Get functional dependency this candidate is repairing validation for.

Returns:
Functional dependency this candidate is repairing validation for.

getNodeSize

public int getNodeSize()
Get number of nodes this repair is modifying.

Returns:
Number of nodes this repair is modifying.

isNewValue

public boolean isNewValue(Node node)
Description copied from interface: Repair
Check if provided node value is modified to the newly generated one/

Specified by:
isNewValue in interface Repair
Parameters:
node - Node to be checked if its new value is generated.
Returns:
true if node has newly generated value.

getTuplePair

public Pair<Tuple,Tuple> getTuplePair()
Get tuple pair this candidate is defined for.

Returns:
Tuple pair this candidate is defined for.

jInfer

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