|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alexmerz.graphviz.objects.Edge
public class Edge
This class represents an Edge in a Graph. Each Edge has a source Node and a target Node. Both nodes may contain port information. The type attribute is currently a nice-to-have because only directed edges are only allowed in 'Digraphs', and undirected in 'Graphs'.
Constructor Summary | |
---|---|
Edge()
Creates an empty edge object |
|
Edge(PortNode source,
PortNode target,
int type)
Creates an Edge |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String key)
Returns the value of an edge attribute |
java.util.Hashtable<java.lang.String,java.lang.String> |
getAttributes()
Returns all attributes of this edge |
PortNode |
getSource()
Returns the source node of the edge |
PortNode |
getTarget()
Returns the target node of the edge |
int |
getType()
Returns the type of the edge. |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Sets the value of an attribute |
void |
setSource(PortNode source)
Sets the source node of the edge |
void |
setTarget(PortNode target)
Sets the target node of the edge |
void |
setType(int type)
Sets the type of the edge |
java.lang.String |
toString()
Returns the String representation of the edge |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Edge()
public Edge(PortNode source, PortNode target, int type)
source
- the source Nodetarget
- the target Nodetype
- the edge typeMethod Detail |
---|
public PortNode getSource()
public void setSource(PortNode source)
source
- the source nodepublic PortNode getTarget()
public void setTarget(PortNode target)
target
- the target Nodepublic int getType()
Graph.UNDIRECTED
,
Graph.DIRECTED
public void setType(int type)
type
- the type of the edgeGraph.UNDIRECTED
,
Graph.DIRECTED
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getAttribute(java.lang.String key)
key
- the name of the attribute
public void setAttribute(java.lang.String key, java.lang.String value)
key
- the name of the attributevalue
- the value of the attributepublic java.util.Hashtable<java.lang.String,java.lang.String> getAttributes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |