|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.alexmerz.graphviz.objects.Graph
public class Graph
This class represents a graph. A Graph contains Nodes, Edges and Subgraphs
| Field Summary | |
|---|---|
static int |
DIRECTED
Constant for an directed graph |
static int |
UNDIRECTED
Constant for an undirected graph |
| Constructor Summary | |
|---|---|
Graph()
|
|
| Method Summary | |
|---|---|
void |
addAttribute(java.lang.String key,
java.lang.String value)
Adds a graph attribute. |
void |
addEdge(Edge e)
Adds an Edge object to the graph |
void |
addGenericEdgeAttribute(java.lang.String key,
java.lang.String value)
Sets a generic attribute for all edges of this graph. |
void |
addGenericGraphAttribute(java.lang.String key,
java.lang.String value)
Sets a generic attribute for clusters of this graph. |
void |
addGenericNodeAttribute(java.lang.String key,
java.lang.String value)
Sets a generic attribute for all nodes of this graph This attributes are NOT additionally stored in the Node objects. |
void |
addNode(Node n)
Adds a Node object to the graph |
void |
addSubgraph(Graph graph)
Adds a sub graph to a graph |
Node |
findNode(Id id)
Tries to find a node of a Graph depending on the given Id object. |
java.lang.String |
getAttribute(java.lang.String key)
Returns an attribute of the Graph or null if not found. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getAttributes()
Returns all attributes of the graph. |
java.util.ArrayList<Edge> |
getEdges()
Returns all edges of this graph. |
java.lang.String |
getGenericEdgeAttribute(java.lang.String key)
Returns a generic attribute of an edge |
java.lang.String |
getGenericGraphAttribute(java.lang.String key)
Returns a generic attribute of the clusters in the graph |
java.lang.String |
getGenericNodeAttribute(java.lang.String key)
Returns a generic attribute of a node |
Id |
getId()
Returns the Id object to the Graph |
java.util.ArrayList<Node> |
getNodes(boolean thisOnly)
Returns all Nodes of the graph. |
java.util.ArrayList<Graph> |
getSubgraphs()
Returns a list of all sub graphs. |
int |
getType()
Returns the type of the graph |
boolean |
isStrict()
Returns wether the graph is strict or not |
void |
setId(Id id)
Sets the Id object for this graph |
void |
setStrict(boolean isStrict)
Sets if the graph is strict or not. |
void |
setType(int type)
Sets the type of the graph |
java.lang.String |
toString()
Returns a String representation of the graph |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNDIRECTED
public static final int DIRECTED
| Constructor Detail |
|---|
public Graph()
| Method Detail |
|---|
public void addGenericEdgeAttribute(java.lang.String key,
java.lang.String value)
key - the attribute namevalue - the attribute valuepublic java.lang.String getGenericEdgeAttribute(java.lang.String key)
key - the attribute name
public void addGenericGraphAttribute(java.lang.String key,
java.lang.String value)
key - the attribute namevalue - the attribute valuepublic java.lang.String getGenericGraphAttribute(java.lang.String key)
key - the attribute name
public void addGenericNodeAttribute(java.lang.String key,
java.lang.String value)
key - the attribute namevalue - the attribute valuepublic java.lang.String getGenericNodeAttribute(java.lang.String key)
key - the attribute name
public void addAttribute(java.lang.String key,
java.lang.String value)
key - the name of the attributevalue - the value of the attributepublic java.lang.String getAttribute(java.lang.String key)
key - the name of the attribute
public void addNode(Node n)
n - the Node Object to addpublic void addEdge(Edge e)
e - the Edge object to addpublic Id getId()
public void setId(Id id)
id - public int getType()
DIRECTED,
UNDIRECTEDpublic void setType(int type)
type - the type of the graphDIRECTED,
UNDIRECTEDpublic boolean isStrict()
public void setStrict(boolean isStrict)
isStrict - public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.ArrayList<Graph> getSubgraphs()
public void addSubgraph(Graph graph)
graph - public Node findNode(Id id)
id - the id object to identify the node
public java.util.ArrayList<Node> getNodes(boolean thisOnly)
thisOnly - if true, also include nodes in subgraphs also, else exclude them
public java.util.Hashtable<java.lang.String,java.lang.String> getAttributes()
public java.util.ArrayList<Edge> getEdges()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||