Package com.amalgamasimulation.graph
Class Graph.Node
java.lang.Object
com.amalgamasimulation.graph.Graph.Node
Represents a node of the graph.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable list of arcs coming to the node.Returns an unmodifiable list of arcs going out of the node.Returns first arc coming to the node.Returns first arc going out of the node.intgetId()Returns unique identifier of the node within the graph.getValue()Returns the value of the node.toString()
-
Field Details
-
id
protected int id -
value
-
arcsIn
-
arcsOut
-
-
Method Details
-
getValue
Returns the value of the node.- Returns:
- Value of the node
-
getArcsIn
Returns an unmodifiable list of arcs coming to the node. If no such arcs, an empty list is returned.- Returns:
- List of arcs coming to the node
-
getFirstArcIn
Returns first arc coming to the node. If no arcs come to the node, returnsnull. First arc returned by this method is always the same if graph is not changed.- Returns:
- First arc coming to the node, or
null
-
getArcsOut
Returns an unmodifiable list of arcs going out of the node. If no such arcs, an empty list is returned.- Returns:
- List of arcs going out of the node
-
getFirstArcOut
Returns first arc going out of the node. If no arcs go out of the node, returnsnull. First arc returned by this method is always the same if graph is not changed.- Returns:
- First arc going out of the node, or
null
-
getId
public int getId()Returns unique identifier of the node within the graph. Identifier is 0-based sequence number with which the node was added to the graph- Returns:
- Unique identifier of the node within the graph
-
toString
-