nz.ac.waikato.mcennis.rat.graph.path
Class BasicPathSet

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.model.ModelShell
      extended by nz.ac.waikato.mcennis.rat.graph.path.BasicPathSet
All Implemented Interfaces:
Model, PathSet

public class BasicPathSet
extends ModelShell
implements PathSet

Class for describing a set of Paths


Field Summary
 
Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
listener
 
Fields inherited from interface nz.ac.waikato.mcennis.rat.graph.path.PathSet
ADD_PATH, SET_TYPE
 
Constructor Summary
BasicPathSet()
          Creates a new instance of BasicPathSet
 
Method Summary
 void addPath(Path p)
          Add a new path to this PathSet
 double getGeodesicLength(java.lang.String source, java.lang.String destination)
          Return the smallest cost path between the source and destination.
 Path[] getPath()
          Return all paths in this object.
 Path[] getPath(java.lang.String source, java.lang.String destination)
          Return all paths that start with actor source and end with actor destination.
 Path[] getPathByDestination(java.lang.String destination)
          Return all paths that end with an actor with this ID or null if none exist FIXME: should be by actor - not ID - as actors can have the same id if they differ in type.
 Path[] getPathBySource(java.lang.String source)
          Return all paths that start with an actor with this ID or null if none exist.
 java.lang.String getType()
          Returns the ID of this PathSet
 void setType(java.lang.String name)
          Set the PathSet's ID
 int size()
          Return total number of paths in this dataset
 
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
addListener, fireChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model
addListener
 

Constructor Detail

BasicPathSet

public BasicPathSet()
Creates a new instance of BasicPathSet

Method Detail

getPath

public Path[] getPath()
Description copied from interface: PathSet
Return all paths in this object. Returns null if this path set contains no paths.

Specified by:
getPath in interface PathSet
Returns:
array of all paths in this object

getPathBySource

public Path[] getPathBySource(java.lang.String source)
Description copied from interface: PathSet
Return all paths that start with an actor with this ID or null if none exist. FIXME: should be by actor - not ID - as actors can have the same id if they differ in type.

Specified by:
getPathBySource in interface PathSet
Parameters:
source - string ID of actor used to select paths
Returns:
all paths starting with actor given by ID source

getPathByDestination

public Path[] getPathByDestination(java.lang.String destination)
Description copied from interface: PathSet
Return all paths that end with an actor with this ID or null if none exist FIXME: should be by actor - not ID - as actors can have the same id if they differ in type.

Specified by:
getPathByDestination in interface PathSet
Parameters:
destination - string ID of actor used to select paths
Returns:
paths that end with an actor with the given ID.

addPath

public void addPath(Path p)
             throws NotConstructedError
Description copied from interface: PathSet
Add a new path to this PathSet

Specified by:
addPath in interface PathSet
Parameters:
p - path to be added
Throws:
NotConstructedError

getPath

public Path[] getPath(java.lang.String source,
                      java.lang.String destination)
Description copied from interface: PathSet
Return all paths that start with actor source and end with actor destination. FIXME: should be by actor - not ID - as actors can have the same id if they differ in type.

Specified by:
getPath in interface PathSet
Parameters:
source - string ID of actor used to select paths
destination - string ID of actor used to select paths
Returns:
paths that start with actor source and end with actor destination

setType

public void setType(java.lang.String name)
Description copied from interface: PathSet
Set the PathSet's ID

Specified by:
setType in interface PathSet
Parameters:
name - new ID of this PathSet

getType

public java.lang.String getType()
Description copied from interface: PathSet
Returns the ID of this PathSet

Specified by:
getType in interface PathSet
Returns:
PathSet ID

size

public int size()
Description copied from interface: PathSet
Return total number of paths in this dataset

Specified by:
size in interface PathSet
Returns:
size of the PathSet

getGeodesicLength

public double getGeodesicLength(java.lang.String source,
                                java.lang.String destination)
Description copied from interface: PathSet
Return the smallest cost path between the source and destination.

Specified by:
getGeodesicLength in interface PathSet
Parameters:
source - string ID that of actor used to select paths
destination - string ID that of actor used to select paths
Returns:
smallest cost of any path in the PathSet between the source and destination

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads