mascoptLib.graphs
Class DiPath

java.lang.Object
  |
  +--mascoptLib.util.ObservableObject
        |
        +--mascoptLib.abstractGraph.MascoptObject
              |
              +--mascoptLib.abstractGraph.AbstractGraph
                    |
                    +--mascoptLib.abstractGraph.AbstractPath
                          |
                          +--mascoptLib.graphs.DiPath
All Implemented Interfaces:
Cloneable, MascoptObjectInterface, Observer

public class DiPath
extends AbstractPath

A Chain object give the ability to build a chain over a Graph. The chain can be merged with another chain with same start and end node, giving a multi-chain. The chain can be covered through the graph. The chain is also considered as a graph and derives from Graph. The Path object is a directed Chain. It derives from DiGraph.

Author:
Jean-Francois Lalande (Jean-Francois.Lalande@sophia.inria.fr)

Constructor Summary
DiPath(mascoptLib.graphs.ArcSet arcSet)
          Default Constuctor on a path.
DiPath(mascoptLib.graphs.DiPath path)
          Constructs a copy of a path.
 
Method Summary
 boolean concat(mascoptLib.graphs.Arc arc)
          Add an edge to a path.
 boolean concat(mascoptLib.graphs.DiPath path)
          Concat two paths in one path.
 mascoptLib.graphs.ArcSet getArcSet()
          Returns the arc set on which is based the path.
 mascoptLib.graphs.Vertex getEnd()
          Returns the ending node of the path.
 mascoptLib.abstractGraph.AbstractGraphFactory getFactory()
          Returns the library objects factory.
 mascoptLib.graphs.Vertex getStart()
          Returns the starting node of the path.
 mascoptLib.graphs.VertexSet getVertexSet()
          Returns the node set on which is based the path.
 boolean merge(mascoptLib.graphs.DiPath path)
          Merge two paths with the same start and end node.
 mascoptLib.graphs.Arc nextArc(mascoptLib.graphs.Vertex node)
          Given a node in the path, returns the next arc when covering the path.
 mascoptLib.abstractGraph.MascoptFixedSet nextArcSet(mascoptLib.graphs.Vertex node)
          Given a node in the path, returns the next arc set when covering the path.
 mascoptLib.graphs.Vertex nextVertex(mascoptLib.graphs.Vertex node)
          Given a node in the path, returns the next node when covering the path.
 mascoptLib.abstractGraph.MascoptFixedSet predArcSet(mascoptLib.graphs.Vertex node)
          Given a node in the path, returns the previous arcs when covering the path.
 String toString()
          Converts the chain in string to be printed.
 
Methods inherited from class mascoptLib.abstractGraph.AbstractPath
checkIntegrity, concatAbstractEdge, concatAbstractPath, countAllAbstractPaths, free, getAbstractEnd, getAbstractStart, isClosed, isEnd, isMulti, isStart, mergeAbstractPath, nextAbstractEdge, nextAbstractEdgeSet, nextAbstractVertex, predAbstractEdge, predAbstractEdgeSet, removeLastEdge, update
 
Methods inherited from class mascoptLib.abstractGraph.AbstractGraph
breadthFirstIterator, copyAbstractGraph, countAllAbstractGraphs, depthFirstIterator, getAbstractEdgeSet, getAbstractVertexSet, getSuperGraph, isSubGraph, replace, replace, setAbstractEdgeSet, setAbstractVertexSet, setSuperGraph
 
Methods inherited from class mascoptLib.abstractGraph.MascoptObject
copyValues, countAllObjects, deleteValue, deleteValue, existValue, existValue, getDoubleValue, getDoubleValue, getDouValue, getDouValue, getId, getIntegerValue, getIntegerValue, getIntValue, getIntValue, getName, getValue, getValue, getValueContexts, getValueDataType, getValueDataType, getValueEntries, notifyOnValueChange, removeAllValues, setDoubleValue, setDoubleValue, setDouValue, setDouValue, setIntegerValue, setIntegerValue, setIntValue, setIntValue, setName, setValue, setValue, setValue, setValue, setValue, setValue
 
Methods inherited from class mascoptLib.util.ObservableObject
addAddObserver, addRemoveObserver, addValueObserver, countAddObservers, countRemoveObservers, countValueObservers, deleteAddObserver, deleteAddObserver, deleteRemoveObserver, deleteRemoveObserver, deleteValueObserver, deleteValueObserver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiPath

public DiPath(mascoptLib.graphs.ArcSet arcSet)
Default Constuctor on a path. The path must be constructed on a set of edges. Classicaly, we use the edgeSet of the graph on which is based the path.

Parameters:
arcSet - the set of edge on which is based the path.

DiPath

public DiPath(mascoptLib.graphs.DiPath path)
Constructs a copy of a path. This constructor allows to copy a path and all its parts. Nodes and edges are not copied.

Parameters:
path - the path to copy.
Method Detail

toString

public String toString()
Converts the chain in string to be printed.

Overrides:
toString in class AbstractPath

getFactory

public mascoptLib.abstractGraph.AbstractGraphFactory getFactory()
Returns the library objects factory.

Specified by:
getFactory in class AbstractGraph

concat

public boolean concat(mascoptLib.graphs.Arc arc)
Add an edge to a path. At the end or start part of the path can be added a new arc. This arc must be in the ArcSet given when constructing the path.

Parameters:
arc - the arc to add to the path.
Returns:
true if the add is successfull.

concat

public boolean concat(mascoptLib.graphs.DiPath path)
Concat two paths in one path.

Parameters:
path - the path to concat.
Returns:
true if successfull.

merge

public boolean merge(mascoptLib.graphs.DiPath path)
Merge two paths with the same start and end node. This function permits to create multi paths. In this way, the multi path is constructed step by step merging each part of the multi path.

Parameters:
path - the path to merge.
Returns:
true if successfull.

getArcSet

public mascoptLib.graphs.ArcSet getArcSet()
Returns the arc set on which is based the path. This arc set is constant, and cannot be modified directly.

Returns:
an edgeset, base of the path.

getVertexSet

public mascoptLib.graphs.VertexSet getVertexSet()
Returns the node set on which is based the path. This vertex set is constant, and cannot be modified directly.


getStart

public mascoptLib.graphs.Vertex getStart()
Returns the starting node of the path.

Returns:
the start node of the path.

getEnd

public mascoptLib.graphs.Vertex getEnd()
Returns the ending node of the path.

Returns:
the end node of the path.

nextVertex

public mascoptLib.graphs.Vertex nextVertex(mascoptLib.graphs.Vertex node)
Given a node in the path, returns the next node when covering the path. This function is usefull when going all over the path. Giving each node we can obtain the next node in the path. It supposes that the path is not a multi path.

Parameters:
node - the node of the path to consider.
Returns:
the node next of the node.

nextArc

public mascoptLib.graphs.Arc nextArc(mascoptLib.graphs.Vertex node)
Given a node in the path, returns the next arc when covering the path. This function is usefull when going all over the path. Giving each node we can obtain the previous arc in the path. It supposes that the path is not a multi path.

Parameters:
node - the node of the path to consider.
Returns:
the arc next of the node.

nextArcSet

public mascoptLib.abstractGraph.MascoptFixedSet nextArcSet(mascoptLib.graphs.Vertex node)
Given a node in the path, returns the next arc set when covering the path. This function is usefull when going all over the path. Giving each node we can obtain the next arcs in the path.

Parameters:
node - the node of the path to consider.
Returns:
the arc set next of the node.

predArcSet

public mascoptLib.abstractGraph.MascoptFixedSet predArcSet(mascoptLib.graphs.Vertex node)
Given a node in the path, returns the previous arcs when covering the path. This function is usefull when going all over the path. Giving each node we can obtain the previous set of arcs in the path.

Parameters:
node - the node of the path to consider.
Returns:
an arcSet containing all previous arcs.