1 public class ElementEdge {
2 private final Tuple p1;
3 private final Tuple p2;
4 private final int hashvalue;
12 public ElementEdge(Tuple a, Tuple b) {
21 tmphashval = 37 * tmphashval + p1.hashCode();
22 tmphashval = 37 * tmphashval + p2.hashCode();
23 hashvalue = tmphashval;
26 public ElementEdge(ElementEdge rhs) {
29 hashvalue = rhs.hashvalue;
32 public boolean equals(Object obj) {
33 if (!(obj instanceof ElementEdge))
35 ElementEdge edge = (ElementEdge) obj;
36 return p1.equals(edge.p1) && p2.equals(edge.p2);
39 public int hashCode() {
43 public boolean notEqual(ElementEdge rhs) {
47 public boolean lessThan(ElementEdge rhs) {
48 return p1.lessThan(rhs.p1) || p1.equals(rhs.p1) && p2.lessThan(rhs.p2);
51 public boolean greaterThan(ElementEdge rhs) {
52 return p1.greaterThan(rhs.p1) || p1.equals(rhs.p1) && p2.greaterThan(rhs.p2);
55 public Tuple getPoint(int i) {
66 public String toString() {
67 return "<"+p1.toString()+(", ")+p2.toString()+">";