[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java, 1.90, 1.91 Vertex.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-05-29 12:37:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24569/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometric.java Log Message: Refactored the copy(Map) operations in geometric Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** Surface.java 24 May 2007 10:53:13 -0000 1.162 --- Surface.java 29 May 2007 11:49:22 -0000 1.163 *************** *** 518,522 **** public Surface copy(Space space) { HashMap map = new HashMap(); ! Surface surface = copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); --- 518,522 ---- public Surface copy(Space space) { HashMap map = new HashMap(); ! Surface surface = (Surface) copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); *************** *** 533,537 **** * @return A copy */ ! public Surface copy(Map map) { Surface copy = (Surface) map.get(this); if (copy == null) { --- 533,537 ---- * @return A copy */ ! public Geometric copy(Map map) { Surface copy = (Surface) map.get(this); if (copy == null) { *************** *** 541,545 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! edges.add(current.copy(map)); } copy.setEdges(edges); --- 541,545 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! edges.add((Edge) current.copy(map)); } copy.setEdges(edges); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Edge.java 24 May 2007 10:44:53 -0000 1.90 --- Edge.java 29 May 2007 11:49:22 -0000 1.91 *************** *** 283,290 **** * @return A copy */ ! public Edge copy(Map<Edge, Edge> map) { Edge copy = (Edge) map.get(this); if (copy == null) { ! copy = new Edge(from.copy(map), to.copy(map)); map.put(this, copy); } --- 283,290 ---- * @return A copy */ ! public Geometric copy(Map map) { Edge copy = (Edge) map.get(this); if (copy == null) { ! copy = new Edge((Vertex) from.copy(map), (Vertex) to.copy(map)); map.put(this, copy); } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Vertex.java 24 May 2007 10:54:36 -0000 1.60 --- Vertex.java 29 May 2007 11:49:22 -0000 1.61 *************** *** 243,247 **** * @return A copy */ ! public Vertex copy(Map map) { Vertex copy = (Vertex) map.get(this); if (copy == null) { --- 243,247 ---- * @return A copy */ ! public Geometric copy(Map map) { Vertex copy = (Vertex) map.get(this); if (copy == null) { Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Geometric.java 21 Mar 2007 11:58:06 -0000 1.15 --- Geometric.java 29 May 2007 11:49:22 -0000 1.16 *************** *** 9,12 **** --- 9,13 ---- import java.util.Collection; + import java.util.Map; import java.util.Set; *************** *** 77,80 **** --- 78,91 ---- } + + /** + * Return a copy of this geometric + * @param map Map to map originals to copies + * @return a copy. + */ + public Geometric copy(Map map) { + throw new Error("copy must be implemented in class " + this.getClass().getName()); + } + /** * Collects the set of vertices in this geometric |