[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model ConstructionSpace.java,1.5,1.6 Space.
Status: Pre-Alpha
Brought to you by:
henryml
From: Nikolaj B. <nbr...@us...> - 2006-03-16 10:17:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8542/src/net/sourceforge/bprocessor/model Modified Files: ConstructionSpace.java Space.java FunctionalSpace.java Log Message: Made some code optimization Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Space.java 28 Feb 2006 02:26:25 -0000 1.19 --- Space.java 16 Mar 2006 10:17:49 -0000 1.20 *************** *** 7,15 **** --- 7,19 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.HashSet; + import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; + import org.apache.log4j.Logger; + /** *************** *** 21,25 **** * column="DOMAIN_ID" */ ! public class Space extends Entity { /** The name */ private String name; --- 25,31 ---- * column="DOMAIN_ID" */ ! public class Space extends Entity implements Parametric { ! /** The logger */ ! private static Logger log = Logger.getLogger(FunctionalSpace.class); /** The name */ private String name; *************** *** 284,286 **** --- 290,329 ---- } } + + /** + * Set the attributes of the object to the values in the list + * @param attributes The attributes to set + */ + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute a = (Attribute)iter.next(); + if (a.getName().equals("Name")) { + setName((String)a.getValue()); + } else if (a.getName().equals("Description")) { + setDescription(((String)a.getValue().toString())); + } else { + log.error("Wrong attribute for the object " + a); + } + } + } + + /** + * Return a list of the attributes in the object + * @return the list of attributes for the object + */ + public List getAttributes() { + ArrayList res = new ArrayList(); + res.add(new Attribute("Name", getName())); + res.add(new Attribute("Description", getDescription())); + return res; + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + // TODO Auto-generated method stub + return null; + } } Index: ConstructionSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ConstructionSpace.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConstructionSpace.java 28 Feb 2006 02:26:25 -0000 1.5 --- ConstructionSpace.java 16 Mar 2006 10:17:49 -0000 1.6 *************** *** 7,13 **** package net.sourceforge.bprocessor.model; ! import java.util.ArrayList; ! import java.util.Iterator; ! import java.util.List; import org.apache.log4j.Logger; --- 7,11 ---- package net.sourceforge.bprocessor.model; ! import org.apache.log4j.Logger; *************** *** 102,133 **** } - /** - * Set the attributes of the object to the values in the list - * @param attributes The attributes to set - */ - public void setAttributes(List attributes) { - Iterator iter = attributes.iterator(); - while (iter.hasNext()) { - Attribute a = (Attribute)iter.next(); - if (a.getName().equals("Name")) { - setName((String)a.getValue()); - } else if (a.getName().equals("Description")) { - setDescription(((String)a.getValue().toString())); - } else { - log.error("Wrong attribute for the object " + a); - } - } - } - - /** - * Return a list of the attributes in the object - * @return the list of attributes for the object - */ - public List getAttributes() { - ArrayList res = new ArrayList(); - res.add(new Attribute("Name", getName())); - res.add(new Attribute("Description", getDescription())); - return res; - } /** --- 100,103 ---- Index: FunctionalSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/FunctionalSpace.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FunctionalSpace.java 28 Feb 2006 02:26:25 -0000 1.5 --- FunctionalSpace.java 16 Mar 2006 10:17:50 -0000 1.6 *************** *** 7,13 **** package net.sourceforge.bprocessor.model; ! import java.util.ArrayList; ! import java.util.Iterator; ! import java.util.List; import org.apache.log4j.Logger; --- 7,11 ---- package net.sourceforge.bprocessor.model; ! import org.apache.log4j.Logger; *************** *** 102,133 **** } - /** - * Set the attributes of the object to the values in the list - * @param attributes The attributes to set - */ - public void setAttributes(List attributes) { - Iterator iter = attributes.iterator(); - while (iter.hasNext()) { - Attribute a = (Attribute)iter.next(); - if (a.getName().equals("Name")) { - setName((String)a.getValue()); - } else if (a.getName().equals("Description")) { - setDescription(((String)a.getValue().toString())); - } else { - log.error("Wrong attribute for the object " + a); - } - } - } - - /** - * Return a list of the attributes in the object - * @return the list of attributes for the object - */ - public List getAttributes() { - ArrayList res = new ArrayList(); - res.add(new Attribute("Name", getName())); - res.add(new Attribute("Description", getDescription())); - return res; - } /** --- 100,103 ---- |