@Override public int getNodeIndex(int arg0) { return super.getNodeIndex(arg0); }
/** * Get the Node tuple corresponding to the input node key field value. * The node key field is used to find the node id (node table row number), * which is then used to retrieve the Node tuple. * @param key a node key field value * @return the requested Node instance */ public Node getNodeFromKey(long key) { int n = getNodeIndex(key); return (n<0 ? null : getNode(n) ); }
/** * Get the source node id (node table row number) for the given edge * id (edge table row number). * @param edge an edge id (edge table row number) * @return the source node id (node table row number) */ public int getSourceNode(int edge) { return getNodeIndex(getEdgeTable().getLong(edge, m_skey)); }
/** * Get the node row index value for the given key. * TODO: test this more thoroughly? */ public int getNodeIndex(int key) { if ( m_nkey == null ) { return ((VisualTable)getNodeTable()).getChildRow(key); } else { return super.getNodeIndex(key); } }
/** * Get the target node id (node table row number) for the given edge * id (edge table row number). * @param edge an edge id (edge table row number) * @return the target node id (node table row number) */ public int getTargetNode(int edge) { return getNodeIndex(getEdgeTable().getLong(edge, m_tkey)); }
public void columnChanged(Column src, int idx, long prev) { if ( src==m_scol || src==m_tcol ) { boolean isSrc = src==m_scol; int e = m_edges.getTableRow(idx, isSrc?m_sidx:m_tidx); if ( e == -1 ) return; // edge not in this graph int s = getSourceNode(e); int t = getTargetNode(e); int p = getNodeIndex(prev); if ( p > -1 && ((isSrc && t > -1) || (!isSrc && s > -1)) ) updateDegrees(e, isSrc?p:s, isSrc?t:p, -1); if ( s > -1 && t > -1 ) updateDegrees(e, s, t, 1); } else { throw new IllegalStateException(); } }