mascoptLib.graphs
Class Path

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

public class Path
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
Path(mascoptLib.graphs.EdgeSet edgeSet)
          Default Constuctor on a set of edge.
Path(mascoptLib.graphs.Path chain)
          Constructs a copy of a chain.
 
Method Summary
 boolean concat(mascoptLib.graphs.Edge edge)
          Add an edge to a chain.
 boolean concat(mascoptLib.graphs.Path chain)
          Concat two chain in one chain.
 mascoptLib.graphs.EdgeSet getEdgeSet()
          Returns the edge set of the chain.
 mascoptLib.graphs.Vertex getEnd()
          Returns the ending node of the chain.
 mascoptLib.abstractGraph.AbstractGraphFactory getFactory()
          Give the factory creating objects not abstract.
 mascoptLib.graphs.Vertex getStart()
          Returns the starting node of the chain.
 mascoptLib.graphs.VertexSet getVertexSet()
          Returns the node set of the chain.
 boolean merge(mascoptLib.graphs.Path chain)
          Merge two chains with the same start and end node.
 mascoptLib.graphs.Edge nextEdge(mascoptLib.graphs.Vertex node)
          Given a node in the chain, returns the next edge when covering the chain.
 mascoptLib.abstractGraph.MascoptFixedSet nextEdgeSet(mascoptLib.graphs.Vertex node)
          Given a node in the chain, returns the next edges when covering the chain.
 mascoptLib.graphs.Vertex nextVertex(mascoptLib.graphs.Vertex node)
          Given a node in the chain, returns the next node when covering the chain.
 mascoptLib.abstractGraph.MascoptFixedSet predEdgeSet(mascoptLib.graphs.Vertex node)
          Given a node in the chain, returns the previous edges when covering the chain.
 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

Path

public Path(mascoptLib.graphs.EdgeSet edgeSet)
Default Constuctor on a set of edge. The chain must be constructed on a set of edges. Classicaly, we use the edgeSet of the graph on which is based the chain.

Parameters:
edgeSet - the set of edge on which is based the chain.

Path

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

Parameters:
chain - the chain 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()
Description copied from class: AbstractGraph
Give the factory creating objects not abstract. As all the library is abstract, we need a factory that determines the type of graphs the user manipulates. Then the factory is able to create each type of object when necessary.

Specified by:
getFactory in class AbstractGraph

concat

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

Parameters:
edge - the edge to add to the chain.
Returns:
true if the add is successfull.

concat

public boolean concat(mascoptLib.graphs.Path chain)
Concat two chain in one chain.

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

merge

public boolean merge(mascoptLib.graphs.Path chain)
Merge two chains 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:
chain - the chain to merge.
Returns:
true if successfull.

getEdgeSet

public mascoptLib.graphs.EdgeSet getEdgeSet()
Returns the edge set of the chain. Note that the chain is derivated from a graph. This edge set is constant, and cannot be modified directly.

Returns:
the edge set of the chain.

getVertexSet

public mascoptLib.graphs.VertexSet getVertexSet()
Returns the node set of the chain. Note that the chain is derivated from a graph. This vertex set is constant, and cannot be modified directly.

Returns:
the node set of the chain.

getStart

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

Returns:
the start node of the chain.

getEnd

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

Returns:
the end node of the chain.

nextVertex

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

Parameters:
node - the node of the chain to consider.
Returns:
the node previous of the node.

nextEdge

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

Parameters:
node - the node of the chain to consider.
Returns:
the edge previous of the node.

nextEdgeSet

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

Parameters:
node - the node of the chain to consider.
Returns:
an edgeSet containing all next edges.

predEdgeSet

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

Parameters:
node - the node of the chain to consider.
Returns:
an edgeSet containing all previous edges.