[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Modellor.java,NONE,1.1 Edge.java,1.19
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-11-28 22:24:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1534/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Space.java Added Files: Modellor.java Log Message: Added ability of geometric objects to be in hashtables without ID Added modellor example Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Surface.java 23 Nov 2005 16:55:04 -0000 1.49 --- Surface.java 28 Nov 2005 22:23:49 -0000 1.50 *************** *** 892,896 **** */ public int hashCode() { ! return id.hashCode(); } --- 892,900 ---- */ public int hashCode() { ! if (id == null) { ! return super.hashCode(); ! } else { ! return id.hashCode(); ! } } *************** *** 904,911 **** return false; } - Surface s = (Surface)o; ! ! return this.id.equals(s.getId()); } --- 908,918 ---- return false; } Surface s = (Surface)o; ! ! if (id == null || s.getId() == null) { ! return this == s; ! } else { ! return this.id.equals(s.getId()); ! } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Space.java 6 Nov 2005 16:25:34 -0000 1.5 --- Space.java 28 Nov 2005 22:23:49 -0000 1.6 *************** *** 29,32 **** --- 29,35 ---- /** The elements */ private Set elements; + + /** The modellor */ + private Modellor modellor; /** *************** *** 80,83 **** --- 83,102 ---- this.elements = elements; } + + /** + * Get the modellor + * @return The modellor + */ + public Modellor getModellor() { + return modellor; + } + + /** + * Set the modellor + * @param modellor The modellor + */ + public void setModellor(Modellor modellor) { + this.modellor = modellor; + } /** Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Vertex.java 15 Nov 2005 18:58:30 -0000 1.15 --- Vertex.java 28 Nov 2005 22:23:49 -0000 1.16 *************** *** 355,359 **** */ public int hashCode() { ! return id.hashCode(); } --- 355,363 ---- */ public int hashCode() { ! if (id == null) { ! return super.hashCode(); ! } else { ! return id.hashCode(); ! } } *************** *** 367,374 **** return false; } - Vertex v = (Vertex)o; ! ! return this.id.equals(v.getId()); } --- 371,381 ---- return false; } Vertex v = (Vertex)o; ! ! if (id == null || v.getId() == null) { ! return this == v; ! } else { ! return this.id.equals(v.getId()); ! } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Edge.java 18 Nov 2005 16:24:11 -0000 1.19 --- Edge.java 28 Nov 2005 22:23:49 -0000 1.20 *************** *** 191,195 **** */ public int hashCode() { ! return id.hashCode(); } --- 191,199 ---- */ public int hashCode() { ! if (id == null) { ! return super.hashCode(); ! } else { ! return id.hashCode(); ! } } *************** *** 203,210 **** return false; } - Edge e = (Edge)o; ! return this.id.equals(e.getId()); } --- 207,217 ---- return false; } Edge e = (Edge)o; ! if (id == null || e.getId() == null) { ! return this == e; ! } else { ! return this.id.equals(e.getId()); ! } } --- NEW FILE: Modellor.java --- //--------------------------------------------------------------------------------- // $Id: Modellor.java,v 1.1 2005/11/28 22:23:49 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.List; /** * The modellor interface, can generate surfaces from parameters * established at the creation of the Modellor. */ public interface Modellor { /** * Generate a list of surfaces. * @return A list of surfaces */ public List generate(); } |