Package com.yworks.util.graph
Class DefaultNetwork
- java.lang.Object
-
- com.yworks.util.graph.DefaultNetwork
-
-
Constructor Summary
Constructors Constructor Description DefaultNetwork()
-
Method Summary
All Methods Instance Methods Concrete 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
public java.lang.Object createNode()
Description copied from interface:NetworkCreates a new node object- Specified by:
createNodein interfaceNetwork- Returns:
- node
-
createEdge
public java.lang.Object createEdge(java.lang.Object source, java.lang.Object target)Description copied from interface:NetworkCreates a new edge object- Specified by:
createEdgein interfaceNetwork- Parameters:
source- - the source nodetarget- - the target node- Returns:
- edge
-
getSource
public java.lang.Object getSource(java.lang.Object edge)
Description copied from interface:NetworkGet the source node of an edge
-
getTarget
public java.lang.Object getTarget(java.lang.Object edge)
Description copied from interface:NetworkGet the target node of an edge
-
nodes
public java.util.Iterator nodes()
Description copied from interface:NetworkRetrieve an iterator to the collection of nodes this network has
-
nodesSize
public java.lang.Integer nodesSize()
Description copied from interface:NetworkHow many nodes this network has
-
edges
public java.util.Iterator edges()
Description copied from interface:NetworkRetrieve an iterator to the collection of egdes this network has
-
inEdges
public java.util.Iterator inEdges(java.lang.Object node)
Description copied from interface:NetworkReturns all ingoing edges of this node.
-
outEdges
public java.util.Iterator outEdges(java.lang.Object node)
Description copied from interface:NetworkReturns all outgoing edges of this node.
-
firstInEdge
public java.lang.Object firstInEdge(java.lang.Object node)
Description copied from interface:NetworkReturns the first ingoing edge for this node, if any.- Specified by:
firstInEdgein interfaceNetwork- Returns:
- {edge|null}
-
firstOutEdge
public java.lang.Object firstOutEdge(java.lang.Object node)
Description copied from interface:NetworkReturns the first outgoing edge for this node, if any.- Specified by:
firstOutEdgein interfaceNetwork- Returns:
- {edge|null}
-
nextInEdge
public java.lang.Object nextInEdge(java.lang.Object edge)
Description copied from interface:NetworkReturns the next edge (in insertion order) connecting source and target node, if any.- Specified by:
nextInEdgein interfaceNetwork- Parameters:
edge- - the edge for which to retrieve incoming edges- Returns:
- {edge|null}
-
nextOutEdge
public java.lang.Object nextOutEdge(java.lang.Object edge)
Description copied from interface:NetworkReturns the next edge (in insertion order) that is outgoing of target node, if any.- Specified by:
nextOutEdgein interfaceNetwork- Parameters:
edge- - the edge for which to retrieve outgoing edges- Returns:
- {edge|null}
-
edgesConnecting
public java.util.Iterator edgesConnecting(java.lang.Object source, java.lang.Object target)Description copied from interface:NetworkReturns all edges connecting source and target nodes- Specified by:
edgesConnectingin interfaceNetwork- Parameters:
source- - the source nodetarget- - the target node- Returns:
- a collection iterator of edges
-
opposite
public java.lang.Object opposite(java.lang.Object edge, java.lang.Object node)Description copied from interface:NetworkReturns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.
-
-