Class LinkedDirectedGraph.LinkedDiGraphNode<N,E>
java.lang.Object
com.google.javascript.jscomp.graph.LinkedDirectedGraph.LinkedDiGraphNode<N,E>
- All Implemented Interfaces:
Annotatable
,DiGraph.DiGraphNode<N,
,E> GraphNode<N,
,E> GraphvizGraph.GraphvizNode
- Enclosing class:
LinkedDirectedGraph<N,
E>
public static class LinkedDirectedGraph.LinkedDiGraphNode<N,E>
extends Object
implements DiGraph.DiGraphNode<N,E>, GraphvizGraph.GraphvizNode
A directed graph node that stores outgoing edges and incoming edges as an list within the node
itself.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
ARetrieves a piece of information that has been annotated.getColor()
Retrieves color of the node.getId()
Retrieves the unique ID.getLabel()
Retrieves the label of the node.int
Returns a nonnegative integer priority which can be used to order nodes.getValue()
Retrieves the node's value.boolean
Returns whether a priority has been set.void
setAnnotation
(Annotation data) Annotates a piece of information to the object.void
setPriority
(int priority) Sets a node priority, must be non-negative.toString()
-
Field Details
-
value
-
-
Method Details
-
getValue
Description copied from interface:GraphNode
Retrieves the node's value. -
getAnnotation
Description copied from interface:Annotatable
Retrieves a piece of information that has been annotated.- Specified by:
getAnnotation
in interfaceAnnotatable
- Returns:
- The annotation or
null
if the object has not been annotated.
-
setAnnotation
Description copied from interface:Annotatable
Annotates a piece of information to the object.- Specified by:
setAnnotation
in interfaceAnnotatable
- Parameters:
data
- Information to be annotated.
-
getColor
Description copied from interface:GraphvizGraph.GraphvizNode
Retrieves color of the node.- Specified by:
getColor
in interfaceGraphvizGraph.GraphvizNode
- Returns:
- The color of the node.
-
getId
Description copied from interface:GraphvizGraph.GraphvizNode
Retrieves the unique ID.- Specified by:
getId
in interfaceGraphvizGraph.GraphvizNode
- Returns:
- A the unique ID of the node.
-
getLabel
Description copied from interface:GraphvizGraph.GraphvizNode
Retrieves the label of the node.- Specified by:
getLabel
in interfaceGraphvizGraph.GraphvizNode
- Returns:
- Label of the node.
-
toString
-
getInEdges
- Specified by:
getInEdges
in interfaceDiGraph.DiGraphNode<N,
E>
-
getOutEdges
- Specified by:
getOutEdges
in interfaceDiGraph.DiGraphNode<N,
E>
-
hasPriority
public boolean hasPriority()Description copied from interface:DiGraph.DiGraphNode
Returns whether a priority has been set.- Specified by:
hasPriority
in interfaceDiGraph.DiGraphNode<N,
E>
-
getPriority
public int getPriority()Description copied from interface:DiGraph.DiGraphNode
Returns a nonnegative integer priority which can be used to order nodes.Throws if a priority has not been set.
- Specified by:
getPriority
in interfaceDiGraph.DiGraphNode<N,
E>
-
setPriority
public void setPriority(int priority) Description copied from interface:DiGraph.DiGraphNode
Sets a node priority, must be non-negative.- Specified by:
setPriority
in interfaceDiGraph.DiGraphNode<N,
E>
-