prefuse.data.tree
Class NodeBasedDeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>

java.lang.Object
  extended by prefuse.data.tree.AbstractDeclarativeTree<N,E>
      extended by prefuse.data.tree.NodeBasedDeclarativeTree<N,E>
Type Parameters:
N -
E -
All Implemented Interfaces:
DeclarativeTree<N,E>

public class NodeBasedDeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>
extends AbstractDeclarativeTree<N,E>

Implements a DeclarativeTree using the supplied node as the root node of the tree.

Author:
Anton Marsden

Constructor Summary
NodeBasedDeclarativeTree()
           
NodeBasedDeclarativeTree(N root)
           
 
Method Summary
 java.util.List<E> childEdges(N n)
          Get all the edges connecting a child to the parent node.
 java.util.List<N> children(N parent)
          Get all the children of the parent node.
 N getNextSibling(N node)
          Get the next sibling of the given node.
 N getParent(N child)
          Get a node's parent node
 E getParentEdge(N child)
          Get the edge to the given node's parent.
 N getPreviousSibling(N node)
          Get the previous sibling of the given node.
 
Methods inherited from class prefuse.data.tree.AbstractDeclarativeTree
getDepth, getNodeCount, getNodeCountFrom, getRoot, setRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeBasedDeclarativeTree

public NodeBasedDeclarativeTree(N root)

NodeBasedDeclarativeTree

public NodeBasedDeclarativeTree()
Method Detail

children

public java.util.List<N> children(N parent)
Description copied from interface: DeclarativeTree
Get all the children of the parent node.

Returns:
an list of the child nodes of the parent node

getNextSibling

public N getNextSibling(N node)
Description copied from interface: DeclarativeTree
Get the next sibling of the given node.

Specified by:
getNextSibling in interface DeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>
Overrides:
getNextSibling in class AbstractDeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>
Parameters:
node - a node
Returns:
the next sibling, or null if there is no next sibling

getPreviousSibling

public N getPreviousSibling(N node)
Description copied from interface: DeclarativeTree
Get the previous sibling of the given node.

Specified by:
getPreviousSibling in interface DeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>
Overrides:
getPreviousSibling in class AbstractDeclarativeTree<N extends Node<N,E>,E extends Edge<N,E>>
Parameters:
node - a node
Returns:
the previous sibling, or null if there is no previous sibling

getParent

public N getParent(N child)
Description copied from interface: DeclarativeTree
Get a node's parent node

Returns:
the parent node, or null if there is no parent

getParentEdge

public E getParentEdge(N child)
Description copied from interface: DeclarativeTree
Get the edge to the given node's parent.

Returns:
the parent Edge connecting the given node to its parent

childEdges

public java.util.List<E> childEdges(N n)
Description copied from interface: DeclarativeTree
Get all the edges connecting a child to the parent node.

Parameters:
n - the parent node
Returns:
an list of the child edge nodes of the parent node


Copyright © 2008 Regents of the University of California