|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatt.grappa.Element
att.grappa.Edge
public class Edge
This class describes an edge.
Nested Class Summary | |
---|---|
(package private) static class |
Edge.Enumerator
|
Field Summary | |
---|---|
static java.lang.String |
defaultNamePrefix
Default edge name prefix used by setName(). |
(package private) int |
direction
|
private Node |
headNode
|
private java.lang.String |
headPortId
|
private java.lang.String |
key
|
private Node |
tailNode
|
private java.lang.String |
tailPortId
|
Fields inherited from class att.grappa.Element |
---|
attributes, attrsOfInterest, canonName, counter, grappaNexus, highlight, linewidth, name, object, printAllAttributes, printDefaultAttributes, selectable, usePrintList, visastamp, visible |
Constructor Summary | |
---|---|
Edge(Subgraph subg,
Node tail,
Node head)
Use this constructor when creating an edge. |
|
Edge(Subgraph subg,
Node tail,
Node head,
java.lang.String name)
Use this constructor when creating an edge with a supplied unique name for easy look-up (the name is also used as the key). |
|
Edge(Subgraph subg,
Node tail,
java.lang.String tailPort,
Node head,
java.lang.String headPort)
Use this constructor when creating an edge with ports. |
|
Edge(Subgraph subg,
Node tail,
java.lang.String tailPort,
Node head,
java.lang.String headPort,
java.lang.String key)
Use this constructor when creating an edge requiring a key to distinguish it. |
|
Edge(Subgraph subg,
Node tail,
java.lang.String tailPort,
Node head,
java.lang.String headPort,
java.lang.String key,
java.lang.String name)
Use this constructor when creating an edge requiring a key to distinguish it and a supplied lookup name. |
Method Summary | |
---|---|
static int |
attributeType(java.lang.String attrname)
Returns the attribute conversion type for the supplied attribute name. |
private void |
edgeAttrsOfInterest()
|
static Edge |
findEdgeByKey(Node tail,
Node head,
java.lang.String key)
Returns the edge with the given tail node, head node and key. |
static java.util.Enumeration |
findEdgesByEnds(Node node1,
Node node2)
Returns an enumeration of edges that have one end fixed at node1 and the other end at node2. |
Node |
getHead()
Get the node at the head end of the edge. |
java.lang.String |
getHeadPortId()
Get the head port id of the edge. |
java.lang.String |
getKey()
Get the key for this edge. |
Node |
getTail()
Get the node at the tail end of the edge. |
java.lang.String |
getTailPortId()
Get the tail port id of the edge. |
int |
getType()
Get the type of this element. |
boolean |
goesForward()
Check if the edge connects in the forward direction. |
boolean |
goesReverse()
Check if the edge connects in the reverse direction. |
boolean |
isEdge()
Check if this element is an edge. |
void |
printEdge(java.io.PrintWriter out)
Print the edge description to the provided stream. |
(package private) void |
setName()
Generates and sets the name for this edge. |
java.lang.String |
toString()
Get the String rendition of the edge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String defaultNamePrefix
setName()
,
Constant Field Valuesprivate Node headNode
private java.lang.String headPortId
private Node tailNode
private java.lang.String tailPortId
private java.lang.String key
int direction
Constructor Detail |
---|
public Edge(Subgraph subg, Node tail, Node head)
subg
- the parent subgraph.tail
- node anchoring the tail of the edge.head
- node anchoring the head of the edge.public Edge(Subgraph subg, Node tail, java.lang.String tailPort, Node head, java.lang.String headPort)
subg
- the parent subgraph.tail
- node anchoring the tail of the edge.tailPort
- the port to use within the tail node.head
- node anchoring the head of the edge.headPort
- the port to use within the head node.public Edge(Subgraph subg, Node tail, java.lang.String tailPort, Node head, java.lang.String headPort, java.lang.String key) throws java.lang.RuntimeException
subg
- the parent subgraph.tail
- node anchoring the tail of the edge.tailPort
- the port to use within the tail node.head
- node anchoring the head of the edge.headPort
- the port to use within the head node.key
- identifier (used in conjection with tail/head, but not ports) to uniquely define edge (and prevent unwanted duplicate from being created)
java.lang.RuntimeException
public Edge(Subgraph subg, Node tail, Node head, java.lang.String name) throws java.lang.RuntimeException
subg
- the parent subgraph.tail
- node anchoring the tail of the edge.head
- node anchoring the head of the edge.name
- identifier to uniquely define edge within the entire graph (reather than just between head/tail pairs)
java.lang.RuntimeException
public Edge(Subgraph subg, Node tail, java.lang.String tailPort, Node head, java.lang.String headPort, java.lang.String key, java.lang.String name) throws java.lang.RuntimeException
subg
- the parent subgraph.tail
- node anchoring the tail of the edge.tailPort
- the port to use within the tail node.head
- node anchoring the head of the edge.headPort
- the port to use within the head node.key
- identifier (used in conjection with tail/head, but not ports) to uniquely define edge (and prevent unwanted duplicate from being created)name
- a unique name that can be used for lookup (if null, automatically generated)
java.lang.RuntimeException
Method Detail |
---|
private void edgeAttrsOfInterest()
public static Edge findEdgeByKey(Node tail, Node head, java.lang.String key)
tail
- the tail node of the desired edge.head
- the head node of the desired edge.key
- the key specifying the desired edge.
findEdgesByEnds(att.grappa.Node, att.grappa.Node)
public boolean isEdge()
isEdge
in class Element
isEdge()
public int getType()
getType
in class Element
Grappa
void setName()
setName
in class Element
Element.getId()
public java.lang.String getKey()
public Node getHead()
public java.lang.String getHeadPortId()
public Node getTail()
public java.lang.String getTailPortId()
public java.lang.String toString()
toString
in class Element
public void printEdge(java.io.PrintWriter out)
out
- the output stream for writing the description.public boolean goesForward()
public boolean goesReverse()
public static int attributeType(java.lang.String attrname)
attrname
- the attribute name
public static java.util.Enumeration findEdgesByEnds(Node node1, Node node2)
node1
- one vertex of the set of edges to be returnednode2
- the other vertex of the set of edges to be returned,
or null for no constraint on the other vertex
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |