de.fhstralsund.vinets.structure
Class AbstractGraph

java.lang.Object
  extended by de.fhstralsund.vinets.structure.DefaultNetElement
      extended by de.fhstralsund.vinets.structure.AbstractGraph
All Implemented Interfaces:
Graph, NetElement, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
SimpleGraph

public abstract class AbstractGraph
extends DefaultNetElement
implements Graph

The base class for implementations of the Graph interface.

See Also:
Serialized Form

Field Summary
protected  java.util.Set E
           
protected  GraphType gType
           
protected  java.util.Set V
           
 
Fields inherited from class de.fhstralsund.vinets.structure.DefaultNetElement
host, labelMap, original
 
Constructor Summary
protected AbstractGraph(GraphType type, java.lang.String name, NetElement host, java.lang.Object data)
           
 
Method Summary
 int countEdges()
          Returns the number of Links in this Graph.
 int countNodes()
          Returns the number of Nodes in this Graph.
 java.util.Iterator edges()
          Delivers an Iterator over all Links in this Graph.
 java.util.Set edgeSet()
          Delivers the Set of Links in this Graph.
 boolean equals(java.lang.Object o)
           
 GraphType getGraphType()
          Returns the Type of the Graph.
 int hashCode()
           
 boolean isDirected()
          All Links of a directed Graph are directed Edges between two Nodes.
 boolean isHyperGraph()
          A HyperGraph may contain HyperEdges that have more than two end vertices.
 boolean isMixed()
          A mixed Graph may contain some undirected and some directed Edges, but all Links have exactly two end Nodes.
 boolean isUndirected()
          All Links of an undirected Graph are undirected Edges between two Nodes.
 java.util.Iterator nodes()
          Delivers an Iterator over all Nodes in this Graph.
 java.util.Set nodeSet()
          Delivers the Set of Nodes in this Graph.
 java.lang.String toString()
          Returns a string representation of this NetElement.
 
Methods inherited from class de.fhstralsund.vinets.structure.DefaultNetElement
clearLabels, clone, containsLabel, getBooleanLabel, getData, getDoubleLabel, getGeometry, getHost, getID, getIntLabel, getLabel, getLabelKeySet, getName, getOriginal, getRepresentation, removeLabel, setBooleanLabel, setData, setDoubleLabel, setGeometry, setIntLabel, setLabel, setName, setRepresentation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.fhstralsund.vinets.structure.Graph
clone, createEdge, createEdge, createEdge, createNode, createNode, createNode, remove
 
Methods inherited from interface de.fhstralsund.vinets.structure.NetElement
clearLabels, containsLabel, getBooleanLabel, getData, getDoubleLabel, getGeometry, getHost, getID, getIntLabel, getLabel, getLabelKeySet, getName, getOriginal, getRepresentation, removeLabel, setBooleanLabel, setData, setDoubleLabel, setGeometry, setIntLabel, setLabel, setName, setRepresentation
 

Field Detail

V

protected java.util.Set V

E

protected java.util.Set E

gType

protected GraphType gType
Constructor Detail

AbstractGraph

protected AbstractGraph(GraphType type,
                        java.lang.String name,
                        NetElement host,
                        java.lang.Object data)
Method Detail

isDirected

public boolean isDirected()
Description copied from interface: Graph
All Links of a directed Graph are directed Edges between two Nodes.

Specified by:
isDirected in interface Graph
Returns:
true if the Graph is directed.

isUndirected

public boolean isUndirected()
Description copied from interface: Graph
All Links of an undirected Graph are undirected Edges between two Nodes.

Specified by:
isUndirected in interface Graph
Returns:
true if the Graph is undirected.

isMixed

public boolean isMixed()
Description copied from interface: Graph
A mixed Graph may contain some undirected and some directed Edges, but all Links have exactly two end Nodes.

Specified by:
isMixed in interface Graph
Returns:
true if the Graph is a mixed Graph.

isHyperGraph

public boolean isHyperGraph()
Description copied from interface: Graph
A HyperGraph may contain HyperEdges that have more than two end vertices. A HyperGraph is neither directed nor undirected.

Specified by:
isHyperGraph in interface Graph
Returns:
true if the Graph is a HyperGraph.

countNodes

public int countNodes()
Description copied from interface: Graph
Returns the number of Nodes in this Graph.

Specified by:
countNodes in interface Graph
Returns:
the number of Nodes.

countEdges

public int countEdges()
Description copied from interface: Graph
Returns the number of Links in this Graph.

Specified by:
countEdges in interface Graph
Returns:
the number of all Links (directed/undirected/hyperedges).

nodes

public java.util.Iterator nodes()
Description copied from interface: Graph
Delivers an Iterator over all Nodes in this Graph.

Specified by:
nodes in interface Graph
Returns:
an Iterator to traverse all Nodes of this Graph.

nodeSet

public java.util.Set nodeSet()
Description copied from interface: Graph
Delivers the Set of Nodes in this Graph.

Specified by:
nodeSet in interface Graph
Returns:
a Set which contains all Nodes of this Graph.

edges

public java.util.Iterator edges()
Description copied from interface: Graph
Delivers an Iterator over all Links in this Graph.

Specified by:
edges in interface Graph
Returns:
an Iterator to traverse all Links of this Graph.

edgeSet

public java.util.Set edgeSet()
Description copied from interface: Graph
Delivers the Set of Links in this Graph.

Specified by:
edgeSet in interface Graph
Returns:
a Set which contains all Links of this Graph.

getGraphType

public GraphType getGraphType()
Returns the Type of the Graph.

Specified by:
getGraphType in interface Graph
Returns:
a GraphType (DIRECTED|UNDIRECTED|MIXED|HYPERGRAPH)

toString

public java.lang.String toString()
Description copied from class: DefaultNetElement
Returns a string representation of this NetElement.

Overrides:
toString in class DefaultNetElement
Returns:
the name of this NetElement.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object