KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hammurapi > inspectors > metrics > callertrace > EdgeImpl


1 /*
2  * Created on Jan 16, 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package org.hammurapi.inspectors.metrics.callertrace;
8
9 /**
10  * @author mucbj0
11  *
12  * To change the template for this generated type comment go to
13  * Window>Preferences>Java>Code Generation>Code and Comments
14  */

15 public class EdgeImpl {
16     private Object JavaDoc nodeA;
17     private Object JavaDoc nodeB;
18
19     public EdgeImpl ( Object JavaDoc nodeA, Object JavaDoc nodeB ){
20         super();
21         this.setNodeA( nodeA );
22         this.setNodeB( nodeB );
23     }
24
25     public String JavaDoc toString(){
26
27         return nodeA.toString() + AdjacencyMatrix.KEY_SEPERATOR + nodeB.toString();
28     }
29
30     public Object JavaDoc toKey(){
31
32         return this.toString();
33     }
34
35     //!! use Interface here
36
public boolean equals ( EdgeImpl e){
37         if ( e.toKey() != null && this.toKey().equals(e.toKey() )){
38             return true;
39         } else { return false; }
40     }
41
42     /**
43      * @return Returns the nodeA.
44      */

45     public Object JavaDoc getNodeA() {
46         return nodeA;
47     }
48
49     /**
50      * @param nodeA The nodeA to set.
51      */

52     public void setNodeA(Object JavaDoc nodeA) {
53         this.nodeA = nodeA;
54     }
55
56     /**
57      * @return Returns the nodeB.
58      */

59     public Object JavaDoc getNodeB() {
60         return nodeB;
61     }
62
63     /**
64      * @param nodeB The nodeB to set.
65      */

66     public void setNodeB(Object JavaDoc nodeB) {
67         this.nodeB = nodeB;
68     }
69
70 }
71
Popular Tags