Package com.yworks.util.graph
Interface Network
-
- All Known Implementing Classes:
DefaultNetwork
public interface NetworkDescribes a network used in DFS analysis by the Shrinker. This is a directed graph which is capable of addition. A default implementation exists, but more elaborate backends can be used as well.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectcreateEdge(java.lang.Object source, java.lang.Object target)Creates a new edge objectjava.lang.ObjectcreateNode()Creates a new node objectjava.util.Iteratoredges()Retrieve an iterator to the collection of egdes this network hasjava.util.IteratoredgesConnecting(java.lang.Object source, java.lang.Object target)Returns all edges connecting source and target nodesjava.lang.ObjectfirstInEdge(java.lang.Object node)Returns the first ingoing edge for this node, if any.java.lang.ObjectfirstOutEdge(java.lang.Object node)Returns the first outgoing edge for this node, if any.java.lang.ObjectgetSource(java.lang.Object edge)Get the source node of an edgejava.lang.ObjectgetTarget(java.lang.Object edge)Get the target node of an edgejava.util.IteratorinEdges(java.lang.Object node)Returns all ingoing edges of this node.java.lang.ObjectnextInEdge(java.lang.Object edge)Returns the next edge (in insertion order) connecting source and target node, if any.java.lang.ObjectnextOutEdge(java.lang.Object edge)Returns the next edge (in insertion order) that is outgoing of target node, if any.java.util.Iteratornodes()Retrieve an iterator to the collection of nodes this network hasjava.lang.IntegernodesSize()How many nodes this network hasjava.lang.Objectopposite(java.lang.Object edge, java.lang.Object node)Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.java.util.IteratoroutEdges(java.lang.Object node)Returns all outgoing edges of this node.
-
-
-
Method Detail
-
createNode
java.lang.Object createNode()
Creates a new node object- Returns:
- node
-
createEdge
java.lang.Object createEdge(java.lang.Object source, java.lang.Object target)Creates a new edge object- Parameters:
source- - the source nodetarget- - the target node- Returns:
- edge
-
getSource
java.lang.Object getSource(java.lang.Object edge)
Get the source node of an edge- Parameters:
edge- - the edge to get the source of- Returns:
- node
-
getTarget
java.lang.Object getTarget(java.lang.Object edge)
Get the target node of an edge- Parameters:
edge- - the edge to get the target of- Returns:
- node
-
nodes
java.util.Iterator nodes()
Retrieve an iterator to the collection of nodes this network has- Returns:
- nodes[]
-
edges
java.util.Iterator edges()
Retrieve an iterator to the collection of egdes this network has- Returns:
- edges[]
-
nodesSize
java.lang.Integer nodesSize()
How many nodes this network has- Returns:
- number of nodes
-
inEdges
java.util.Iterator inEdges(java.lang.Object node)
Returns all ingoing edges of this node.- Returns:
- edge[]
-
outEdges
java.util.Iterator outEdges(java.lang.Object node)
Returns all outgoing edges of this node.- Returns:
- edge[]
-
firstInEdge
java.lang.Object firstInEdge(java.lang.Object node)
Returns the first ingoing edge for this node, if any.- Returns:
- {edge|null}
-
firstOutEdge
java.lang.Object firstOutEdge(java.lang.Object node)
Returns the first outgoing edge for this node, if any.- Returns:
- {edge|null}
-
nextInEdge
java.lang.Object nextInEdge(java.lang.Object edge)
Returns the next edge (in insertion order) connecting source and target node, if any.- Parameters:
edge- - the edge for which to retrieve incoming edges- Returns:
- {edge|null}
-
nextOutEdge
java.lang.Object nextOutEdge(java.lang.Object edge)
Returns the next edge (in insertion order) that is outgoing of target node, if any.- Parameters:
edge- - the edge for which to retrieve outgoing edges- Returns:
- {edge|null}
-
edgesConnecting
java.util.Iterator edgesConnecting(java.lang.Object source, java.lang.Object target)Returns all edges connecting source and target nodes- Parameters:
source- - the source nodetarget- - the target node- Returns:
- a collection iterator of edges
-
opposite
java.lang.Object opposite(java.lang.Object edge, java.lang.Object node)Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.- Parameters:
node- - the node for which to get the opposite node- Returns:
- {Node}
-
-