mascoptLib.graphs
Class Edge

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

public class Edge
extends AbstractEdge

An Edge object is built using two Node objects. Given one node, the Edge object provides facilities to walk trough this edge when covering a Graph. Edge is derivated from MascoptObject. The Arc class is derivated from Edge and implements directed edges.

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

Constructor Summary
Edge(mascoptLib.abstractGraph.AbstractVertex n1, mascoptLib.abstractGraph.AbstractVertex n2)
          Constructs a new Edge object betwenn n1 and n2.
 
Method Summary
 mascoptLib.abstractGraph.AbstractVertex getConnected(mascoptLib.abstractGraph.AbstractVertex n)
          Returns the node connected by current edge from node n.
 mascoptLib.abstractGraph.AbstractVertex getOppositeNode(mascoptLib.abstractGraph.AbstractVertex node)
          Returns the opposite node of an edge
 mascoptLib.graphs.Vertex[] getVertices()
          Returns the vertices linked by this edge.
 boolean leadsTo(mascoptLib.abstractGraph.AbstractVertex n)
          Specifies if the current edge leads to node n.
 boolean leaves(mascoptLib.abstractGraph.AbstractVertex n)
          Specifies if the current edge comes from node n.
 String toString()
          Returns a String object representing this AbstractNode.
 
Methods inherited from class mascoptLib.abstractGraph.AbstractEdge
getAbstractVertices, getOppositeAbstractVertex, isLoop, size
 
Methods inherited from class mascoptLib.abstractGraph.MascoptObject
copyValues, countAllObjects, deleteValue, deleteValue, existValue, existValue, free, 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

Edge

public Edge(mascoptLib.abstractGraph.AbstractVertex n1,
            mascoptLib.abstractGraph.AbstractVertex n2)
Constructs a new Edge object betwenn n1 and n2. This object is observer of the two vertices.

Parameters:
n1 - one of the vertices.
n2 - the other node
Method Detail

toString

public String toString()
Returns a String object representing this AbstractNode. With the format [N0-N1] where N0 and N1 are the two vertices of the edge.

Overrides:
toString in class Object
Returns:
a string representation of this object.

getOppositeNode

public mascoptLib.abstractGraph.AbstractVertex getOppositeNode(mascoptLib.abstractGraph.AbstractVertex node)
Returns the opposite node of an edge

Parameters:
node - the node to use the opposite one.
Returns:
the opposite node considering this edge.

leadsTo

public boolean leadsTo(mascoptLib.abstractGraph.AbstractVertex n)
Specifies if the current edge leads to node n.

Specified by:
leadsTo in class AbstractEdge
Parameters:
n - the AbstractNode to test
Returns:
true if this AbstractEdge leads to this node, false otherwise

leaves

public boolean leaves(mascoptLib.abstractGraph.AbstractVertex n)
Specifies if the current edge comes from node n.

Specified by:
leaves in class AbstractEdge
Parameters:
n - the AbstractNode to test
Returns:
true if this AbstractEdge comes from this node, false otherwise

getConnected

public mascoptLib.abstractGraph.AbstractVertex getConnected(mascoptLib.abstractGraph.AbstractVertex n)
Returns the node connected by current edge from node n.

Specified by:
getConnected in class AbstractEdge
Parameters:
n - the AbstractNode to test
Returns:
the node connected to n via the current edge

getVertices

public mascoptLib.graphs.Vertex[] getVertices()
Returns the vertices linked by this edge.

Returns:
a vector containing all concerned vertices.