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

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

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

Method Summary
static Pathway createPathway(Schema[] schemaArray)
           
static java.util.List findAllPathways(Schema schema1, Schema schema2)
          Return all possible pathways to a data source dmle 9/11/2005
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()
           
 int 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()
           
 TempPathway optimise()
           
 TempPathway optimise(boolean removeUncertainPairs)
           
 TempPathway optimise(boolean removeUncertainPairs, int algorithm)
           
 TempPathway optimise(boolean removeUncertainPairs, PathwayOptimiserTool tool)
           
 TempPathway optimise(boolean removeUncertainPairs, PathwayOptimiserTool tool, int algorithm)
           
 TempPathway optimise(int algorithm)
           
 int size()
          Returns the number of Schemas in the pathway.
 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
 

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 dmle 9/11/2005

Throws:
IntegrityException
NotFoundException

isWellformed

public boolean isWellformed()

optimise

public TempPathway optimise()
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

public TempPathway optimise(int algorithm)
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

public TempPathway optimise(boolean removeUncertainPairs)
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

public TempPathway optimise(boolean removeUncertainPairs,
                            int algorithm)
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

public TempPathway optimise(boolean removeUncertainPairs,
                            PathwayOptimiserTool tool)
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

public TempPathway optimise(boolean removeUncertainPairs,
                            PathwayOptimiserTool tool,
                            int algorithm)
                     throws IntegrityException,
                            InconsistentException,
                            NotFoundException,
                            NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

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 int getQualityMeasure()

getAssociatedModels

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