mascoptLib.graphs
Class DiGraph

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

public class DiGraph
extends AbstractGraph

The Graph class constructs a non directed graph using a node set and an edge set. It guaranty that, at any time, the EdgeSet and NodeSet objects stay coherent. It provides facilities to copy graphs and construct subgraphs. The DiGraph class constructs directed graph with NodeSet and ArcSet objects. Graph and DiGraph derive from MascoptObject.

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

Constructor Summary
DiGraph()
          Default constructor of a Digraph.
DiGraph(mascoptLib.graphs.DiGraph digraph)
          Constructor of a subgraph.
DiGraph(mascoptLib.graphs.DiGraph graph, boolean copyElements)
          Copy all nodes, edges, edge and node set of a graph, creating a new graph.
DiGraph(mascoptLib.graphs.VertexSet nodeSet, mascoptLib.graphs.ArcSet arcSet)
          Constructor using a node set and an arc set.
 
Method Summary
 mascoptLib.graphs.Graph constructGraph()
          Construct a Graph copy of the Digraph replacing arcs by edges and using same nodes.
 mascoptLib.graphs.DiGraph copyDiGraph()
          Copy all nodes, arcs, arc and node set of a graph, creating a new digraph.
 mascoptLib.graphs.ArcSet getArcSet()
          Returns the arc set of the graph.
 mascoptLib.abstractGraph.AbstractGraphFactory getFactory()
          Give the factory creating objects not abstract.
 mascoptLib.graphs.VertexSet getVertexSet()
          Returns the node set of the graph.
 void replace(mascoptLib.graphs.Vertex node, mascoptLib.graphs.DiGraph g)
          Not Implemented .
 void replace(mascoptLib.graphs.Vertex node, mascoptLib.graphs.VertexSet nodeSet)
          Not Implemented .
 boolean setArcSet(mascoptLib.graphs.ArcSet arcSet)
          Change the edge set of the graph.
 boolean setVertexSet(mascoptLib.graphs.VertexSet nodeSet)
          Change the node set of the graph.
 String toString()
          Converts the Graph in string to be printed.
 
Methods inherited from class mascoptLib.abstractGraph.AbstractGraph
breadthFirstIterator, checkIntegrity, copyAbstractGraph, countAllAbstractGraphs, depthFirstIterator, free, 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, update
 
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

DiGraph

public DiGraph()
Default constructor of a Digraph. The other constructors should be preferred.


DiGraph

public DiGraph(mascoptLib.graphs.VertexSet nodeSet,
               mascoptLib.graphs.ArcSet arcSet)
Constructor using a node set and an arc set.

Parameters:
nodeSet - the node set to use when constructing the graph.
arcSet - the arc set to use when constructing the graph.

DiGraph

public DiGraph(mascoptLib.graphs.DiGraph digraph)
Constructor of a subgraph. Constructs a graph with a sub node set and a sub arc set. The subgraph is emtpy when constructed.

Parameters:
digraph - the graph used for the construction of the subgraph.

DiGraph

public DiGraph(mascoptLib.graphs.DiGraph graph,
               boolean copyElements)
Copy all nodes, edges, edge and node set of a graph, creating a new graph. Note that only the structure of the graph is duplicated. All the values stored with setValue are lost.

Parameters:
copyElements - indicates if new nodes and edges have to be duplicated. If false, the current nodes and edges of the graph are used. On the contrary, new nodes and edges are created and you loose the values stored in it.
Method Detail

toString

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

Overrides:
toString in class AbstractGraph

getFactory

public mascoptLib.abstractGraph.AbstractGraphFactory getFactory()
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

getVertexSet

public mascoptLib.graphs.VertexSet getVertexSet()
Returns the node set of the graph.

Returns:
the node set of the graph.

setVertexSet

public boolean setVertexSet(mascoptLib.graphs.VertexSet nodeSet)
Change the node set of the graph.

Parameters:
nodeSet - the node set to use in the graph.
Returns:
true if successfull

getArcSet

public mascoptLib.graphs.ArcSet getArcSet()
Returns the arc set of the graph.

Returns:
the arc set of the graph.

setArcSet

public boolean setArcSet(mascoptLib.graphs.ArcSet arcSet)
Change the edge set of the graph.

Parameters:
arcSet - the edge set to use in the graph.
Returns:
true if successfull

replace

public void replace(mascoptLib.graphs.Vertex node,
                    mascoptLib.graphs.DiGraph g)
Not Implemented .


replace

public void replace(mascoptLib.graphs.Vertex node,
                    mascoptLib.graphs.VertexSet nodeSet)
Not Implemented .


copyDiGraph

public mascoptLib.graphs.DiGraph copyDiGraph()
Copy all nodes, arcs, arc and node set of a graph, creating a new digraph. Note that only the structure of the digraph is duplicated. All the values stored with setValue is lost.

Returns:
the duplicated digraph.

constructGraph

public mascoptLib.graphs.Graph constructGraph()
Construct a Graph copy of the Digraph replacing arcs by edges and using same nodes.

Returns:
the graph constructed.