Class BasicDirectedNode
Object
BasicGraphable
BasicDirectedNode
- All Implemented Interfaces:
Serializable
,DirectedGraphable
,DirectedNode
,Graphable
,Node
- Direct Known Subclasses:
BasicDirectedXYNode
Basic implementation of DirectedNode.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Unsupported operation.void
Adds an edge to the in adjacency list of the node which is an underlying List implementation.void
Adds an edge to the ou adjacency list of the node which is an underlying List implementation.int
Returns sum of sizes of in and out adjacency lists.First searches for an in edge with an out node == this, and in node == other.getEdges()
Returns the combination of both the in and out adjacency lists.A combination of the results of getInEdges(Node) and getOutEdges(Node).int
Returns the in degree of the node.getInEdge
(DirectedNode other) Returns an edge that terminates at the node and originates from a specified node.Returns the in adjacency list of the node.getInEdges
(DirectedNode other) Returns all edges that terminate at the node and originate from a specified node.Returns all in nodes of in edges.int
Returns the out degree of the node.getOutEdge
(DirectedNode other) Returns an edge that originates at the node and terminates at a specified node.Returns the out adjacency list of the node.getOutEdges
(DirectedNode other) Returns all edges that originate at the node and terminate from at specified node.Returns all out nodes of out edges.Returns an iterator over all out nodes of out edges and in nodes of in edges.void
Removes the edge from both the in and out adjacency lists.void
Removes an edge from the in adjacency list of the node.void
Removes an edge from the out adjacency list of node.Methods inherited from class BasicGraphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited, toString
-
Constructor Details
-
BasicDirectedNode
public BasicDirectedNode()Constructs a new BasicDirectedNode.
-
-
Method Details
-
add
Unsupported operation. Directed nodes classify edges as in and out. addIn(Edge) and addOut(Edge) should be used instead of this method. -
addIn
Adds an edge to the in adjacency list of the node which is an underlying List implementation. No checking is done on the edge (duplication, looping...), it is simply added to the list. It is also assumed that the edge being added has the node as its out node.- Specified by:
addIn
in interfaceDirectedNode
- Parameters:
e
- A directed edge that terminates at the node.- See Also:
-
addOut
Adds an edge to the ou adjacency list of the node which is an underlying List implementation. No checking is done on the edge (duplication, looping...), it is simply added to the list. It is also assumed that the edge being added has the node as its in node.- Specified by:
addOut
in interfaceDirectedNode
- Parameters:
e
- A directed edge that originates from the node.- See Also:
-
remove
Removes the edge from both the in and out adjacency lists. -
removeIn
Description copied from interface:DirectedNode
Removes an edge from the in adjacency list of the node.- Specified by:
removeIn
in interfaceDirectedNode
- Parameters:
e
- A directed edge that terminates at the node.- See Also:
-
removeOut
Description copied from interface:DirectedNode
Removes an edge from the out adjacency list of node.- Specified by:
removeOut
in interfaceDirectedNode
- Parameters:
e
- A directed edge that originates from the node.- See Also:
-
getEdge
First searches for an in edge with an out node == this, and in node == other. If none is found an edge with out node == other, and in node == this is searched for. -
getInEdge
Description copied from interface:DirectedNode
Returns an edge that terminates at the node and originates from a specified node.
Note: It is possible for two nodes to share multiple edges between them. In this case, getInEdges(Node other) can be used to obtain a complete list.- Specified by:
getInEdge
in interfaceDirectedNode
- Parameters:
other
- The originating node.- Returns:
- The first edge found to terminate at the node and originate from the specefied node.
- See Also:
-
getOutEdge
Description copied from interface:DirectedNode
Returns an edge that originates at the node and terminates at a specified node.
Note: It is possible for two nodes to share multiple edges between them. In this case, getOutEdges(Node other) can be used to obtain a complete list.- Specified by:
getOutEdge
in interfaceDirectedNode
- Parameters:
other
- The terminating node.- Returns:
- The first edge found to originate at the node and terminate at the specefied node.
- See Also:
-
getEdges
Returns the combination of both the in and out adjacency lists. -
getInEdges
Description copied from interface:DirectedNode
Returns the in adjacency list of the node.- Specified by:
getInEdges
in interfaceDirectedNode
- Returns:
- A list of edges that terminate at the node.
- See Also:
-
getOutEdges
Description copied from interface:DirectedNode
Returns the out adjacency list of the node.- Specified by:
getOutEdges
in interfaceDirectedNode
- Returns:
- A list of edges originating at the node.
- See Also:
-
getEdges
A combination of the results of getInEdges(Node) and getOutEdges(Node). -
getInEdges
Description copied from interface:DirectedNode
Returns all edges that terminate at the node and originate from a specified node.- Specified by:
getInEdges
in interfaceDirectedNode
- Parameters:
other
- The originating node.- Returns:
- All edges found to terminate at the node and originate from the specified node.
- See Also:
-
getOutEdges
Description copied from interface:DirectedNode
Returns all edges that originate at the node and terminate from at specified node.- Specified by:
getOutEdges
in interfaceDirectedNode
- Parameters:
other
- The temimnating node.- Returns:
- All edges found to originate at the node and terminate at the specified node.
- See Also:
-
getDegree
public int getDegree()Returns sum of sizes of in and out adjacency lists. -
getInDegree
public int getInDegree()Description copied from interface:DirectedNode
Returns the in degree of the node.- Specified by:
getInDegree
in interfaceDirectedNode
- Returns:
- The number of edges that terminate at the node.
- See Also:
-
getOutDegree
public int getOutDegree()Description copied from interface:DirectedNode
Returns the out degree of the node.- Specified by:
getOutDegree
in interfaceDirectedNode
- Returns:
- The number of edges that originate at the node.
- See Also:
-
getRelated
Returns an iterator over all out nodes of out edges and in nodes of in edges.- Specified by:
getRelated
in interfaceGraphable
- Returns:
- Iterator An iterator over other components of the graph that are related to the component.
- See Also:
-
getInRelated
Returns all in nodes of in edges.- Specified by:
getInRelated
in interfaceDirectedGraphable
- Returns:
- An iterator over the other directed components related through an in relationship.
- See Also:
-
getOutRelated
Returns all out nodes of out edges.- Specified by:
getOutRelated
in interfaceDirectedGraphable
- Returns:
- An iterator over the other directed components related through an out relationship.
- See Also:
-