|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NetworkSearchCallback
This interface must be implemented by classes which function as callback
adapter for the network search functions
ProteinNetwork.depthFirstSearch(int, NetworkSearchCallback)
and
ProteinNetwork.breadthFirstSearch(int, NetworkSearchCallback)
. A
callback adapter has two functions: (1) It receives the nodes passed during
the network search in the order they are visited and (2) it can stop the
network search at any point.
Example
The interface can be implemented by any class or inner class. A quick way to write a callback adapter is to use an anonymous inner class:
net.depthFirstSearch(1, new NetworkSearchCallback() { public boolean reportNode(int protein) { System.out.println("Passed node: " + protein); if (/*we want to go on*/) return true; else // stop the search return false; } });
Method Summary | |
---|---|
boolean |
reportNode(int protein)
Implemented by network search callback adapters. |
Method Detail |
---|
boolean reportNode(int protein)
protein
- protein which was just passed in the network search
true
if the search should go on, false
to stop
the search
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |