prefuse.data.tuple
Class TableNode

java.lang.Object
  extended by prefuse.data.tuple.TableTuple<TableNode>
      extended by prefuse.data.tuple.TableNode
All Implemented Interfaces:
Node<TableNode,TableEdge>, Tuple<TableNode>

public class TableNode
extends TableTuple<TableNode>
implements Node<TableNode,TableEdge>

Node implementation that reads Node data from a backing node table.

Author:
jeffrey heer

Field Summary
protected  Graph<TableTuple<?>,TableNode,TableEdge> m_graph
          The backing graph.
 
Fields inherited from class prefuse.data.tuple.TableTuple
m_row, m_table
 
Constructor Summary
TableNode()
           
 
Method Summary
 java.util.List<TableEdge> childEdges()
          Get an iterator over the edges from this node to its tree children.
 java.util.List<TableNode> children()
          Get an iterator over this node's tree children.
 java.util.List<TableEdge> edges()
          Get an iterator over all incident edges, those for which this node is either the source or the target.
 int getDegree()
          Get the degree of the node, the number of edges for which this node is either the source or the target.
 int getDepth()
          Get the tree depth of this node.
 Graph<?,TableNode,TableEdge> getGraph()
           
 int getInDegree()
          Get the in-degree of the node, the number of edges for which this node is the target.
 TableNode getNextSibling()
          Get this node's next tree sibling.
 int getOutDegree()
          Get the out-degree of the node, the number of edges for which this node is the source.
 TableNode getParent()
          Get the parent node of this node in a tree structure.
 TableEdge getParentEdge()
          Get the edge between this node and its parent node in a tree structure.
 TableNode getPreviousSibling()
          Get this node's previous tree sibling.
 java.util.List<TableEdge> inEdges()
          Get an iterator over all incoming edges, those for which this node is the target.
 void init(Table<?> table, Graph<?,?,?> graph, int row)
          Initialize a new Node backed by a node table.
 java.util.List<TableNode> inNeighbors()
          Get an iterator over all adjacent nodes connected to this node by an incoming edge (i.e., all nodes that "point" at this one).
 java.util.List<TableNode> neighbors()
          Get an iterator over all nodes connected to this node.
 java.util.List<TableEdge> outEdges()
          Get an iterator over all outgoing edges, those for which this node is the source.
 java.util.List<TableNode> outNeighbors()
          Get an iterator over all adjacent nodes connected to this node by an outgoing edge (i.e., all nodes "pointed" to by this one).
 
Methods inherited from class prefuse.data.tuple.TableTuple
canGet, canGetBoolean, canGetDate, canGetDouble, canGetFloat, canGetInt, canGetLong, canGetString, canSet, canSetBoolean, canSetDate, canSetDouble, canSetFloat, canSetInt, canSetLong, canSetString, get, get, getBoolean, getBoolean, getColumnCount, getColumnIndex, getColumnName, getColumnType, getColumnType, getDate, getDate, getDefault, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getRow, getSchema, getString, getString, getTable, invalidate, isValid, revertToDefault, set, set, setBoolean, setBoolean, setDate, setDate, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setString, setString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface prefuse.data.Tuple
canGet, canGetBoolean, canGetDate, canGetDouble, canGetFloat, canGetInt, canGetLong, canGetString, canSet, canSetBoolean, canSetDate, canSetDouble, canSetFloat, canSetInt, canSetLong, canSetString, get, get, getBoolean, getBoolean, getColumnCount, getColumnIndex, getColumnName, getColumnType, getColumnType, getDate, getDate, getDefault, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getRow, getSchema, getString, getString, getTable, invalidate, isValid, revertToDefault, set, set, setBoolean, setBoolean, setDate, setDate, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setString, setString
 

Field Detail

m_graph

protected Graph<TableTuple<?>,TableNode,TableEdge> m_graph
The backing graph.

Constructor Detail

TableNode

public TableNode()
Method Detail

init

public void init(Table<?> table,
                 Graph<?,?,?> graph,
                 int row)
Initialize a new Node backed by a node table. This method is used by the appropriate TupleManager instance, and should not be called directly by client code, unless by a client-supplied custom TupleManager.

Specified by:
init in interface Tuple<TableNode>
Overrides:
init in class TableTuple<TableNode>
Parameters:
table - the node Table
graph - the backing Graph
row - the row in the node table to which this Node instance corresponds.

getGraph

public Graph<?,TableNode,TableEdge> getGraph()

getInDegree

public int getInDegree()
Description copied from interface: Node
Get the in-degree of the node, the number of edges for which this node is the target.

Specified by:
getInDegree in interface Node<TableNode,TableEdge>
Returns:
the in-degree of the node
See Also:
Node.getInDegree()

getOutDegree

public int getOutDegree()
Description copied from interface: Node
Get the out-degree of the node, the number of edges for which this node is the source.

Specified by:
getOutDegree in interface Node<TableNode,TableEdge>
Returns:
the out-degree of the node
See Also:
Node.getOutDegree()

getDegree

public int getDegree()
Description copied from interface: Node
Get the degree of the node, the number of edges for which this node is either the source or the target.

Specified by:
getDegree in interface Node<TableNode,TableEdge>
Returns:
the total degree of the node
See Also:
Node.getDegree()

inEdges

public java.util.List<TableEdge> inEdges()
Description copied from interface: Node
Get an iterator over all incoming edges, those for which this node is the target.

Specified by:
inEdges in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all incoming edges
See Also:
Node.inEdges()

outEdges

public java.util.List<TableEdge> outEdges()
Description copied from interface: Node
Get an iterator over all outgoing edges, those for which this node is the source.

Specified by:
outEdges in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all outgoing edges
See Also:
Node.outEdges()

edges

public java.util.List<TableEdge> edges()
Description copied from interface: Node
Get an iterator over all incident edges, those for which this node is either the source or the target.

Specified by:
edges in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all incident edges
See Also:
Node.edges()

inNeighbors

public java.util.List<TableNode> inNeighbors()
Description copied from interface: Node
Get an iterator over all adjacent nodes connected to this node by an incoming edge (i.e., all nodes that "point" at this one).

Specified by:
inNeighbors in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all neighbors with in-links on this node
See Also:
Node.inNeighbors()

outNeighbors

public java.util.List<TableNode> outNeighbors()
Description copied from interface: Node
Get an iterator over all adjacent nodes connected to this node by an outgoing edge (i.e., all nodes "pointed" to by this one).

Specified by:
outNeighbors in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all neighbors with out-links from this node
See Also:
Node.outNeighbors()

neighbors

public java.util.List<TableNode> neighbors()
Description copied from interface: Node
Get an iterator over all nodes connected to this node.

Specified by:
neighbors in interface Node<TableNode,TableEdge>
Returns:
an Iterator over all neighbors of this node
See Also:
Node.neighbors()

getParent

public TableNode getParent()
Description copied from interface: Node
Get the parent node of this node in a tree structure.

Specified by:
getParent in interface Node<TableNode,TableEdge>
Returns:
this node's parent node, or null if there is none.
See Also:
Node.getParent()

getParentEdge

public TableEdge getParentEdge()
Description copied from interface: Node
Get the edge between this node and its parent node in a tree structure.

Specified by:
getParentEdge in interface Node<TableNode,TableEdge>
Returns:
the edge between this node and its parent
See Also:
Node.getParentEdge()

getPreviousSibling

public TableNode getPreviousSibling()
Description copied from interface: Node
Get this node's previous tree sibling.

Specified by:
getPreviousSibling in interface Node<TableNode,TableEdge>
Returns:
the previous sibling, or null if none
See Also:
Node.getPreviousSibling()

getNextSibling

public TableNode getNextSibling()
Description copied from interface: Node
Get this node's next tree sibling.

Specified by:
getNextSibling in interface Node<TableNode,TableEdge>
Returns:
the next sibling, or null if none
See Also:
Node.getNextSibling()

children

public java.util.List<TableNode> children()
Description copied from interface: Node
Get an iterator over this node's tree children.

Specified by:
children in interface Node<TableNode,TableEdge>
Returns:
an iterator over this node's children
See Also:
Node.children()

childEdges

public java.util.List<TableEdge> childEdges()
Description copied from interface: Node
Get an iterator over the edges from this node to its tree children.

Specified by:
childEdges in interface Node<TableNode,TableEdge>
Returns:
an iterator over the edges to the child nodes
See Also:
Node.childEdges()

getDepth

public int getDepth()
Description copied from interface: Node
Get the tree depth of this node.

Specified by:
getDepth in interface Node<TableNode,TableEdge>
Returns:
the tree depth of this node. The root's tree depth is zero, and each level of the tree is one depth level greater.
See Also:
Node.getDepth()


Copyright © 2008 Regents of the University of California