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 java.lang.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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends Annotation>
AgetAnnotation()
Retrieves a piece of information that has been annotated.java.lang.String
getColor()
Retrieves color of the node.java.lang.String
getId()
Retrieves the unique ID.java.util.List<LinkedDirectedGraph.LinkedDiGraphEdge<N,E>>
getInEdges()
java.lang.String
getLabel()
Retrieves the label of the node.java.util.List<LinkedDirectedGraph.LinkedDiGraphEdge<N,E>>
getOutEdges()
int
getPriority()
Returns a nonnegative integer priority which can be used to order nodes.N
getValue()
Retrieves the node's value.boolean
hasPriority()
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.java.lang.String
toString()
-
-
-
Field Detail
-
value
protected final N value
-
-
Method Detail
-
getValue
public N getValue()
Description copied from interface:GraphNode
Retrieves the node's value.
-
getAnnotation
public <A extends Annotation> A 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
public void setAnnotation(Annotation data)
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
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getInEdges
public java.util.List<LinkedDirectedGraph.LinkedDiGraphEdge<N,E>> getInEdges()
- Specified by:
getInEdges
in interfaceDiGraph.DiGraphNode<N,E>
-
getOutEdges
public java.util.List<LinkedDirectedGraph.LinkedDiGraphEdge<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>
-
-