Class BasicNode
Object
BasicGraphable
BasicNode
- All Implemented Interfaces:
Serializable
,Graphable
,Node
- Direct Known Subclasses:
BasicXYNode
Basic implementation of Node.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge to the adjacency list of the node which is an underlying List implementation.int
Returns the degree of the node.Returns an edge in the adjacency list of the node that is adjacent to another specified node.getEdges()
Returns the edge adjacency list of the node.Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.Returns all nodes that are incident with adjacent edges minus itself.void
Removes an edge from the adjacency list of the node.Methods inherited from class BasicGraphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited, toString
-
Constructor Details
-
BasicNode
public BasicNode()Constructs a BasicNode.
-
-
Method Details
-
add
Adds an edge to the 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. -
remove
Description copied from interface:Node
Removes an edge from the adjacency list of the node. -
getDegree
public int getDegree()Description copied from interface:Node
Returns the degree of the node. The degree of a node is defined as the number of edges that are adjacent to the node. -
getEdge
Description copied from interface:Node
Returns an edge in the adjacency list of the node that is adjacent to another specified node.
Note: It is possible for two nodes to share multiple edges between them. In this case, getEdges(Node other) can be used to obtain a complete list. -
getEdges
Description copied from interface:Node
Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node. -
getEdges
Description copied from interface:Node
Returns the edge adjacency list of the node. -
getRelated
Returns all nodes that are incident with adjacent edges minus itself. This iterator is generated by calculating an underlying collection upon each method call.- Specified by:
getRelated
in interfaceGraphable
- Returns:
- Iterator An iterator over other components of the graph that are related to the component.
- See Also:
-