mascoptLib.abstractGraph
Class AbstractVertex

java.lang.Object
  |
  +--mascoptLib.util.ObservableObject
        |
        +--mascoptLib.abstractGraph.MascoptObject
              |
              +--mascoptLib.abstractGraph.AbstractVertex
All Implemented Interfaces:
Cloneable, MascoptObjectInterface
Direct Known Subclasses:
Vertex

public abstract class AbstractVertex
extends MascoptObject

An AbstractVertex object is the most basic element one can build. An AbstractVertex provides information about its neighbors, its degree, the edges or arcs exiting or entering it. It derives from MascoptObject.


Constructor Summary
AbstractVertex()
          Constructs a new AbstractVertex with default values X=0.0 Y=0.0
AbstractVertex(double x, double y)
          Constructs a new AbstractVertex object.
 
Method Summary
 AbstractVertex getConnected(AbstractEdge abstractEdge)
          Returns the vertex on the opposite side of this vertex on abstractEdge
 int getDegree(AbstractEdgeSet es)
          Returns the degree of the vertex in an AbstractEdgeSet.
 int getDegree(AbstractGraph graph)
          Returns the degree of the vertex in a AbstractGraph.
 AbstractEdgeSet getEdgesTo(AbstractEdgeSet aes, AbstractVertex abstractVertex)
          Construct an EdgeSet containing the edges leading to a vertex.
 AbstractEdgeSet getEdgesTo(AbstractGraph ag, AbstractVertex abstractVertex)
          Construct an EdgeSet containing the edges leading to a vertex.
 AbstractEdgeSet getIncidentEdges(AbstractEdgeSet es)
          Returns a set of incoming and outgoing abstractEdges for this vertex.
 AbstractEdgeSet getIncidentEdges(AbstractGraph graph)
          Returns a set of incoming and outgoing abstractEdges for this vertex.
 AbstractEdgeSet getIncoming(AbstractEdgeSet es)
          Returns a set of incoming abstractEdges for this vertex.
 AbstractEdgeSet getIncoming(AbstractGraph graph)
          Returns a set of incoming abstractEdges for this vertex.
 int getInDegree(AbstractEdgeSet es)
          Returns the indegree of the vertex in a AbstractEdgeSet, ie the number of incoming abstractEdges.
 int getInDegree(AbstractGraph graph)
          Returns the in degree of the vertex in a AbstractGraph, ie the number of incoming abstractEdges.
 AbstractVertexSet getNeighbours(AbstractEdgeSet es)
          Returns the set of vertices which are neighbours of this vertex.
 AbstractVertexSet getNeighbours(AbstractGraph graph)
          Returns a set of vertices which are neighbours of this vertex.
 int getOutDegree(AbstractEdgeSet es)
          Returns the out degree of the vertex in a AbstractEdgeSet, ie the number of outgoing abstractEdges.
 int getOutDegree(AbstractGraph graph)
          Returns the out degree of the vertex in a AbstractGraph, ie the number of outgoing abstractEdges.
 AbstractEdgeSet getOutgoing(AbstractEdgeSet es)
          Returns a set of outgoing abstractEdges for this vertex.
 AbstractEdgeSet getOutgoing(AbstractGraph graph)
          Returns a set of outgoing abstractEdges for this vertex.
 double getX()
          Get X coordinate value of vertex
 double getY()
          Get Y coordinate value of vertex
static int order()
          Counts all abstract vertices.
 void setX(double x)
          Set X coordinate value of vertex
 void setY(double y)
          Set Y coordinate value of vertex
 String toString()
          Object string output
 
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
 
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

AbstractVertex

public AbstractVertex(double x,
                      double y)
Constructs a new AbstractVertex object.

Parameters:
x - the x coordinate
y - the y coordinate

AbstractVertex

public AbstractVertex()
Constructs a new AbstractVertex with default values X=0.0 Y=0.0

Method Detail

toString

public String toString()
Object string output

Overrides:
toString in class Object

getX

public double getX()
Get X coordinate value of vertex


getY

public double getY()
Get Y coordinate value of vertex


setX

public void setX(double x)
Set X coordinate value of vertex


setY

public void setY(double y)
Set Y coordinate value of vertex


getDegree

public int getDegree(AbstractEdgeSet es)
Returns the degree of the vertex in an AbstractEdgeSet. this method is equivalent to inDeg(es)+outDeg(es)

Parameters:
es - the AbstractEdgeSet where to compute the degree
Returns:
the degree of the vertex.

getInDegree

public int getInDegree(AbstractEdgeSet es)
Returns the indegree of the vertex in a AbstractEdgeSet, ie the number of incoming abstractEdges.

Parameters:
es - the AbstractEdgeSet where to compute the degree
Returns:
the indegree of the vertex.

getOutDegree

public int getOutDegree(AbstractEdgeSet es)
Returns the out degree of the vertex in a AbstractEdgeSet, ie the number of outgoing abstractEdges.

Parameters:
es - the AbstractEdgeSet where to compute the degree
Returns:
the out degree of the vertex.

getIncoming

public AbstractEdgeSet getIncoming(AbstractEdgeSet es)
Returns a set of incoming abstractEdges for this vertex.

Parameters:
es - the abstractEdgeset to consider for this operation.
Returns:
a edgeSet of all incoming abstractEdges.

getOutgoing

public AbstractEdgeSet getOutgoing(AbstractEdgeSet es)
Returns a set of outgoing abstractEdges for this vertex.

Parameters:
es - the abstractEdgeset to consider for this operation.
Returns:
a edgeSet of all outgoing abstractEdges.

getIncidentEdges

public AbstractEdgeSet getIncidentEdges(AbstractEdgeSet es)
Returns a set of incoming and outgoing abstractEdges for this vertex.

Parameters:
es - the abstractEdgeset to consider for this operation.
Returns:
a edgeSet of all incoming and outgoing abstractEdges.

getNeighbours

public AbstractVertexSet getNeighbours(AbstractEdgeSet es)
Returns the set of vertices which are neighbours of this vertex.

Parameters:
es - the AbstractEdgeSet to consider for this operation
Returns:
a vertexSet of all the neighbours of this vertex.

getDegree

public int getDegree(AbstractGraph graph)
Returns the degree of the vertex in a AbstractGraph. this method is equivalent to degree(graph.getAbstractEdgeSet());

Parameters:
graph - the AbstractGraph where to compute the degree
Returns:
the degree of the vertex.

getInDegree

public int getInDegree(AbstractGraph graph)
Returns the in degree of the vertex in a AbstractGraph, ie the number of incoming abstractEdges.

Parameters:
graph - the AbstractGraph where to compute the degree
Returns:
the in degree of the vertex.

getOutDegree

public int getOutDegree(AbstractGraph graph)
Returns the out degree of the vertex in a AbstractGraph, ie the number of outgoing abstractEdges.

Parameters:
graph - the AbstractGraph where to compute the degree
Returns:
the out degree of the vertex.

getIncoming

public AbstractEdgeSet getIncoming(AbstractGraph graph)
Returns a set of incoming abstractEdges for this vertex.

Parameters:
graph - the AbstractGraph to consider for this operation.
Returns:
a edgeSet of all incoming abstractEdges.

getOutgoing

public AbstractEdgeSet getOutgoing(AbstractGraph graph)
Returns a set of outgoing abstractEdges for this vertex.

Parameters:
graph - the AbstractGraph to consider for this operation.
Returns:
a edgeSet of all outgoing abstractEdges.

getIncidentEdges

public AbstractEdgeSet getIncidentEdges(AbstractGraph graph)
Returns a set of incoming and outgoing abstractEdges for this vertex.

Parameters:
graph - the AbstractGraph to consider for this operation.
Returns:
a edgeSet of all incoming and outgoing abstractEdges.

getNeighbours

public AbstractVertexSet getNeighbours(AbstractGraph graph)
Returns a set of vertices which are neighbours of this vertex.

Returns:
a vertexSet of all the neighbors of this vertex.

getConnected

public AbstractVertex getConnected(AbstractEdge abstractEdge)
Returns the vertex on the opposite side of this vertex on abstractEdge

Parameters:
abstractEdge - the abstractEdge
Returns:
the opposite vertex, null if there is no opposite vertex in abstractEdge.

getEdgesTo

public AbstractEdgeSet getEdgesTo(AbstractEdgeSet aes,
                                  AbstractVertex abstractVertex)
Construct an EdgeSet containing the edges leading to a vertex. The set returned is not editable. This set is a subset of aes and contains all edges connected to abstractVertex.

Parameters:
abstractVertex - the vertex we want the edges connected to
Returns:
an edgeset not editable

getEdgesTo

public AbstractEdgeSet getEdgesTo(AbstractGraph ag,
                                  AbstractVertex abstractVertex)
Construct an EdgeSet containing the edges leading to a vertex. The set returned is not editable. This set is a subset of the edge set of the graph and contains all edges connected to abstractVertex.

Parameters:
ag - the graph set to consider
abstractVertex - the vertex we want the edges connected to
Returns:
an edgeset not editable

order

public static int order()
Counts all abstract vertices.

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