@Override public ASTNodeValue unknownValue() throws SBMLException { throw new SBMLException( "cannot write unknown syntax tree nodes to a MathML document"); }
@Override public ASTNodeValue unknownValue() throws SBMLException { throw new SBMLException( "cannot write unknown syntax tree nodes to a formula String"); }
@Override public <T> ASTNode2Value<String> unknownValue() throws SBMLException { throw new SBMLException( "cannot write unknown syntax tree nodes to a formula String"); }
@Override public ASTNodeValue compile(int integer, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
@Override public <T> ASTNode2Value<String> compile(int integer, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
@Override public <T> ASTNode2Value<String> compile(double mantissa, int exponent, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
@Override public <T> ASTNode2Value<String> compile(double real, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
@Override public ASTNodeValue compile(double mantissa, int exponent, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
@Override public ASTNodeValue compile(double real, String units) { if ((units != null) && (units.length() > 0)) { isUnitsDefined = true; throw new SBMLException("Stopping the recursion, a units has been found and the SBML namespace is needed."); } return dummyValue; }
/** * Sets the value of spatialDimension * @param spatialDimension */ public void setSpatialDimensions(int spatialDimension) { Integer oldSpatialDimension = spatialDimensions; if (!((spatialDimension >= 0) && (spatialDimension <= 3))) { throw new SBMLException("Not a valid spatial dimension. Must be 0, 1, 2, or 3."); } spatialDimensions = spatialDimension; firePropertyChange(SpatialConstants.spatialDimensions, oldSpatialDimension, spatialDimensions); }
@Override public String toMathML() { try { if (isSetRefId()) { return MathMLXMLStreamCompiler.toMathML(this); } throw new SBMLException(); } catch (RuntimeException e) { logger.error("Unable to create MathML"); return null; } }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = false; if (attributeName.equals(SpatialConstants.isSpatial)) { try { setSpatial(StringTools.parseSBMLBoolean(value)); isAttributeRead = true; } catch (Exception e) { throw new SBMLException( MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, SpatialConstants.isSpatial)); } } return isAttributeRead; }
@Override public ASTNodeValue function(String functionDefinitionName, List<ASTNode> args) throws SBMLException { FunctionDefinition func = model.getFunctionDefinition(functionDefinitionName); if (func == null) { throw new SBMLException("FunctionDefinition with id ' " + functionDefinitionName + "' cannot be found in the model."); } function(func, args); return dummy; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead && attributeName.equals("kind")) { try { setKind(Kind.valueOf(value)); isAttributeRead = true; } catch (Exception e) { throw new SBMLException("Could not recognized the value '" + value + "' for the attribute 'kind' on the 'group' element."); } } return isAttributeRead; }
/** * Removes an element from the listOfCSGObjects at the given index. * * @param i the index where to remove the {@link CSGObject} * @throws IndexOutOfBoundsException if the listOf is not set or * if the index is out of bound (index < 0 || index > list.size). */ public void removeCSGObject(int i) { if (!isSetListOfCSGObjects()) { throw new IndexOutOfBoundsException(Integer.toString(i)); } if (getListOfCSGObjects().size() == 1) { throw new SBMLException("There must be at least one AnalyticVolume defined for this list"); } getListOfCSGObjects().remove(i); }
/** * Removes an element from the listOfInteriorPoints at the given index. * * @param i the index where to remove the {@link InteriorPoint} * @throws IndexOutOfBoundsException if the listOf is not set or * if the index is out of bound (index < 0 || index > list.size). */ public void removeInteriorPoint(int i) { if (!isSetListOfInteriorPoints()) { throw new IndexOutOfBoundsException(Integer.toString(i)); } if (getListOfInteriorPoints().size()<=1) { throw new SBMLException("There must be at least one InteriorPoint defined for this list"); } getListOfInteriorPoints().remove(i); }
/** * Removes an element from the listOfSampledVolumes at the given index. * * @param i the index where to remove the {@link SampledVolume} * @throws IndexOutOfBoundsException if the listOf is not set or * if the index is out of bound (index < 0 || index > list.size). */ public void removeSampledVolume(int i) { if (!isSetListOfSampledVolumes()) { throw new IndexOutOfBoundsException(Integer.toString(i)); } if (getListOfSampledVolumes().size()<=1) { throw new SBMLException("There must be at least one SampledVolume defined for this list"); } getListOfSampledVolumes().remove(i); }
@Override public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { ASTNode2Value<?> value = null; int childCount = getChildCount(); if (childCount != 2) { throw new SBMLException(MessageFormat.format( "Fractions must have one numerator and one denominator, here {0,number,integer} elements are given.", childCount)); } value = compiler.frac(getLeftChild(), getRightChild()); return processValue(value); }
@Override public String toFormula() throws SBMLException { if (isSetRefId()) { return compile(new FormulaCompiler()).toString(); } throw new SBMLException(); }
@Override public String toLaTeX() throws SBMLException { if (isSetRefId()) { return compile(new LaTeXCompiler()).toString(); } throw new SBMLException(); }