From: <pd...@us...> - 2015-04-22 15:23:16
|
Revision: 2220 http://sourceforge.net/p/jsbml/code/2220 Author: pdp10 Date: 2015-04-22 15:23:14 +0000 (Wed, 22 Apr 2015) Log Message: ----------- update spatial package to v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -330,5 +330,34 @@ return success; } + + /* + * (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#hashCode() + */ + @Override + public int hashCode() { + final int prime = 2039; + int hashCode = super.hashCode(); + if (isSetGeometry()) { + hashCode += prime * getGeometry().hashCode(); + } + return hashCode; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("SpatialModelPlugin [geometry="); + builder.append(geometry); + builder.append(", spatialIdMap="); + builder.append(spatialIdMap); + builder.append("]"); + return builder.toString(); + } + } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -197,7 +197,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 2039; int hashCode = super.hashCode(); if (isSetIsLocal()) { hashCode += prime * isLocal.hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -29,7 +29,6 @@ import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; -import org.sbml.jsbml.util.TreeNodeChangeEvent; /** * @author Alex Thomas @@ -112,6 +111,9 @@ if (equal && isSetComponents()) { equal &= tc.getComponents().equals(getComponents()); } + if (equal && isSetComponentsLength()) { + equal &= tc.getComponentsLength() == getComponentsLength(); + } } return equal; } @@ -178,7 +180,7 @@ */ public int getComponentsLength() { if (isSetComponentsLength()) { - return componentsLength; + return componentsLength.intValue(); } // This is necessary if we cannot return null here. throw new PropertyUndefinedError(SpatialConstants.componentsLength, this); @@ -204,6 +206,9 @@ if (isSetComponents()) { hashCode += prime * getComponents().hashCode(); } + if (isSetComponentsLength()) { + hashCode += prime * getComponentsLength(); + } return hashCode; } @@ -223,15 +228,6 @@ attributes.put(SpatialConstants.shortLabel + ":componentsLength", String.valueOf(getComponentsLength())); } - - if (isSetSBOTerm()) { - attributes.remove(TreeNodeChangeEvent.sboTerm); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.sboTerm, getSBOTermID()); - } - if (isSetMetaId()) { - attributes.remove(TreeNodeChangeEvent.metaId); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.metaId, getMetaId()); - } return attributes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |