Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32113/src/net/sourceforge/bprocessor/model
Modified Files:
Geometric.java Constructor.java
Log Message:
made small changes to constructors to use generics
Index: Geometric.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Geometric.java 13 Oct 2006 07:54:58 -0000 1.13
--- Geometric.java 6 Feb 2007 17:27:18 -0000 1.14
***************
*** 81,85 ****
* @return the set of vertices
*/
! public abstract Set collect();
/**
--- 81,85 ----
* @return the set of vertices
*/
! public abstract Set<Vertex> collect();
/**
Index: Constructor.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Constructor.java 2 Jan 2007 17:48:58 -0000 1.15
--- Constructor.java 6 Feb 2007 17:27:18 -0000 1.16
***************
*** 35,39 ****
/** Set of geometrics connected to this constructor */
! private Set connectedGeometry = new HashSet();
/**
* Do not use, for persistence use only
--- 35,39 ----
/** Set of geometrics connected to this constructor */
! private Set<Geometric> connectedGeometry = new HashSet<Geometric>();
/**
* Do not use, for persistence use only
***************
*** 104,116 ****
/** {@inheritDoc} */
! public Set collect() {
! Set res = new HashSet();
res.add(getOrigin());
! Iterator it = connectedGeometry.iterator();
while (it.hasNext()) {
! Object o = it.next();
! if (o instanceof Geometric) {
! res.addAll(((Geometric)o).collect());
! }
}
return res;
--- 104,113 ----
/** {@inheritDoc} */
! public Set<Vertex> collect() {
! Set<Vertex> res = new HashSet<Vertex>();
res.add(getOrigin());
! Iterator<Geometric> it = connectedGeometry.iterator();
while (it.hasNext()) {
! res.addAll((it.next()).collect());
}
return res;
***************
*** 149,153 ****
* @param s a set of geometrics
*/
! public void connect(Set s) {
connectedGeometry.addAll(s);
}
--- 146,150 ----
* @param s a set of geometrics
*/
! public void connect(Set<Geometric> s) {
connectedGeometry.addAll(s);
}
***************
*** 158,162 ****
*/
public void connect(Geometric g) {
! connectedGeometry.add(g);
}
--- 155,161 ----
*/
public void connect(Geometric g) {
! if (!connectedGeometry.contains(g)) {
! connectedGeometry.add(g);
! }
}
***************
*** 167,171 ****
* @param s a set of geometrics
*/
! public void disconnect(Set s) {
connectedGeometry.removeAll(s);
}
--- 166,170 ----
* @param s a set of geometrics
*/
! public void disconnect(Set<Geometric> s) {
connectedGeometry.removeAll(s);
}
***************
*** 175,179 ****
* @return all connected geometry
*/
! public Set getConnectedGeometry() {
return connectedGeometry;
}
--- 174,178 ----
* @return all connected geometry
*/
! public Set<Geometric> getConnectedGeometry() {
return connectedGeometry;
}
|