01: /*
02: * Created on Jan 16, 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.hammurapi.inspectors.metrics.callertrace;
08:
09: /**
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 nodeA;
17: private Object nodeB;
18:
19: public EdgeImpl(Object nodeA, Object nodeB) {
20: super ();
21: this .setNodeA(nodeA);
22: this .setNodeB(nodeB);
23: }
24:
25: public String toString() {
26:
27: return nodeA.toString() + AdjacencyMatrix.KEY_SEPERATOR
28: + nodeB.toString();
29: }
30:
31: public Object toKey() {
32:
33: return this .toString();
34: }
35:
36: //!! use Interface here
37: public boolean equals(EdgeImpl e) {
38: if (e.toKey() != null && this .toKey().equals(e.toKey())) {
39: return true;
40: } else {
41: return false;
42: }
43: }
44:
45: /**
46: * @return Returns the nodeA.
47: */
48: public Object getNodeA() {
49: return nodeA;
50: }
51:
52: /**
53: * @param nodeA The nodeA to set.
54: */
55: public void setNodeA(Object nodeA) {
56: this .nodeA = nodeA;
57: }
58:
59: /**
60: * @return Returns the nodeB.
61: */
62: public Object getNodeB() {
63: return nodeB;
64: }
65:
66: /**
67: * @param nodeB The nodeB to set.
68: */
69: public void setNodeB(Object nodeB) {
70: this.nodeB = nodeB;
71: }
72:
73: }
|