Rev | Line | |
---|
[33] | 1 | |
---|
| 2 | package clustering; |
---|
| 3 | |
---|
| 4 | public class Edge<V> { |
---|
| 5 | V vertex1; |
---|
| 6 | V vertex2; |
---|
| 7 | |
---|
| 8 | public Edge(V vertex1, V vertex2) { |
---|
| 9 | this.vertex1 = vertex1; |
---|
| 10 | this.vertex2 = vertex2; |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | public V getVertex1() { |
---|
| 14 | return vertex1; |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | public V getVertex2() { |
---|
| 18 | return vertex2; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | public void setVertex1(V vertex1) { |
---|
| 22 | this.vertex1 = vertex1; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | public void setVertex2(V vertex2) { |
---|
| 26 | this.vertex2 = vertex2; |
---|
| 27 | } |
---|
| 28 | |
---|
[34] | 29 | @Override |
---|
| 30 | public String toString(){ |
---|
| 31 | return vertex1 + " --> "+ vertex2; |
---|
| 32 | } |
---|
[33] | 33 | |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.