- public E(Vert p1, Vert p2) {
- if (p1==p2) throw new Error("attempt to create edge with single vertex: " + p1);
- this.p1 = p1;
- this.p2 = p2;
+ public E(Point p1, Point p2) {
+ if (pointset.get(p1) != null) throw new Error();
+ if (pointset.get(p2) != null) throw new Error();
+ this.p1 = new Vert(p1);
+ this.p2 = new Vert(p2);