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

java.lang.Object
  extended by uk.ac.ic.doc.automed.reps.Pathway
All Implemented Interfaces:
PersistentObject
Direct Known Subclasses:
PathwayAbstraction

public class Pathway
extends java.lang.Object
implements PersistentObject

The Pathway class

Author:
Michael Boyd (mboyd@doc.ic.ac.uk), Nerissa Tong (nnyt98@doc.ic.ac.uk) Edited by Duc M Le on 14/11/2005 - Add a storage for schema models as well
See Also:
Path

Field Summary
protected  java.util.ArrayList trans
           
protected  java.util.ArrayList transStatus
           
 
Constructor Summary
protected Pathway(Schema[] schemaArray)
          Make this protected for sub-classes to use
 
Method Summary
protected  void convertPathToTP(Schema[] path)
          Create a list of Transformation objects that represent each transformation step from one schema to the next included in path
static Pathway createPathway(Schema[] schemaArray)
           
static java.util.List findAllPathways(Schema schema1, Schema schema2)
          Return all possible pathways to a data source
static Pathway findShortestPathway(Schema schema1, Schema schema2)
          Find the shortest path containing the fewest number of steps between two schemas.
static Pathway findShortestPathway(java.lang.String schema1, java.lang.String schema2)
           
 Schema get(int index)
          Returns the Schema at the given index of the pathway.
 java.util.Map getAssociatedModels()
          Return all associated Models necessary to re-build the Schemas in
the pathway
 PersistentKey getKey()
           
 Schema getLastExtSchema()
          Returns the last extentional Schema in the pathway.
 java.util.Map getPersistentAttributes()
           
 float getQualityMeasure()
           
 Schema[] getSchemas()
          Return as an array the Schemas that appear in the Transformations of this Pathway.
 Transformation[] getTransformations()
          Return as an array the Transformations that make up this Pathway.
 java.lang.String getWellformedErrorMsg()
           
 int indexOf(Schema s)
          Returns the index of a given Schema within the pathway.
 boolean isWellformed()
           
 int size()
          Returns the number of Schemas in the pathway.
 java.lang.String toLaTeX()
          Returns the Pathway in a form that may rendered by the hdm.sty LaTeX package.
 java.lang.String toString()
           
 void write()
          Write out the series of transformations found in this pathway to the standard output in a human readable form
 void write(java.io.OutputStream os)
           
 void write(java.io.OutputStream os, int format)
           
 void write(java.io.PrintWriter pw, java.lang.String prefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

trans

protected java.util.ArrayList trans

transStatus

protected java.util.ArrayList transStatus
Constructor Detail

Pathway

protected Pathway(Schema[] schemaArray)
Make this protected for sub-classes to use

Method Detail

createPathway

public static Pathway createPathway(Schema[] schemaArray)

findShortestPathway

public static Pathway findShortestPathway(java.lang.String schema1,
                                          java.lang.String schema2)
                                   throws IntegrityException,
                                          NotFoundException
Throws:
IntegrityException
NotFoundException

findShortestPathway

public static Pathway findShortestPathway(Schema schema1,
                                          Schema schema2)
                                   throws IntegrityException,
                                          NotFoundException
Find the shortest path containing the fewest number of steps between two schemas. Note that this might not be the best path to use, since it might contain extend and contract transformations, where a longer path might not contain extend and contract transformations.

Throws:
IntegrityException
NotFoundException

findAllPathways

public static java.util.List findAllPathways(Schema schema1,
                                             Schema schema2)
                                      throws IntegrityException,
                                             NotFoundException
Return all possible pathways to a data source

Throws:
IntegrityException
NotFoundException

convertPathToTP

protected void convertPathToTP(Schema[] path)
Create a list of Transformation objects that represent each transformation step from one schema to the next included in path


isWellformed

public boolean isWellformed()

getTransformations

public Transformation[] getTransformations()
Return as an array the Transformations that make up this Pathway.


getSchemas

public Schema[] getSchemas()
Return as an array the Schemas that appear in the Transformations of this Pathway.


toString

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

write

public void write()
Write out the series of transformations found in this pathway to the standard output in a human readable form


write

public void write(java.io.OutputStream os)

write

public void write(java.io.PrintWriter pw,
                  java.lang.String prefix)

getWellformedErrorMsg

public java.lang.String getWellformedErrorMsg()

getLastExtSchema

public Schema getLastExtSchema()
Returns the last extentional Schema in the pathway.

Returns:
the last extentional schema in the pathway

indexOf

public int indexOf(Schema s)
Returns the index of a given Schema within the pathway.

Parameters:
s - the Schema whose index within the pathway is to be returned

get

public Schema get(int index)
Returns the Schema at the given index of the pathway.

Parameters:
index - the index within the pathway that holds the required Schema

size

public int size()
Returns the number of Schemas in the pathway.


getKey

public PersistentKey getKey()
Specified by:
getKey in interface PersistentObject

getPersistentAttributes

public java.util.Map getPersistentAttributes()
Specified by:
getPersistentAttributes in interface PersistentObject

write

public void write(java.io.OutputStream os,
                  int format)
           throws java.io.IOException
Throws:
java.io.IOException

getQualityMeasure

public float getQualityMeasure()

getAssociatedModels

public java.util.Map getAssociatedModels()
Return all associated Models necessary to re-build the Schemas in
the pathway


toLaTeX

public java.lang.String toLaTeX()
Returns the Pathway in a form that may rendered by the hdm.sty LaTeX package.