uk.ac.ic.doc.automed.tml
Class TML

java.lang.Object
  extended by uk.ac.ic.doc.automed.tml.TML
Direct Known Subclasses:
TempTML

public class TML
extends java.lang.Object

This class represents a Transformation in TML notation.

Author:
Nerissa Tong (nnyt98@doc.ic.ac.uk)

Field Summary
private  int action
           
private  boolean changedRefTML
           
private  java.lang.String constraint
           
private  SchemaObject fromObj
           
private  Schema fromSchema
           
private  java.lang.String function
           
private  java.util.HashSet nPost
           
private  java.util.HashSet nPostString
           
private  java.util.HashSet nPre
           
private  java.util.HashSet nPreString
           
private  java.util.HashSet pPost
           
private  java.util.HashSet pPostString
           
private  java.util.HashSet pPre
           
private  java.util.HashSet pPreString
           
private  Transformation repTran
           
private static java.util.HashMap tmlMap
           
private  SchemaObject toObj
           
private  Schema toSchema
           
private static java.lang.String[] tranActionNames
           
 
Constructor Summary
protected TML(int a, Schema fs, Schema ts, SchemaObject fo, SchemaObject to, java.lang.String f, java.lang.String c)
           
protected TML(SchemaObject to)
           
protected TML(TML tml)
           
  TML(Transformation t)
           
 
Method Summary
protected  void addQuerySchemaObjectsToConditions(java.util.ArrayList querySchemaObjects)
           
protected  void addToNegPostString(java.lang.String str)
           
protected  void addToNegPreString(java.lang.String str)
           
protected  void addToPosPostString(java.lang.String str)
           
protected  void addToPosPreString(java.lang.String str)
           
 int getAction()
           
 java.lang.String getActionString()
           
 java.lang.String getConstraint()
           
 SchemaObject getFromObject()
           
 Schema getFromSchema()
           
 java.lang.String getFunction()
           
private static java.lang.String getMapName(Schema fs, Schema ts)
           
 java.util.HashSet getNegativePostconditions()
           
 java.util.HashSet getNegativePreconditions()
           
(package private)  java.util.HashSet getNegPostString()
           
(package private)  java.util.HashSet getNegPreString()
           
 java.util.HashSet getPositivePostconditions()
           
 java.util.HashSet getPositivePreconditions()
           
(package private)  java.util.HashSet getPosPostString()
           
(package private)  java.util.HashSet getPosPreString()
           
protected static java.util.ArrayList getQuerySchemaObjects(int a, java.lang.String query, Schema fs)
          Returns an ArrayList of OBIDs referenced by the given query.
 Transformation getRepTran()
           
private  java.lang.String[] getSchemaObjectStr(java.util.Set set)
           
static TML getTML(Schema fs, Schema ts)
           
 SchemaObject getToObject()
           
 Schema getToSchema()
           
 boolean isChangedRefTML()
           
 java.lang.String toActionString(int a)
           
 java.lang.String toPrintString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pPre

private java.util.HashSet pPre

nPre

private java.util.HashSet nPre

pPost

private java.util.HashSet pPost

nPost

private java.util.HashSet nPost

pPreString

private java.util.HashSet pPreString

nPreString

private java.util.HashSet nPreString

pPostString

private java.util.HashSet pPostString

nPostString

private java.util.HashSet nPostString

action

private int action

fromSchema

private Schema fromSchema

toSchema

private Schema toSchema

fromObj

private SchemaObject fromObj

toObj

private SchemaObject toObj

tmlMap

private static java.util.HashMap tmlMap

function

private java.lang.String function

constraint

private java.lang.String constraint

repTran

private Transformation repTran

changedRefTML

private boolean changedRefTML

tranActionNames

private static java.lang.String[] tranActionNames
Constructor Detail

TML

public TML(Transformation t)

TML

protected TML(SchemaObject to)

TML

protected TML(TML tml)

TML

protected TML(int a,
              Schema fs,
              Schema ts,
              SchemaObject fo,
              SchemaObject to,
              java.lang.String f,
              java.lang.String c)
       throws NotFoundException,
              InconsistentException
Throws:
NotFoundException
InconsistentException
Method Detail

getQuerySchemaObjects

protected static java.util.ArrayList getQuerySchemaObjects(int a,
                                                           java.lang.String query,
                                                           Schema fs)
                                                    throws InconsistentException,
                                                           NotFoundException
Returns an ArrayList of OBIDs referenced by the given query. These OBIDs exist in the given from schema.

Parameters:
a - the action of the transformation to which the query belongs. This information is used for the different query extraction methods for extend and contract transformations (the range(q_l, q_u) syntax
query - the query from which schema objects are to be extracted
fs - the from schema of the transformation. If set to null, it means some of the schema objects in the query do not exist (for the purpose of optimisation), in this case, an ArrayList of String values is returned. An ArrayList of Integer values is returned otherwise.
Throws:
InconsistentException
NotFoundException

getMapName

private static java.lang.String getMapName(Schema fs,
                                           Schema ts)

getTML

public static TML getTML(Schema fs,
                         Schema ts)
                  throws NotFoundException
Throws:
NotFoundException

getAction

public int getAction()

getPositivePreconditions

public java.util.HashSet getPositivePreconditions()

getNegativePreconditions

public java.util.HashSet getNegativePreconditions()

getPositivePostconditions

public java.util.HashSet getPositivePostconditions()

getNegativePostconditions

public java.util.HashSet getNegativePostconditions()

getPosPreString

java.util.HashSet getPosPreString()

getNegPreString

java.util.HashSet getNegPreString()

getPosPostString

java.util.HashSet getPosPostString()

getNegPostString

java.util.HashSet getNegPostString()

addToPosPreString

protected void addToPosPreString(java.lang.String str)

addToNegPreString

protected void addToNegPreString(java.lang.String str)

addToPosPostString

protected void addToPosPostString(java.lang.String str)

addToNegPostString

protected void addToNegPostString(java.lang.String str)

addQuerySchemaObjectsToConditions

protected void addQuerySchemaObjectsToConditions(java.util.ArrayList querySchemaObjects)
                                          throws NotFoundException
Throws:
NotFoundException

toActionString

public java.lang.String toActionString(int a)

getActionString

public java.lang.String getActionString()

getFromSchema

public Schema getFromSchema()

getToSchema

public Schema getToSchema()

getFromObject

public SchemaObject getFromObject()

getToObject

public SchemaObject getToObject()

getFunction

public java.lang.String getFunction()

getConstraint

public java.lang.String getConstraint()

getRepTran

public Transformation getRepTran()

isChangedRefTML

public boolean isChangedRefTML()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toPrintString

public java.lang.String toPrintString()
                               throws IntegrityException
Throws:
IntegrityException

getSchemaObjectStr

private java.lang.String[] getSchemaObjectStr(java.util.Set set)
                                       throws IntegrityException
Throws:
IntegrityException