mascoptLib.graphs
Class Graph

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

public class Graph
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
Graph()
          Default constructor of a Digraph.
Graph(mascoptLib.graphs.Graph graph)
          Constructor of a subgraph.
Graph(mascoptLib.graphs.Graph graph, boolean copyElements)
          Copy all nodes, edges, edge and node set of a graph, creating a new graph.
Graph(mascoptLib.graphs.VertexSet nodeSet, mascoptLib.graphs.EdgeSet edgeSet)
          Constructor using a NodeSet and an EdgeSet.
 
Method Summary
 mascoptLib.graphs.Graph copyGraph()
          Copy all nodes, edges, edge and node set of a graph, creating a new graph.
 mascoptLib.graphs.EdgeSet getEdgeSet()
          Returns the edge 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.Graph g)
          Not Implemented .
 void replace(mascoptLib.graphs.Vertex node, mascoptLib.graphs.VertexSet nodeSet)
          Not Implemented .
 boolean setEdgeSet(mascoptLib.graphs.EdgeSet edgeSet)
          Change the edge set of the graph.
 boolean setVertexSet(mascoptLib.graphs.VertexSet nodeSet)
          Change the node set of the graph.
 String toString()
          Converts the set 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

Graph

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


Graph

public Graph(mascoptLib.graphs.VertexSet nodeSet,
             mascoptLib.graphs.EdgeSet edgeSet)
Constructor using a NodeSet and an EdgeSet.

Parameters:
nodeSet - the node set to use when constructing the graph.
edgeSet - the edge set to use when constructing the graph.

Graph

public Graph(mascoptLib.graphs.Graph graph)
Constructor of a subgraph. Constructs a graph with a sub node set and a sub edge set. The subgraph is empty when constructed.

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

Graph

public Graph(mascoptLib.graphs.Graph 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 is 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 set 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

getEdgeSet

public mascoptLib.graphs.EdgeSet getEdgeSet()
Returns the edge set of the graph.

Returns:
the edge set of the graph.

setEdgeSet

public boolean setEdgeSet(mascoptLib.graphs.EdgeSet edgeSet)
Change the edge set of the graph.

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

replace

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


replace

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


copyGraph

public mascoptLib.graphs.Graph copyGraph()
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 is lost.

Returns:
the duplicated graph.