From: <pd...@us...> - 2015-04-23 14:56:39
|
Revision: 2241 http://sourceforge.net/p/jsbml/code/2241 Author: pdp10 Date: 2015-04-23 14:56:36 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 14:33:54 UTC (rev 2240) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 14:56:36 UTC (rev 2241) @@ -69,6 +69,10 @@ /** * */ + private String samples; + /** + * + */ private Integer samplesLength; /** * @@ -106,14 +110,15 @@ if (sf.isSetCompression()) { setCompression(sf.getCompression()); } + if (sf.isSetSamples()) { + setSamples(sf.getSamples()); + } if (sf.isSetSamplesLength()) { setSamplesLength(sf.getSamplesLength()); } if (sf.isSetInterpolation()) { setInterpolation(sf.getInterpolation()); } - - // TODO - data ? } /** @@ -172,6 +177,10 @@ if (equal && isSetSamplesLength()) { equal &= sf.getSamplesLength() == getSamplesLength(); } + equal &= sf.isSetSamples() == isSetSamples(); + if (equal && isSetSamples()) { + equal &= sf.getSamples() == getSamples(); + } equal &= sf.isSetDataType() == isSetDataType(); if (equal && isSetDataType()) { equal &= sf.getDataType().equals(getDataType()); @@ -491,7 +500,59 @@ return false; } + + /** + * Returns the value of {@link #samples}. + * + * @return the value of {@link #samples}. + */ + public String getSamples() { + if (isSetSamples()) { + return samples; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.samples, this); + } + + /** + * Returns whether {@link #samples} is set. + * + * @return whether {@link #samples} is set. + */ + public boolean isSetSamples() { + return this.samples != null; + } + + + /** + * Sets the value of samples + * + * @param samples the value of samples to be set. + */ + public void setSamples(String samples) { + String oldSamples = this.samples; + this.samples = samples; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + } + + + /** + * Unsets the variable samples. + * + * @return {@code true} if samples was set before, otherwise {@code false}. + */ + public boolean unsetSamples() { + if (isSetSamples()) { + String oldSamples = this.samples; + this.samples = null; + this.samplesLength = null; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + return true; + } + return false; + } + /** * Returns the value of {@link #samplesLength}. * @@ -689,6 +750,10 @@ hashCode += prime * getCompression().hashCode(); } + if (isSetSamples()) { + hashCode += prime * getSamples().hashCode(); + } + if (isSetSamplesLength()) { hashCode += prime * getSamplesLength(); } @@ -733,6 +798,11 @@ attributes.put(SpatialConstants.shortLabel + ":interpolation", getInterpolation().toString()); } + if (isSetSamplesLength()) { + attributes.remove("samplesLength"); + attributes.put(SpatialConstants.shortLabel + ":samplesLength", + String.valueOf(getSamplesLength())); + } return attributes; } @@ -823,6 +893,8 @@ builder.append(compression); builder.append(", samplesLength="); builder.append(samplesLength); + builder.append(", samples="); + builder.append(samples); builder.append(", data="); builder.append(data); builder.append("]"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:15:23
|
Revision: 2243 http://sourceforge.net/p/jsbml/code/2243 Author: pdp10 Date: 2015-04-23 15:15:21 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 15:13:13 UTC (rev 2242) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 15:15:21 UTC (rev 2243) @@ -553,6 +553,22 @@ return false; } + /** + * Appends the variable data to samples. + * @return {@code true} if data was appended to samples, otherwise {@code false}. + */ + public boolean append(String data) { + if (data == null) { return false; } + if (isSetSamples()) { + String oldSamples = this.samples; + this.samples = this.samples + data; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + } else { + setSamples(data); + } + return true; + } + /** * Returns the value of {@link #samplesLength}. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |