1 package prefuse.data.tuple; 2 3 import java.util.Iterator ; 4 5 import prefuse.data.Edge; 6 import prefuse.data.Graph; 7 import prefuse.data.Node; 8 import prefuse.data.Table; 9 10 15 public class TableNode extends TableTuple implements Node { 16 17 20 protected Graph m_graph; 21 22 32 protected void init(Table table, Graph graph, int row) { 33 m_table = table; 34 m_graph = graph; 35 m_row = m_table.isValidRow(row) ? row : -1; 36 } 37 38 41 public Graph getGraph() { 42 return m_graph; 43 } 44 45 48 51 public int getInDegree() { 52 return m_graph.getInDegree(this); 53 } 54 55 58 public int getOutDegree() { 59 return m_graph.getOutDegree(this); 60 } 61 62 65 public int getDegree() { 66 return m_graph.getDegree(this); 67 } 68 69 72 public Iterator inEdges() { 73 return m_graph.inEdges(this); 74 } 75 76 79 public Iterator outEdges() { 80 return m_graph.outEdges(this); 81 } 82 83 86 public Iterator edges() { 87 return m_graph.edges(this); 88 } 89 90 93 public Iterator inNeighbors() { 94 return m_graph.inNeighbors(this); 95 } 96 97 100 public Iterator outNeighbors() { 101 return m_graph.outNeighbors(this); 102 } 103 104 107 public Iterator neighbors() { 108 return m_graph.neighbors(this); 109 } 110 111 112 115 118 public Node getParent() { 119 return m_graph.getSpanningTree().getParent(this); 120 } 121 122 125 public Edge getParentEdge() { 126 return m_graph.getSpanningTree().getParentEdge(this); 127 } 128 129 132 public int getChildCount() { 133 return m_graph.getSpanningTree().getChildCount(m_row); 134 } 135 136 139 public int getChildIndex(Node child) { 140 return m_graph.getSpanningTree().getChildIndex(this, child); 141 } 142 143 146 public Node getChild(int idx) { 147 return m_graph.getSpanningTree().getChild(this, idx); 148 } 149 150 153 public Node getFirstChild() { 154 return m_graph.getSpanningTree().getFirstChild(this); 155 } 156 157 160 public Node getLastChild() { 161 return m_graph.getSpanningTree().getLastChild(this); 162 } 163 164 167 public Node getPreviousSibling() { 168 return m_graph.getSpanningTree().getPreviousSibling(this); 169 } 170 171 174 public Node getNextSibling() { 175 return m_graph.getSpanningTree().getNextSibling(this); 176 } 177 178 181 public Iterator children() { 182 return m_graph.getSpanningTree().children(this); 183 } 184 185 188 public Iterator childEdges() { 189 return m_graph.getSpanningTree().childEdges(this); 190 } 191 192 195 public int getDepth() { 196 return m_graph.getSpanningTree().getDepth(m_row); 197 } 198 199 } | Popular Tags |