package MaxFlowApplet.graph; public class FlowVertex extends Vertex { // returns the color in BFS alg. public int getBFSColor() { return BFSColor; }; // sets the color in BFS public void setBFSColor(int color) { BFSColor = color; }; // returns the predecessor in BFS tree public FlowVertex getPredecessor() { return (FlowVertex) predecessor; }; // sets the predecessor in BFS tree public void setPredecessor(FlowVertex v) { predecessor = v; }; // returns the index=th neighbour (starting from 0) public FlowVertex getNeighbour(int index) { return (FlowVertex) getEdgeOut(index).getVertexTo(); }; // returns the number of neighbours public int numberOfNeighbours() { return edgeOut.size(); }; // the predecessor in the BFS tree protected FlowVertex predecessor; // the color in the BFS algorithm protected int BFSColor; };