diva.graphx.toolbox
Class BasicEdgeAdapter

java.lang.Object
  extended by diva.graphx.toolbox.BasicEdgeAdapter
All Implemented Interfaces:
EdgeAdapter

public class BasicEdgeAdapter
extends Object
implements EdgeAdapter

A implementation of edge models for BasicEdges.

Version:
$Revision: 1.2 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), John Reekie (johnr@eecs.berkeley.edu)

Constructor Summary
BasicEdgeAdapter(BasicNode root)
          Create a new adapter.
 
Method Summary
 boolean acceptHead(Object edge, Object node)
          Return true if the head of the given edge can be attached to the given node.
 boolean acceptTail(Object edge, Object node)
          Return true if the tail of the given edge can be attached to the given node.
 Object getHead(Object edge)
          Return the head node of the given edge.
 NodeAdapter getHyperContent(Object edge)
          Return null.
 Object getParent(Object edge)
          Return the graph root.
 Object getTail(Object edge)
          Return the tail node of this edge.
 boolean isDirected(Object edge)
          Return true.
 boolean isHyper(Object edge)
          Return false.
 void setHead(Object edge, Object head)
          Connect an edge to the given head node.
 void setParent(Object edge, Object parent)
          Do nothing.
 void setTail(Object edge, Object tail)
          Connect an edge to the given tail node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicEdgeAdapter

public BasicEdgeAdapter(BasicNode root)
Create a new adapter.

Method Detail

acceptHead

public boolean acceptHead(Object edge,
                          Object node)
Return true if the head of the given edge can be attached to the given node.

Specified by:
acceptHead in interface EdgeAdapter

acceptTail

public boolean acceptTail(Object edge,
                          Object node)
Return true if the tail of the given edge can be attached to the given node.

Specified by:
acceptTail in interface EdgeAdapter

getHead

public Object getHead(Object edge)
Return the head node of the given edge.

Specified by:
getHead in interface EdgeAdapter

getHyperContent

public NodeAdapter getHyperContent(Object edge)
Return null. BasicEdges cannot be hyperedges.

Specified by:
getHyperContent in interface EdgeAdapter

getParent

public Object getParent(Object edge)
Return the graph root.

Specified by:
getParent in interface EdgeAdapter

getTail

public Object getTail(Object edge)
Return the tail node of this edge.

Specified by:
getTail in interface EdgeAdapter

isDirected

public boolean isDirected(Object edge)
Return true. BasicEdges are always directed.

Specified by:
isDirected in interface EdgeAdapter

isHyper

public boolean isHyper(Object edge)
Return false. BasicEdges cannot by hyperedges.

Specified by:
isHyper in interface EdgeAdapter

setHead

public void setHead(Object edge,
                    Object head)
Connect an edge to the given head node. The head node will have the edge added to its list of input edges.

Specified by:
setHead in interface EdgeAdapter

setParent

public void setParent(Object edge,
                      Object parent)
Do nothing. Basic edges always have the graph root as their parent.

Specified by:
setParent in interface EdgeAdapter

setTail

public void setTail(Object edge,
                    Object tail)
Connect an edge to the given tail node. The tail node will have the edge added to its list of output edges.

Specified by:
setTail in interface EdgeAdapter


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.