Package com.alexmerz.graphviz.objects
Class Node
- java.lang.Object
-
- com.alexmerz.graphviz.objects.Node
-
public class Node extends Object
This class represents a node in a graph.
-
-
Constructor Summary
Constructors Constructor Description Node()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAttribute(String key)Returns the attribute of the nodeHashtable<String,String>getAttributes()Returns all attributes of the edge.IdgetId()Returns the id object for the nodebooleanisSubgraph()Returns true, if the node object represents a subgraph.voidrepresentsSubgraph(boolean isSubgraph)Sets, if the node represents a subgraphvoidsetAttribute(String key, String value)Sets the attribute of the nodevoidsetId(Id id)Sets the Id object for this nodeStringtoString()Returns a string representation of this node If the node is a subgraph, an empty string will be returned
-
-
-
Method Detail
-
getId
public Id getId()
Returns the id object for the node- Returns:
- the Id object
-
setId
public void setId(Id id)
Sets the Id object for this node- Parameters:
id-
-
toString
public String toString()
Returns a string representation of this node If the node is a subgraph, an empty string will be returned
-
getAttribute
public String getAttribute(String key)
Returns the attribute of the node- Parameters:
key- the name of the attribute- Returns:
- the value of the attribute
-
setAttribute
public void setAttribute(String key, String value)
Sets the attribute of the node- Parameters:
key- the name of the attributevalue- the value of the attribute
-
isSubgraph
public boolean isSubgraph()
Returns true, if the node object represents a subgraph.- Returns:
- true or false
-
representsSubgraph
public void representsSubgraph(boolean isSubgraph)
Sets, if the node represents a subgraph- Parameters:
isSubgraph- true if subgraph is used in edge operation
-
-