public interface EdgeAdapter
Edges can be hyperedges. In this case, the methods that get a head or tail node may return an unpredictable result. Methods that set a head or tail node should do nothing. The method getHyperContents() will return a node adapter, which can be used to get nodes of the hyperedge; edges in the hyperedge should then be connected to these sub-nodes.
One aspect of the edge adapter that may cause some confusion is the fact that edges must be added to and removed from their parent. Although some graph data structure do not have an explicit notion of edge parents, some do. We decided that explicitly including these methods in the interface provided the most generic support mechanism. Applications in which edges do not have a notion of parent should simply implement setParent() as a null method, and implement getParent() to always return the root graph.
See also the documentation for the NodeAdapter interface for additional notes about node and edge adapters.
NodeAdapter
Modifier and Type | Method and Description |
---|---|
boolean |
acceptHead(Object edge,
Object head)
Return whether or not the given node is a valid
head of this edge.
|
boolean |
acceptTail(Object edge,
Object tail)
Return whether or not the given node is a valid
tail of this edge.
|
Object |
getHead(Object edge)
Return the node at the head of this edge.
|
NodeAdapter |
getHyperContent(Object edge)
Get the node adapter for the content of a hyper-edge.
|
Object |
getParent(Object edge)
Return the parent of the given edge.
|
Object |
getTail(Object edge)
Return the node at the tail of this edge.
|
boolean |
isDirected(Object edge)
Return whether or not this edge is directed.
|
boolean |
isHyper(Object edge)
Return whether or not this edge is a hyperedge.
|
void |
setHead(Object edge,
Object head)
Set the node that this edge points to.
|
void |
setParent(Object edge,
Object parent)
Set the graph parent of the given edge.
|
void |
setTail(Object edge,
Object tail)
Set the node that this edge stems from.
|
boolean acceptHead(Object edge, Object head)
boolean acceptTail(Object edge, Object tail)
Object getHead(Object edge)
NodeAdapter getHyperContent(Object edge)
Object getTail(Object edge)
boolean isDirected(Object edge)
boolean isHyper(Object edge)
void setHead(Object edge, Object head)
void setParent(Object edge, Object parent)
void setTail(Object edge, Object tail)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.