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