jInfer

cz.cuni.mff.ksi.jinfer.functionalDependencies.repairer
Class RepairImpl

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.functionalDependencies.repairer.RepairImpl
All Implemented Interfaces:
Repair, Comparable<RepairImpl>

public class RepairImpl
extends Object
implements Repair, Comparable<RepairImpl>

Implementation of the Repair interface for the original algorithm.


Field Summary
static int COMPARE_EQUAL
           
static int COMPARE_GREATER
           
static int COMPARE_SMALLER
           
static int COMPARE_UNAVAILABLE
           
 
Constructor Summary
RepairImpl()
          Default constructor.
RepairImpl(Node unreliableNode)
          Constructor creating repair that mark node as unreliable.
RepairImpl(Node valueNode, String changedValue, boolean isNewValue)
          Constructor creating a repair that modifies node value.
 
Method Summary
 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.
 int compareTo(RepairImpl repair)
          Compare this Repair with repair in parameter and returns -1, 0, 1 or 2 if this repair is smaller, equal, greater or unable to comapre with another repair.
 boolean equals(Object obj)
           
 Collection<Node> getFalseNodes()
          Get all nodes that have been marked as unreliable.
 Collection<Node> getModifiedNodes()
          Get all nodes that have been marked as unreliable and the value have been changed.
 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.
 Collection<Node> getUpdatedNodes()
          Get all nodes that the value is changed.
 Map<Node,NodeValue> getValueNodes()
          Get map of all nodes and theirs new values that have been modified by this repair.
 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/
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARE_SMALLER

public static final int COMPARE_SMALLER
See Also:
Constant Field Values

COMPARE_EQUAL

public static final int COMPARE_EQUAL
See Also:
Constant Field Values

COMPARE_GREATER

public static final int COMPARE_GREATER
See Also:
Constant Field Values

COMPARE_UNAVAILABLE

public static final int COMPARE_UNAVAILABLE
See Also:
Constant Field Values
Constructor Detail

RepairImpl

public RepairImpl()
Default constructor.


RepairImpl

public RepairImpl(Node unreliableNode)
Constructor creating repair that mark node as unreliable.

Parameters:
unreliableNode - Node to be marked as unreliable.

RepairImpl

public RepairImpl(Node valueNode,
                  String changedValue,
                  boolean isNewValue)
Constructor creating a repair that modifies node value.

Parameters:
valueNode - Node to be modified.
changedValue - New value of the node.
isNewValue - flag indicating that the value is newly 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.

compareTo

public int compareTo(RepairImpl repair)
Compare this Repair with repair in parameter and returns -1, 0, 1 or 2 if this repair is smaller, equal, greater or unable to comapre with another repair.

Specified by:
compareTo in interface Comparable<RepairImpl>
Parameters:
repair - The repair with compare to.
Returns:

getUpdatedNodes

public Collection<Node> getUpdatedNodes()
Get all nodes that the value is changed.

Returns:
Collection of all nodes that the value is changed.

getFalseNodes

public Collection<Node> getFalseNodes()
Get all nodes that have been marked as unreliable.

Returns:
Collection of all nodes that have been marked as unreliable.

getModifiedNodes

public Collection<Node> getModifiedNodes()
Get all nodes that have been marked as unreliable and the value have been changed.

Returns:
Collection of all nodes that have been marked as unreliable and the value have been changed.

toString

public String toString()
Overrides:
toString in class Object

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.

jInfer

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