(int nid, BitSet bs)
| 717 | */ |
| 718 | public Node find(int nid) { return _find(nid, new BitSet()); } |
| 719 | private Node _find(int nid, BitSet bs) { |
| 720 | if( bs.get(_nid) ) return null; // Been there, done that |
| 721 | bs.set(_nid); |
| 722 | if( _nid==nid ) return this; |
| 723 | Node x; |
| 724 | for( Node def : _inputs ) if( def != null && (x = def._find(nid,bs)) != null ) return x; |
| 725 | for( Node use : _outputs ) if( use != null && (x = use._find(nid,bs)) != null ) return x; |
| 726 | return null; |
| 727 | } |
| 728 | } |