[Bprocessor-commit] /model/src/net/sourceforge/bprocessor/model Edge.java, 1.89, 1.90
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-05-24 10:44:54
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12759/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Some generics Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Edge.java 20 May 2007 10:29:23 -0000 1.89 --- Edge.java 24 May 2007 10:44:53 -0000 1.90 *************** *** 94,99 **** * @return Collection of edges that coincides */ ! public static Set findEdge(Collection edges, Vertex vertex) { ! Set result = new HashSet(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 94,99 ---- * @return Collection of edges that coincides */ ! public static Set<Edge> findEdge(Collection<Edge> edges, Vertex vertex) { ! Set<Edge> result = new HashSet<Edge>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 283,287 **** * @return A copy */ ! public Edge copy(Map map) { Edge copy = (Edge) map.get(this); if (copy == null) { --- 283,287 ---- * @return A copy */ ! public Edge copy(Map<Edge, Edge> map) { Edge copy = (Edge) map.get(this); if (copy == null) { *************** *** 412,417 **** * @return a list containing the two new edges */ ! public Collection split(Vertex vertex) { ! List added = new ArrayList(); Vertex from = getFrom(); Vertex to = getTo(); --- 412,417 ---- * @return a list containing the two new edges */ ! public List<Edge> split(Vertex vertex) { ! List<Edge> added = new ArrayList<Edge>(); Vertex from = getFrom(); Vertex to = getTo(); *************** *** 586,591 **** * @return the set of vertices */ ! public Set collect() { ! Set result = new HashSet(); result.add(this.to); result.add(this.from); --- 586,591 ---- * @return the set of vertices */ ! public Set<Vertex> collect() { ! Set<Vertex> result = new HashSet<Vertex>(); result.add(this.to); result.add(this.from); *************** *** 630,634 **** */ public static Set<Surface> surfaces(Collection edges) { ! Set surfaces = new HashSet<Surface>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 630,634 ---- */ public static Set<Surface> surfaces(Collection edges) { ! Set<Surface> surfaces = new HashSet<Surface>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 648,656 **** * @return an offset-direction map for each vertex */ ! public static Map offsetDirections(List which, Surface inner, double offset) { ! Map offsets = new HashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! offsets.put(it.next(), Double.valueOf(offset)); } return offsetDirections(which, inner, offsets); --- 648,656 ---- * @return an offset-direction map for each vertex */ ! public static Map<Vertex, Vertex> offsetDirections(List<Edge> which, Surface inner, ! double offset) { ! Map<Edge, Double> offsets = new HashMap<Edge, Double>(); ! for (Edge e : which) { ! offsets.put(e, Double.valueOf(offset)); } return offsetDirections(which, inner, offsets); *************** *** 667,672 **** * @return an offset-direction map for each vertex */ ! public static Map offsetDirections(List which, Surface inner, Map offsetMap) { ! Map v2Dir = new HashMap(); Edge e1 = null; Edge e2 = null; --- 667,673 ---- * @return an offset-direction map for each vertex */ ! public static Map<Vertex, Vertex> offsetDirections(List<Edge> which, Surface inner, ! Map<Edge, Double> offsetMap) { ! Map<Vertex, Vertex> v2Dir = new HashMap<Vertex, Vertex>(); Edge e1 = null; Edge e2 = null; *************** *** 750,759 **** * @return a list of the constructed edges. */ ! public static List placeOffset(List which, Surface inner, Map offsetMap) { ! Map v2v = new HashMap(); ! Map e2e = new LinkedHashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); Vertex from = e.getFrom(); Vertex to = e.getTo(); --- 751,758 ---- * @return a list of the constructed edges. */ ! public static List placeOffset(List<Edge> which, Surface inner, Map<Edge, Double> offsetMap) { ! Map<Vertex, Vertex> v2v = new HashMap<Vertex, Vertex>(); ! Map<Edge, Edge> e2e = new LinkedHashMap<Edge, Edge>(); ! for (Edge e : which) { Vertex from = e.getFrom(); Vertex to = e.getTo(); *************** *** 813,817 **** } } ! return new LinkedList(e2e.values()); } --- 812,816 ---- } } ! return new LinkedList<Edge>(e2e.values()); } *************** *** 827,831 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, double offset) { return offset(which, inner, offset, null); } --- 826,830 ---- * @return The generated list of Edges */ ! public static List<Edge> offset(List<Edge> which, Surface inner, double offset) { return offset(which, inner, offset, null); } *************** *** 840,848 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, double offset, Map directions) { ! Map offsetMap = new HashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! offsetMap.put(it.next(), Double.valueOf(offset)); } return offset(which, inner, offsetMap, directions); --- 839,847 ---- * @return The generated list of Edges */ ! public static List <Edge> offset(List<Edge> which, Surface inner, ! double offset, Map<Vertex, Direction> directions) { ! Map<Edge, Double> offsetMap = new HashMap<Edge, Double>(); ! for (Edge e : which) { ! offsetMap.put(e, Double.valueOf(offset)); } return offset(which, inner, offsetMap, directions); *************** *** 858,870 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, Map offsetMap, Map directions) { ! HashSet edges = new HashSet(which); ! ArrayList res = new ArrayList(); if (directions == null) { ! directions = new HashMap(); } ! HashMap to2edge = new HashMap(); ! HashMap from2edge = new HashMap(); ! HashMap v2v = new HashMap(); Edge prevEdge = null; Edge firstEdge = null; --- 857,870 ---- * @return The generated list of Edges */ ! public static List<Edge> offset(List<Edge> which, Surface inner, ! Map<Edge, Double> offsetMap, Map<Vertex, Direction> directions) { ! HashSet<Edge> edges = new HashSet<Edge>(which); ! ArrayList<Edge> res = new ArrayList<Edge>(); if (directions == null) { ! directions = new HashMap<Vertex, Direction>(); } ! HashMap<Vertex, Edge> to2edge = new HashMap<Vertex, Edge>(); ! HashMap<Vertex, Edge> from2edge = new HashMap<Vertex, Edge>(); ! HashMap<Vertex, Vertex> v2v = new HashMap<Vertex, Vertex>(); Edge prevEdge = null; Edge firstEdge = null; |