|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
An object models a Graph or HyperGraph. In a hierarchical Graph, the interface reveals the view on the inner contents of a Block as a container of Nodes and Links. The interface includes also factory methods to create the elements of a Graph. The intend is to ensure compatibility between the concrete classes of all objects belonging to the same Graph.
Method Summary | |
---|---|
java.lang.Object |
clone()
Delivers a deep copy of this Graph. |
int |
countEdges()
Returns the number of Links in this Graph. |
int |
countNodes()
Returns the number of Nodes in this Graph. |
Link |
createEdge(Node start,
Node end)
Constructs and returns a new Edge of the appropriate type. |
Link |
createEdge(Node start,
Node end,
boolean directed)
Constructs and returns a new directed or undirected Edge. |
Link |
createEdge(Node start,
Node end,
boolean directed,
java.lang.Object data)
Constructs and returns a new directed or undirected Edge with two end vertices. |
Node |
createNode()
Constructs and returns a new Node. |
Node |
createNode(java.lang.String name)
Constructs and returns a new Node. |
Node |
createNode(java.lang.String name,
java.lang.Object data)
Constructs and returns a new Node. |
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. |
GraphType |
getGraphType()
Returns the Type of this Graph. |
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. |
boolean |
remove(NetElement n)
Removes a NetElement from this Graph. |
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 |
Method Detail |
---|
boolean isDirected()
boolean isUndirected()
boolean isMixed()
boolean isHyperGraph()
int countNodes()
int countEdges()
java.util.Iterator nodes()
java.util.Set nodeSet()
java.util.Iterator edges()
java.util.Set edgeSet()
Node createNode(java.lang.String name, java.lang.Object data)
name
- a name used to identify this Node for the user.data
- external data of any kind that an application may need.
Node createNode(java.lang.String name)
name
- a name used to identify this Node for the user.
Node createNode()
Link createEdge(Node start, Node end, boolean directed, java.lang.Object data)
start
- the source Node.end
- the target Node.directed
- true if the Edge is directed.data
- external data of any kind that an application may need
java.lang.IllegalArgumentException
- if start or end have a wrong host or
the edge type is not feasible for this GraphLink createEdge(Node start, Node end, boolean directed)
start
- source Nodeend
- target Nodedirected
- true if the Edge is directed, false otherwise.
java.lang.IllegalArgumentException
- if start or end have a wrong host or
the edge type is not feasible for this GraphLink createEdge(Node start, Node end)
start
- source Nodeend
- target Node
java.lang.IllegalArgumentException
- if start or end have a wrong hostboolean remove(NetElement n)
n
- the NetElement to be removed.
java.lang.IllegalArgumentException
- if n has a type that cannot be an
element of this Graphjava.lang.Object clone()
GraphType getGraphType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |