|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.korelstar.math.graph.Graph
public class Graph
Mathematical Graph
Constructor Summary | |
---|---|
Graph()
Creates an empty Graph |
|
Graph(java.util.Collection nodes)
Creates a Graph with some nodes |
|
Graph(java.util.Collection nodes,
java.util.Collection edges)
Creates a Graph with some nodes and edges |
Method Summary | |
---|---|
void |
addEdge(Edge e)
Adds an edge to the graph |
void |
addNode(Node n)
Adds a node to the graph |
boolean |
containsEdge(Node source,
Node target)
Checks, if the graph contains a certain edge |
boolean |
containsNode(Node n)
Checks, if the graph contains a certain node |
boolean |
containsPath(Node source,
Node target)
Checks, if the graph contains a certain path |
java.util.Set |
getCycles(Node start)
Get all cycles in the graph, which are on the path from a certain node |
java.util.Set |
getEdges()
|
java.util.Set |
getNodes()
|
java.util.Set |
getPredecessors(Node n)
Gets the set of nodes, which has a transition to the actual node |
java.util.List |
getSerialization(Node from,
Node to)
Gets a serialization of all Nodes in the range. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Graph()
public Graph(java.util.Collection nodes)
nodes
- Collection of nodesNode
public Graph(java.util.Collection nodes, java.util.Collection edges)
nodes
- Collections of nodesedges
- Collections of edgesNode
,
Edge
Method Detail |
---|
public java.util.Set getNodes()
public void addNode(Node n)
n
- New nodepublic boolean containsNode(Node n)
n
- Node to checkpublic java.util.Set getEdges()
public void addEdge(Edge e)
e
- New edgepublic java.util.Set getPredecessors(Node n)
n
- Successor of the Nodes to find
public boolean containsEdge(Node source, Node target)
source
- Source Node of the Edgetarget
- Target Node of the Edgepublic boolean containsPath(Node source, Node target)
source
- Source Node of the Edgetarget
- Target Node of the Edgepublic java.util.Set getCycles(Node start)
start
- Node, where the detection algorithm starts
public java.util.List getSerialization(Node from, Node to)
from
- Start with this Nodeto
- Process only until this Node is reachedpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |