[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java,1.3,1.4
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-08-05 10:43:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27656 Modified Files: Edge.java Log Message: added method for getting orher vertex Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Edge.java 28 Jul 2005 06:48:54 -0000 1.3 --- Edge.java 5 Aug 2005 10:43:08 -0000 1.4 *************** *** 123,126 **** --- 123,140 ---- this.from = from; } + + /** + * Return the other vertex than the given one, if the given one is one of them + * @param v The vertex + * @return the other vertex than v + */ + public Vertex otherVertex(Vertex v) { + if (v.equals(getFrom())) { + return getTo(); + } else if (v.equals(getTo())) { + return getFrom(); + } + return null; + } /** |