mascoptLib.abstractGraph
Class AbstractEdge

java.lang.Object
  extended bymascoptLib.util.ObservableObject
      extended bymascoptLib.abstractGraph.MascoptObject
          extended bymascoptLib.abstractGraph.AbstractEdge
All Implemented Interfaces:
Cloneable, MascoptObjectInterface, Observer
Direct Known Subclasses:
Arc, Edge

public abstract class AbstractEdge
extends MascoptObject

An AbstractEdge object is built using two AbstractVertex objects. Given one vertex, the AbstractEdge object provides facilities to walk trough this edge when covering an AbstractGraph. AbstractEdge is derivated from MascoptObject.


Constructor Summary
AbstractEdge(AbstractVertex n1, AbstractVertex n2)
          Constructs a new AbstractEdge object between n1 and n2.
 
Method Summary
 AbstractVertex[] getAbstractVertices()
          Returns the vertices linked by this edge.
abstract  AbstractVertex getConnected(AbstractVertex n)
          Returns the vertex connected by current edge from vertex n.
 AbstractVertex getOppositeAbstractVertex(AbstractVertex vertex)
          Returns the opposite vertex of an edge There is no check about the edge orientation.
 boolean isLoop()
          Gives the edge status concerning the loop state.
abstract  boolean leadsTo(AbstractVertex n)
          Specifies if the current edge leads to vertex n.
abstract  boolean leaves(AbstractVertex n)
          Specifies if the current edge comes from vertex n.
static int size()
          Counts all abstract vertices.
 
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, toString, wait, wait, wait
 

Constructor Detail

AbstractEdge

public AbstractEdge(AbstractVertex n1,
                    AbstractVertex n2)
Constructs a new AbstractEdge object between n1 and n2. This object is observer of the two vertices. Arcs and Edges must call super(AbstractVertex, AbstractVertex)

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

getAbstractVertices

public AbstractVertex[] getAbstractVertices()
Returns the vertices linked by this edge. No order is guaranteed by this function. It may return the two vertices in random order in the table.

Returns:
a vector containing all concerned vertices.

getOppositeAbstractVertex

public AbstractVertex getOppositeAbstractVertex(AbstractVertex vertex)
Returns the opposite vertex of an edge There is no check about the edge orientation.

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

leadsTo

public abstract boolean leadsTo(AbstractVertex n)
Specifies if the current edge leads to vertex n.

Parameters:
n - the AbstractVertex to test
Returns:
true if this AbstractEdge leads to this vertex, false otherwise

leaves

public abstract boolean leaves(AbstractVertex n)
Specifies if the current edge comes from vertex n.

Parameters:
n - the AbstractVertex to test
Returns:
true if this AbstractEdge comes from this vertex, false otherwise

getConnected

public abstract AbstractVertex getConnected(AbstractVertex n)
Returns the vertex connected by current edge from vertex n.

Parameters:
n - the AbstractVertex to test
Returns:
the vertex connected to n via the current edge

isLoop

public boolean isLoop()
Gives the edge status concerning the loop state.

Returns:
true if the edge have the same start and end vertex

size

public static int size()
Counts all abstract vertices.

Returns:
the number of abstract vertices, ie the size of the abstractGraph.