uk.ac.ic.doc.automed.reps
Class HDMTransformations

java.lang.Object
  extended by uk.ac.ic.doc.automed.reps.HDMTransformations

public class HDMTransformations
extends java.lang.Object

Author:
Andrew Smith - acs203 This class provides methods to do some transformations within the HDM model

Constructor Summary
HDMTransformations(Schema sourceSchema)
          Creates a new instance of HDMTransformations
 
Method Summary
 Schema idNodeExpand(SchemaObject expandNode)
          The reverse of an id node merge.
 Schema idNodeMerge(SchemaObject edgeObject)
          ID node merge.
 Schema inclusionExpand(SchemaObject nodeB, SchemaObject edgeObject)
          Inclusion expand transformation
 Schema inclusionMerge(SchemaObject nodeB, SchemaObject edgeObject)
          Inclusion merge transformation
 Schema moveInclusion(SchemaObject sourceNode, SchemaObject targetNode)
          Move an inclusion constraint between 2 identical nodes
 Schema nodeReidentify(SchemaObject nodeObject, SchemaObject mapObject)
          Node reidentify
 Schema removeRecursion(SchemaObject parentObject, SchemaObject nodeObject, java.lang.String nodeName, java.lang.String containerName)
          Remove recursion
 void setSchema(Schema schema)
          Set the schema for this object
 Schema uMRedirection(SchemaObject edgeObject, SchemaObject mapObject)
          Unique Mandatory redirection
static UserActionResult userActionNodeReidentify(Gui g, java.lang.Object[] o)
          The user action to do a node reidentify
static UserActionResult userActionRemoveRecursion(Gui g, java.lang.Object[] o)
          The user action to do a node reidentify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDMTransformations

public HDMTransformations(Schema sourceSchema)
                   throws NotFoundException
Creates a new instance of HDMTransformations

Throws:
NotFoundException
Method Detail

setSchema

public void setSchema(Schema schema)
Set the schema for this object


moveInclusion

public Schema moveInclusion(SchemaObject sourceNode,
                            SchemaObject targetNode)
                     throws AutoMedException
Move an inclusion constraint between 2 identical nodes

Parameters:
sourceNode - - The source node
targetNode - - The target node
Returns:
The transformed schema
Throws:
AutoMedException

idNodeMerge

public Schema idNodeMerge(SchemaObject edgeObject)
                   throws AutoMedException
ID node merge. This transformation merges two nodes whose extents have a 1-1 correspondence.

Parameters:
edgeObject - The edge linking the two nodes we're going to merge
Returns:
The transformed schema
Throws:
AutoMedException

idNodeExpand

public Schema idNodeExpand(SchemaObject expandNode)
                    throws AutoMedException
The reverse of an id node merge. This creates a new node with the same extent as @param expandNode and an edge linking them

Parameters:
expandNode - is the node we want to expand
Returns:
The transformed schema
Throws:
AutoMedException

inclusionMerge

public Schema inclusionMerge(SchemaObject nodeB,
                             SchemaObject edgeObject)
                      throws AutoMedException
Inclusion merge transformation

Throws:
AutoMedException

inclusionExpand

public Schema inclusionExpand(SchemaObject nodeB,
                              SchemaObject edgeObject)
                       throws AutoMedException
Inclusion expand transformation

Throws:
AutoMedException

uMRedirection

public Schema uMRedirection(SchemaObject edgeObject,
                            SchemaObject mapObject)
                     throws AutoMedException
Unique Mandatory redirection

Throws:
AutoMedException

nodeReidentify

public Schema nodeReidentify(SchemaObject nodeObject,
                             SchemaObject mapObject)
                      throws AutoMedException
Node reidentify

Parameters:
nodeObject - is the node we wish to reidentify. This means change it's extent
mapObject - is the object we will use to get the new extent of nodeObject. In this case it's the edge linking nodeObject to the node that holds the new extent of nodeObject. The type of nodeObject will become that of the linked node
Throws:
AutoMedException

removeRecursion

public Schema removeRecursion(SchemaObject parentObject,
                              SchemaObject nodeObject,
                              java.lang.String nodeName,
                              java.lang.String containerName)
                       throws AutoMedException
Remove recursion

Parameters:
nodeObject - is the recursive node
mapObject - is the parent of the recursive node The type of nodeObject will become that of the linked node Expand a structure with more than one parent We need to create a new node that will serve as a parent to the multi parent node The extent of this node will be the union of the parent nodes. We also add an edge from the multiparent node to the new parent node We also need to remove the edges to all the original parents and replace them with inclusion constraints.
Throws:
AutoMedException

userActionNodeReidentify

public static UserActionResult userActionNodeReidentify(Gui g,
                                                        java.lang.Object[] o)
The user action to do a node reidentify


userActionRemoveRecursion

public static UserActionResult userActionRemoveRecursion(Gui g,
                                                         java.lang.Object[] o)
The user action to do a node reidentify