From: <and...@us...> - 2015-10-15 20:11:18
|
Revision: 2385 http://sourceforge.net/p/jsbml/code/2385 Author: andreas-draeger Date: 2015-10-15 20:11:15 +0000 (Thu, 15 Oct 2015) Log Message: ----------- Corrected several invalid JavaDoc entries. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/CVTerm.java trunk/core/src/org/sbml/jsbml/math/ASTArithmeticOperatorNode.java trunk/core/src/org/sbml/jsbml/math/ASTBinaryFunctionNode.java trunk/core/src/org/sbml/jsbml/math/ASTBoolean.java trunk/core/src/org/sbml/jsbml/math/ASTCSymbolAvogadroNode.java trunk/core/src/org/sbml/jsbml/math/ASTCSymbolBaseNode.java trunk/core/src/org/sbml/jsbml/math/ASTCSymbolDelayNode.java trunk/core/src/org/sbml/jsbml/math/ASTCSymbolTimeNode.java trunk/core/src/org/sbml/jsbml/math/ASTCiFunctionNode.java trunk/core/src/org/sbml/jsbml/math/ASTCiNumberNode.java trunk/core/src/org/sbml/jsbml/math/ASTCnExponentialNode.java trunk/core/src/org/sbml/jsbml/math/ASTCnIntegerNode.java trunk/core/src/org/sbml/jsbml/math/ASTCnNumberNode.java trunk/core/src/org/sbml/jsbml/math/ASTCnRationalNode.java trunk/core/src/org/sbml/jsbml/math/ASTCnRealNode.java trunk/core/src/org/sbml/jsbml/math/ASTConstantNumber.java trunk/core/src/org/sbml/jsbml/math/ASTDivideNode.java trunk/core/src/org/sbml/jsbml/math/ASTFactory.java trunk/core/src/org/sbml/jsbml/math/ASTFunction.java trunk/core/src/org/sbml/jsbml/math/ASTLogicalOperatorNode.java trunk/core/src/org/sbml/jsbml/math/ASTNode2.java trunk/core/src/org/sbml/jsbml/math/ASTPowerNode.java trunk/core/src/org/sbml/jsbml/math/ASTQualifierNode.java trunk/core/src/org/sbml/jsbml/math/ASTRelationalOperatorNode.java trunk/core/src/org/sbml/jsbml/math/ASTRootNode.java trunk/core/src/org/sbml/jsbml/math/ASTTrigonometricNode.java trunk/core/src/org/sbml/jsbml/math/ASTUnaryFunctionNode.java trunk/core/src/org/sbml/jsbml/math/ASTUnknown.java trunk/core/src/org/sbml/jsbml/math/AbstractASTNode.java trunk/core/src/org/sbml/jsbml/math/compiler/ASTNode2Compiler.java trunk/core/src/org/sbml/jsbml/math/compiler/ASTNode2Value.java trunk/core/src/org/sbml/jsbml/math/compiler/FindUnitsCompiler.java trunk/core/src/org/sbml/jsbml/math/compiler/FormulaCompiler.java trunk/core/src/org/sbml/jsbml/math/compiler/HTMLFormula.java trunk/core/src/org/sbml/jsbml/math/compiler/LaTeXCompiler.java trunk/core/src/org/sbml/jsbml/math/compiler/MathMLXMLStreamCompiler.java trunk/core/src/org/sbml/jsbml/math/compiler/UnitException.java trunk/core/src/org/sbml/jsbml/math/compiler/UnitsCompiler.java trunk/core/src/org/sbml/jsbml/math/parser/FormulaParserLL3.java trunk/core/src/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2.java trunk/core/src/org/sbml/jsbml/math/parser/IFormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3ASTNode2.java trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java trunk/core/test/org/sbml/jsbml/math/test/ASTArithmeticOperatorNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTBinaryFunctionNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTBooleanTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTCiFunctionNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTCiNumberNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTCnExponentialNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTCnNumberNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTConstantNumberTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTFactoryTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTFunctionTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTLambdaFunctionTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTLogarithmNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTMinusNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTPowerNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTQualifierNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTRelationalOperatorNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTRootNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTTimesNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTTrigonometricNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTUnaryFunctionNodeTest.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -639,8 +639,8 @@ * or {@link #IMPLEMENTATION_ASTNODE2}. */ public static final String IMPLEMENTATION_VERSION = IMPLEMENTATION_HISTORIC; - - + + /** * Creates and returns an {@link ASTNode} that computes the absolute value * of the given double value. @@ -3797,7 +3797,6 @@ /** * Sets the Parent of the node to the given value * - * @param node the orphan node * @param parent the parent */ public void setParentSBMLObject(MathContainer parent) { @@ -3829,7 +3828,7 @@ if (logger.isDebugEnabled()) { logger.debug("ASTNode: setType(String) called: " + typeStr); } - + Type type = Type.getTypeFor(typeStr); setType(type); if (type != Type.UNKNOWN) { @@ -4224,40 +4223,40 @@ return formula; } - - + + /** * Returns a simple String representing the content of the ASTNode. * * @return a simple String representing the content of the ASTNode. */ public String toSimpleString() { - StringBuffer buffer = new StringBuffer("ASTNode [type="); + StringBuffer buffer = new StringBuffer("ASTNode [type="); buffer.append(type); - - if (isInteger()) + + if (isInteger()) { buffer.append(", ").append(getInteger()); } - else if (isReal()) + else if (isReal()) { buffer.append(", ").append(getReal()); - - if (isRational()) + + if (isRational()) { buffer.append(" (").append(getNumerator()).append(" / ").append(getDenominator()); } - else if (exponent != 0) + else if (exponent != 0) { buffer.append(" (").append(getMantissa()).append("e").append(getExponent()); } } - else if (isName()) + else if (isName()) { buffer.append(", name = ").append(getName()); } - - if (definitionURL != null) + + if (definitionURL != null) { buffer.append(", definitionURL = ").append(getDefinitionURL()); } @@ -4265,19 +4264,19 @@ if (unitId != null) { buffer.append(", units = ").append(getUnits()); } - + if (getChildCount() > 0) { buffer.append(", nb children = ").append(getChildCount()); } - + if (isSetUserObjects()) { - buffer.append(", user object keys = ").append(userObjectKeySet()); + buffer.append(", user object keys = ").append(userObjectKeySet()); } - + if (getParent() == null) { buffer.append(", no parent defined"); } - + if (id != null) { buffer.append(", id = ").append(getId()); } @@ -4290,7 +4289,7 @@ if (className != null) { buffer.append(", className = ").append(getClassName()); } - + return buffer.toString(); } @@ -4342,13 +4341,13 @@ * @return a simple tree view of the ASTNode internal */ public static String astNodeToTree(ASTNode n, String tree, String indent) { - tree = tree + indent + n.getType() + " " + + tree = tree + indent + n.getType() + " " + (n.isInteger() ? n.getInteger() : "") + (n.isReal() ? n.getReal() : "") + "\n"; - + for (ASTNode child : n.getChildren()) { tree = astNodeToTree(child, tree, indent + " "); } - + return tree; } Modified: trunk/core/src/org/sbml/jsbml/CVTerm.java =================================================================== --- trunk/core/src/org/sbml/jsbml/CVTerm.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/CVTerm.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -375,7 +375,7 @@ * SBML level 2 version 5 (and future SBML L3V2), the annotations can be recursive. */ private List<CVTerm> listOfNestedCVTerms; - + /** * Represents the type of MIRIAM qualifier for this {@link CVTerm}. It * depends on the name space in the SBML file, it can be a model qualifier @@ -1168,8 +1168,8 @@ type = null; } } - - + + /** * Returns {@code true} if {@link #listOfNestedCVTerms} contains at least * one element. @@ -1192,7 +1192,7 @@ */ public List<CVTerm> getListOfNestedCVTerms() { if (listOfNestedCVTerms == null) { - listOfNestedCVTerms = new ArrayList<CVTerm>(); + listOfNestedCVTerms = new ArrayList<CVTerm>(); } return listOfNestedCVTerms; } @@ -1201,12 +1201,11 @@ * Sets the given {@code ListOf<CVTerm>}. * If {@link #listOfNestedCVTerms} was defined before and contains some * elements, they are all unset. - * - * @param listOfNestedCVTerms + * @param listOfCVTerms */ public void setListOfNestedCVTerms(List<CVTerm> listOfCVTerms) { unsetListOfNestedCVTerms(); - this.listOfNestedCVTerms = listOfCVTerms; + listOfNestedCVTerms = listOfCVTerms; } /** @@ -1218,8 +1217,8 @@ */ public boolean unsetListOfNestedCVTerms() { if (isSetListOfNestedCVTerms()) { - List<CVTerm> oldCVTerms = this.listOfNestedCVTerms; - this.listOfNestedCVTerms = null; + List<CVTerm> oldCVTerms = listOfNestedCVTerms; + listOfNestedCVTerms = null; // oldCVTerms.fireNodeRemovedEvent(); return true; } @@ -1313,7 +1312,7 @@ * * @return the number of {@link CVTerm}s in this * {@link CVTerm}. - * @libsbml.deprecated same as {@link #getCVTermCount()} + * @libsbml.deprecated same as {@link #getNestedCVTermCount()} */ public int getNumNestedCVTerms() { return getNestedCVTermCount(); Modified: trunk/core/src/org/sbml/jsbml/math/ASTArithmeticOperatorNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTArithmeticOperatorNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTArithmeticOperatorNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -45,17 +45,17 @@ * @date May 30, 2014 */ public class ASTArithmeticOperatorNode extends ASTFunction { - + /** * */ private static final long serialVersionUID = -7712374792704509306L; - + /** * A {@link Logger} for this class. */ private static final Logger logger = Logger.getLogger(ASTArithmeticOperatorNode.class); - + /** * Creates a new {@link ASTArithmeticOperatorNode} without a pointer * to its containing {@link MathContainer}. @@ -63,7 +63,7 @@ public ASTArithmeticOperatorNode() { super(); } - + /** * Copy constructor; Creates a deep copy of the given {@link ASTArithmeticOperatorNode}. * @@ -73,19 +73,21 @@ public ASTArithmeticOperatorNode(ASTArithmeticOperatorNode node) { super(node); } - + /** * Creates a new {@link ASTArithmeticOperatorNode} with a pointer * to the specified {@link MathContainer}.. + * @param container */ public ASTArithmeticOperatorNode(MathContainer container) { super(container); } - + /** * Creates a new {@link ASTArithmeticOperatorNode} without a pointer - * to its containing {@link MathContainer} but of the specified + * to its containing {@link MathContainer} but of the specified * {@link Type}. + * @param type */ public ASTArithmeticOperatorNode(Type type) { this(); @@ -95,6 +97,8 @@ /** * Creates a new {@link ASTArithmeticOperatorNode} of type * {@link Type} and container {@link MathContainer}. + * @param type + * @param container */ public ASTArithmeticOperatorNode(Type type, MathContainer container) { this(container); @@ -108,7 +112,7 @@ public ASTArithmeticOperatorNode clone() { return new ASTArithmeticOperatorNode(this); } - + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) */ @@ -148,7 +152,7 @@ } return processValue(value); } - + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#isAllowableType(org.sbml.jsbml.ASTNode.Type) */ @@ -169,10 +173,10 @@ } return false; } - + /** - * Sets the value of this {@link ASTArithmeticOperatorNode} to the given character. If - * character is one of +, -, *, / or ^, the node type will be set accordingly. + * Sets the value of this {@link ASTArithmeticOperatorNode} to the given character. If + * character is one of +, -, *, / or ^, the node type will be set accordingly. * For all other characters, the node type will be set to UNKNOWN. * * @param value Modified: trunk/core/src/org/sbml/jsbml/math/ASTBinaryFunctionNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTBinaryFunctionNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTBinaryFunctionNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -27,8 +27,6 @@ import org.apache.log4j.Logger; - - /** * An Abstract Syntax Tree (AST) node representing a function with two * parameters @@ -44,7 +42,7 @@ * */ private static final long serialVersionUID = -4036869111918452252L; - + /** * A {@link Logger} for this class. */ @@ -56,7 +54,7 @@ public ASTBinaryFunctionNode() { super(); } - + /** * Copy constructor; Creates a deep copy of the given {@link ASTBinaryFunctionNode}. * @@ -70,34 +68,36 @@ /** * Creates a new {@link ASTBinaryFunctionNode} with the specified * children. + * @param leftChild + * @param rightChild */ public ASTBinaryFunctionNode(ASTNode2 leftChild, ASTNode2 rightChild) { this(); addChild(leftChild); addChild(rightChild); } - + /** * Adds a child to this node. * * @param child * the node to add as child. - * + * * @throws NullPointerException if the child is null * @throws IndexOutOfBoundsException if strictness is set to true - * and max child limit has been exceeded + * and max child limit has been exceeded */ @Override public void addChild(ASTNode2 child) { if (! isSetList()) { listOfNodes = new ArrayList<ASTNode2>(2); - } + } if (isStrict() && getChildCount() == 2) { throw new IndexOutOfBoundsException("max child limit exceeded"); } if (getChildCount() >= 2) { logger.debug("Max child limit exceeded. To add more children " + - "to ASTBinaryFunctionNode set strictness to false."); + "to ASTBinaryFunctionNode set strictness to false."); } listOfNodes.add(child); ASTFactory.setParentSBMLObject(child, parentSBMLObject); @@ -116,7 +116,7 @@ /** * @throws IndexOutOfBoundsException if strictness is set to true - * and max child limit has been exceeded + * and max child limit has been exceeded */ @Override public ASTNode2 getChildAt(int childIndex) { @@ -153,11 +153,11 @@ * long the index of the {@link ASTNode2} being added * @param newChild * {@link ASTNode2} to insert as the n<sup>th</sup> child - * + * * @throws NullPointerException if the child is null * @throws IndexOutOfBoundsException if strictness is set to true - * and max child limit has been exceeded - * + * and max child limit has been exceeded + * */ @Override public void insertChild(int n, ASTNode2 newChild) { @@ -169,7 +169,7 @@ } if (getChildCount() == 2) { logger.debug("Max child limit exceeded. To add more children " + - "to ASTBinaryFunctionNode set strictness to false."); + "to ASTBinaryFunctionNode set strictness to false."); } listOfNodes.add(n, newChild); ASTFactory.setParentSBMLObject(newChild, parentSBMLObject); @@ -184,7 +184,7 @@ public boolean isSetLeftChild() { return getChildCount() > 0; } - + /** * Return true iff right child has been set * @@ -193,18 +193,18 @@ public boolean isSetRightChild() { return getChildCount() > 1; } - + /** - * Adds the given node as a child of this {@link ASTBinaryFunctionNode}. + * Adds the given node as a child of this {@link ASTBinaryFunctionNode}. * This method adds child nodes from right to left. * * @param child * an {@code ASTNode2} - * - * @throws NullPointerException if the child is null + * + * @throws NullPointerException if the child is null * @throws IndexOutOfBoundsException if strictness is set to true - * and max child limit has been exceeded - * + * and max child limit has been exceeded + * */ @Override public void prependChild(ASTNode2 child) { @@ -216,13 +216,13 @@ } if (getChildCount() == 2) { logger.debug("Max child limit exceeded. To add more children " + - "to ASTBinaryFunctionNode set strictness to false."); + "to ASTBinaryFunctionNode set strictness to false."); } listOfNodes.add(0, child); ASTFactory.setParentSBMLObject(child, parentSBMLObject); child.setParent(this); } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#removeChild(int) @@ -266,7 +266,7 @@ } addChild(child); } - + /** * <p> * Swaps the children of this {@link ASTFunction} with the children of that @@ -291,10 +291,10 @@ * @param that * the other node whose children should be used to replace this * node's children - * + * * @throws IndexOutOfBoundsException if strictness is set to true - * and max child limit has been exceeded - * + * and max child limit has been exceeded + * */ @Override public void swapChildren(ASTFunction that) { @@ -303,13 +303,13 @@ } if (that.getChildCount() > 2) { logger.debug("Max child limit exceeded. To add more children " + - "to ASTBinaryFunctionNode set strictness to false."); + "to ASTBinaryFunctionNode set strictness to false."); } List<ASTNode2> swap = that.listOfNodes; that.listOfNodes = listOfNodes; listOfNodes = swap; } - + /* (non-Javadoc) * @see java.lang.Object#toString() */ Modified: trunk/core/src/org/sbml/jsbml/math/ASTBoolean.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTBoolean.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTBoolean.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -1,24 +1,24 @@ /* * $Id$ * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. * - * Copyright (C) 2009-2014 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA * 4. The University of California, San Diego, La Jolla, CA, USA * 5. The Babraham Institute, Cambridge, UK * 6. The University of Toronto, Toronto, ON, Canada * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- */ package org.sbml.jsbml.math; @@ -51,15 +51,18 @@ * A {@link Logger} for this class. */ private static final Logger logger = Logger.getLogger(ASTBoolean.class); - + + /** + * + */ public ASTBoolean() { super(); } - + /** * Copy constructor; Creates a deep copy of the given {@link ASTBoolean}. * - * @param node + * @param bool * the {@link ASTBoolean} to be copied. */ public ASTBoolean(ASTBoolean bool) { @@ -68,12 +71,13 @@ /** * Creates a new {@link ASTBoolean}. + * @param type */ public ASTBoolean(Type type) { this(); setType(type); } - + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#clone() */ @@ -100,7 +104,7 @@ } return processValue(value); } - + /* (non-Javadoc) * @see javax.swing.tree.TreeNode#getAllowsChildren() */ @@ -141,7 +145,7 @@ logger.warn(error); return false; } - + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isAllowableType(org.sbml.jsbml.ASTNode.Type) */ @@ -149,7 +153,7 @@ public boolean isAllowableType(Type type) { return type == Type.CONSTANT_TRUE || type == Type.CONSTANT_FALSE; } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.AbstractASTNode#isSetType() @@ -158,7 +162,7 @@ public boolean isSetType() { return type == Type.CONSTANT_TRUE || type == Type.CONSTANT_FALSE; } - + /** * Set the value of this {@link ASTBoolean} * @@ -217,5 +221,5 @@ builder.append("]"); return builder.toString(); } - + } Modified: trunk/core/src/org/sbml/jsbml/math/ASTCSymbolAvogadroNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCSymbolAvogadroNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCSymbolAvogadroNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -31,8 +31,6 @@ import org.sbml.jsbml.util.Maths; import org.sbml.jsbml.util.TreeNodeChangeEvent; - - /** * An Abstract Syntax Tree (AST) node representing avogadro's number * @@ -84,7 +82,7 @@ /** * Copy constructor; Creates a deep copy of the given {@link ASTCSymbolAvogadroNode}. * - * @param astFunction + * @param node * the {@link ASTCSymbolAvogadroNode} to be copied. */ public ASTCSymbolAvogadroNode(ASTCSymbolAvogadroNode node) { @@ -93,13 +91,13 @@ setDefinitionURL(node.getDefinitionURL()); } if (node.isSetEncoding()) { - setEncoding(node.getEncoding()); + setEncoding(node.getEncoding()); } if (node.isSetName()) { setName(node.getName()); } } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.ASTConstantNumber#clone() @@ -117,7 +115,7 @@ ASTNode2Value<?> value = null; switch(getType()) { case NAME_AVOGADRO: - value = compiler.getConstantAvogadro(isSetName() ? getName() : "avogadro"); + value = compiler.getConstantAvogadro(isSetName() ? getName() : "avogadro"); break; default: // UNKNOWN: value = compiler.unknownValue(); @@ -131,28 +129,37 @@ */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ASTCSymbolAvogadroNode other = (ASTCSymbolAvogadroNode) obj; if (definitionURL == null) { - if (other.definitionURL != null) + if (other.definitionURL != null) { return false; - } else if (!definitionURL.equals(other.definitionURL)) + } + } else if (!definitionURL.equals(other.definitionURL)) { return false; + } if (encoding == null) { - if (other.encoding != null) + if (other.encoding != null) { return false; - } else if (!encoding.equals(other.encoding)) + } + } else if (!encoding.equals(other.encoding)) { return false; + } if (name == null) { - if (other.name != null) + if (other.name != null) { return false; - } else if (!name.equals(other.name)) + } + } else if (!name.equals(other.name)) { return false; + } return true; } @@ -221,9 +228,9 @@ final int prime = 1511; int result = super.hashCode(); result = prime * result - + ((definitionURL == null) ? 0 : definitionURL.hashCode()); + + ((definitionURL == null) ? 0 : definitionURL.hashCode()); result = prime * result - + ((encoding == null) ? 0 : encoding.hashCode()); + + ((encoding == null) ? 0 : encoding.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @@ -235,7 +242,7 @@ public boolean isAllowableType(Type type) { return type == Type.NAME_AVOGADRO; } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#isSetDefinitionURL() @@ -283,19 +290,19 @@ * Set the definitionURL of the MathML element represented by * this {@link ASTCSymbolAvogadroNode} * - * @param String definitionURL + * @param definitionURL */ private void setDefinitionURL(String definitionURL) { String old = this.definitionURL; this.definitionURL = definitionURL; firePropertyChange(TreeNodeChangeEvent.definitionURL, old, encoding); } - + /** * Set the encoding of the MathML element represented by * this {@link ASTCSymbolAvogadroNode} * - * @param String encoding + * @param encoding */ private void setEncoding(String encoding) { String old = this.encoding; Modified: trunk/core/src/org/sbml/jsbml/math/ASTCSymbolBaseNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCSymbolBaseNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCSymbolBaseNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -62,7 +62,7 @@ * @return boolean */ public boolean isSetName(); - + /** * Returns {@code true} if this node or one of its descendants contains some * identifier with the given id. This method can be used to scan a formula @@ -75,13 +75,13 @@ * given id. */ public boolean refersTo(String id); - + /** * Set the name of the MathML element represented by * this {@link ASTCSymbolBaseNode} * - * @param String name + * @param name */ public void setName(String name); - + } Modified: trunk/core/src/org/sbml/jsbml/math/ASTCSymbolDelayNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCSymbolDelayNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCSymbolDelayNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -84,8 +84,7 @@ /** * Copy constructor; Creates a deep copy of the given {@link ASTCSymbolDelayNode}. * - * @param astFunction - * the {@link ASTCSymbolDelayNode} to be copied. + * @param node the {@link ASTCSymbolDelayNode} to be copied. */ public ASTCSymbolDelayNode(ASTCSymbolDelayNode node) { super(node); @@ -99,7 +98,7 @@ setName(node.getName()); } } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#clone() @@ -108,15 +107,15 @@ public ASTCSymbolDelayNode clone() { return new ASTCSymbolDelayNode(this); } - + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) */ @Override public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { ASTNode2Value<?> value = null; - value = isSetName() ? compiler.delay(getName(), getLeftChild(), getRightChild()) - : compiler.delay("delay", getLeftChild(), getRightChild()); + value = isSetName() ? compiler.delay(getName(), getLeftChild(), getRightChild()) + : compiler.delay("delay", getLeftChild(), getRightChild()); return processValue(value); } @@ -125,28 +124,37 @@ */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ASTCSymbolDelayNode other = (ASTCSymbolDelayNode) obj; if (definitionURL == null) { - if (other.definitionURL != null) + if (other.definitionURL != null) { return false; - } else if (!definitionURL.equals(other.definitionURL)) + } + } else if (!definitionURL.equals(other.definitionURL)) { return false; + } if (encoding == null) { - if (other.encoding != null) + if (other.encoding != null) { return false; - } else if (!encoding.equals(other.encoding)) + } + } else if (!encoding.equals(other.encoding)) { return false; + } if (name == null) { - if (other.name != null) + if (other.name != null) { return false; - } else if (!name.equals(other.name)) + } + } else if (!name.equals(other.name)) { return false; + } return true; } @@ -190,9 +198,9 @@ final int prime = 1291; int result = super.hashCode(); result = prime * result - + ((definitionURL == null) ? 0 : definitionURL.hashCode()); + + ((definitionURL == null) ? 0 : definitionURL.hashCode()); result = prime * result - + ((encoding == null) ? 0 : encoding.hashCode()); + + ((encoding == null) ? 0 : encoding.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @@ -236,7 +244,7 @@ * Set the definitionURL of the MathML element represented by * this {@link ASTCSymbolDelayNode} * - * @param String definitionURL + * @param definitionURL */ private void setDefinitionURL(String definitionURL) { String old = this.definitionURL; @@ -248,7 +256,7 @@ * Set the encoding of the MathML element represented by * this {@link ASTCSymbolDelayNode} * - * @param String encoding + * @param encoding */ private void setEncoding(String encoding) { String old = this.encoding; Modified: trunk/core/src/org/sbml/jsbml/math/ASTCSymbolTimeNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCSymbolTimeNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCSymbolTimeNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -45,266 +45,266 @@ public class ASTCSymbolTimeNode extends ASTNumber implements ASTCSymbolNode { - /** - * - */ - private static final long serialVersionUID = 3788959657360296692L; + /** + * + */ + private static final long serialVersionUID = 3788959657360296692L; - /** - * A {@link Logger} for this class. - */ - private static final Logger logger = Logger.getLogger(ASTCSymbolTimeNode.class); + /** + * A {@link Logger} for this class. + */ + private static final Logger logger = Logger.getLogger(ASTCSymbolTimeNode.class); - /** - * The encoding of this csymbol element - */ - private String encoding; + /** + * The encoding of this csymbol element + */ + private String encoding; - /** - * definitionURL attribute for MathML element - */ - protected String definitionURL; + /** + * definitionURL attribute for MathML element + */ + protected String definitionURL; - /** - * The name of the MathML element represented by this - * {@link ASTCSymbolTimeNode}. - */ - private String name; + /** + * The name of the MathML element represented by this + * {@link ASTCSymbolTimeNode}. + */ + private String name; - /** - * Creates a new {@link ASTCSymbolTimeNode}. - */ - public ASTCSymbolTimeNode() { - super(); - setDefinitionURL(ASTNode.URI_TIME_DEFINITION); - setEncoding("text"); - setType(Type.NAME_TIME); - } + /** + * Creates a new {@link ASTCSymbolTimeNode}. + */ + public ASTCSymbolTimeNode() { + super(); + setDefinitionURL(ASTNode.URI_TIME_DEFINITION); + setEncoding("text"); + setType(Type.NAME_TIME); + } - /** - * Copy constructor; Creates a deep copy of the given {@link ASTCSymbolTimeNode}. - * - * @param node - * the {@link ASTCSymbolTimeNode} to be copied. - */ - public ASTCSymbolTimeNode(ASTCSymbolTimeNode node) { - super(node); - if (node.isSetDefinitionURL()) { - setDefinitionURL(node.getDefinitionURL()); - } - if (node.isSetEncoding()) { - setEncoding(node.getEncoding()); - } - if (node.isSetName()) { - setName(node.getName()); - } - } + /** + * Copy constructor; Creates a deep copy of the given {@link ASTCSymbolTimeNode}. + * + * @param node + * the {@link ASTCSymbolTimeNode} to be copied. + */ + public ASTCSymbolTimeNode(ASTCSymbolTimeNode node) { + super(node); + if (node.isSetDefinitionURL()) { + setDefinitionURL(node.getDefinitionURL()); + } + if (node.isSetEncoding()) { + setEncoding(node.getEncoding()); + } + if (node.isSetName()) { + setName(node.getName()); + } + } - /* - * (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCiNumberNode#clone() - */ - @Override - public ASTCSymbolTimeNode clone() { - return new ASTCSymbolTimeNode(this); - } + /* + * (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCiNumberNode#clone() + */ + @Override + public ASTCSymbolTimeNode clone() { + return new ASTCSymbolTimeNode(this); + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) - */ - @Override - public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { - ASTNode2Value<?> value = compiler.symbolTime(isSetName() ? getName() : "time"); + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) + */ + @Override + public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { + ASTNode2Value<?> value = compiler.symbolTime(isSetName() ? getName() : "time"); return processValue(value); - } + } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ASTCSymbolTimeNode other = (ASTCSymbolTimeNode) obj; - if (definitionURL == null) { - if (other.definitionURL != null) { - return false; - } - } else if (!definitionURL.equals(other.definitionURL)) { - return false; - } - if (encoding == null) { - if (other.encoding != null) { - return false; - } - } else if (!encoding.equals(other.encoding)) { - return false; - } - return true; - } + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ASTCSymbolTimeNode other = (ASTCSymbolTimeNode) obj; + if (definitionURL == null) { + if (other.definitionURL != null) { + return false; + } + } else if (!definitionURL.equals(other.definitionURL)) { + return false; + } + if (encoding == null) { + if (other.encoding != null) { + return false; + } + } else if (!encoding.equals(other.encoding)) { + return false; + } + return true; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getDefinitionURL() - */ - @Override - public String getDefinitionURL() { - if (isSetDefinitionURL()) { - return definitionURL; - } - PropertyUndefinedError error = new PropertyUndefinedError("definitionURL", this); - if (isStrict()) { - throw error; - } - logger.warn(error); - return ""; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getDefinitionURL() + */ + @Override + public String getDefinitionURL() { + if (isSetDefinitionURL()) { + return definitionURL; + } + PropertyUndefinedError error = new PropertyUndefinedError("definitionURL", this); + if (isStrict()) { + throw error; + } + logger.warn(error); + return ""; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolNode#getEncodingURL() - */ - @Override - public String getEncoding() { - if (isSetEncoding()) { - return encoding; - } - PropertyUndefinedError error = new PropertyUndefinedError("encodingURL", this); - if (isStrict()) { - throw error; - } - logger.warn(error); - return ""; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolNode#getEncodingURL() + */ + @Override + public String getEncoding() { + if (isSetEncoding()) { + return encoding; + } + PropertyUndefinedError error = new PropertyUndefinedError("encodingURL", this); + if (isStrict()) { + throw error; + } + logger.warn(error); + return ""; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getName() - */ - @Override - public String getName() { - if (isSetName()) { - return name; - } - PropertyUndefinedError error = new PropertyUndefinedError("name", this); - if (isStrict()) { - throw error; - } - logger.warn(error); - return ""; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getName() + */ + @Override + public String getName() { + if (isSetName()) { + return name; + } + PropertyUndefinedError error = new PropertyUndefinedError("name", this); + if (isStrict()) { + throw error; + } + logger.warn(error); + return ""; + } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 1277; - int result = super.hashCode(); - result = prime * result - + ((definitionURL == null) ? 0 : definitionURL.hashCode()); - result = prime * result - + ((encoding == null) ? 0 : encoding.hashCode()); - return result; - } + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 1277; + int result = super.hashCode(); + result = prime * result + + ((definitionURL == null) ? 0 : definitionURL.hashCode()); + result = prime * result + + ((encoding == null) ? 0 : encoding.hashCode()); + return result; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTNode2#isAllowableType(org.sbml.jsbml.ASTNode.Type) - */ - @Override - public boolean isAllowableType(Type type) { - return type == Type.NAME_TIME; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTNode2#isAllowableType(org.sbml.jsbml.ASTNode.Type) + */ + @Override + public boolean isAllowableType(Type type) { + return type == Type.NAME_TIME; + } - /* - * (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#isSetDefinitionURL() - */ - @Override - public boolean isSetDefinitionURL() { - return definitionURL != null; - } + /* + * (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#isSetDefinitionURL() + */ + @Override + public boolean isSetDefinitionURL() { + return definitionURL != null; + } - /* - * (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolNode#isSetEncodingURL() - */ - @Override - public boolean isSetEncoding() { - return encoding != null; - } + /* + * (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolNode#isSetEncodingURL() + */ + @Override + public boolean isSetEncoding() { + return encoding != null; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#isSetName() - */ - @Override - public boolean isSetName() { - return name != null; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#isSetName() + */ + @Override + public boolean isSetName() { + return name != null; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#refersTo(java.lang.String) - */ - @Override - public boolean refersTo(String id) { - return getName().equals(id); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#refersTo(java.lang.String) + */ + @Override + public boolean refersTo(String id) { + return getName().equals(id); + } - /** - * Set the definitionURL of the MathML element represented by - * this {@link ASTCSymbolTimeNode} - * - * @param String definitionURL - */ - private void setDefinitionURL(String definitionURL) { - String old = this.definitionURL; - this.definitionURL = definitionURL; - firePropertyChange(TreeNodeChangeEvent.definitionURL, old, definitionURL); - } + /** + * Set the definitionURL of the MathML element represented by + * this {@link ASTCSymbolTimeNode} + * + * @param definitionURL + */ + private void setDefinitionURL(String definitionURL) { + String old = this.definitionURL; + this.definitionURL = definitionURL; + firePropertyChange(TreeNodeChangeEvent.definitionURL, old, definitionURL); + } - /** - * Set the encoding of the MathML element represented by - * this {@link ASTCSymbolTimeNode} - * - * @param String encoding - */ - private void setEncoding(String encoding) { - String old = this.encoding; - this.encoding = encoding; - firePropertyChange(TreeNodeChangeEvent.encoding, old, this.encoding); - } + /** + * Set the encoding of the MathML element represented by + * this {@link ASTCSymbolTimeNode} + * + * @param encoding + */ + private void setEncoding(String encoding) { + String old = this.encoding; + this.encoding = encoding; + firePropertyChange(TreeNodeChangeEvent.encoding, old, this.encoding); + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#setName(java.lang.String) - */ - @Override - public void setName(String name) { - String old = this.name; - this.name = name; - firePropertyChange(TreeNodeChangeEvent.name, old, this.name); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#setName(java.lang.String) + */ + @Override + public void setName(String name) { + String old = this.name; + this.name = name; + firePropertyChange(TreeNodeChangeEvent.name, old, this.name); + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.AbstractASTNode#toFormula() - */ - @Override - public String toFormula() throws SBMLException { - return compile(new FormulaCompiler()).toString(); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.AbstractASTNode#toFormula() + */ + @Override + public String toFormula() throws SBMLException { + return compile(new FormulaCompiler()).toString(); + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.AbstractASTNode#toLaTeX() - */ - @Override - public String toLaTeX() throws SBMLException { - return compile(new LaTeXCompiler()).toString(); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.AbstractASTNode#toLaTeX() + */ + @Override + public String toLaTeX() throws SBMLException { + return compile(new LaTeXCompiler()).toString(); + } - /* (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.AbstractASTNode#toMathML() */ @Override @@ -318,10 +318,10 @@ } /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { + * @see java.lang.Object#toString() + */ + @Override + public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getClass().getSimpleName()); builder.append(" [strict="); @@ -342,6 +342,6 @@ builder.append(isSetMathMLClass() ? mathMLClass : "null"); builder.append("]"); return builder.toString(); - } + } } Modified: trunk/core/src/org/sbml/jsbml/math/ASTCiFunctionNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCiFunctionNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCiFunctionNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -69,7 +69,7 @@ * The name of the MathML element represented by this * {@link ASTCiFunctionNode}. */ - private String name; // TODO - remove this unused class attribute ? + private String name; // TODO - remove this unused class attribute ? /** * refId attribute for MathML element @@ -86,7 +86,7 @@ setName(null); setType(Type.FUNCTION); } - + /** * Copy constructor; Creates a deep copy of the given {@link ASTCiFunctionNode}. * @@ -96,13 +96,13 @@ public ASTCiFunctionNode(ASTCiFunctionNode node) { super(node); if (node.isSetDefinitionURL()) { - setDefinitionURL(node.getDefinitionURL()); + setDefinitionURL(node.getDefinitionURL()); } if (node.isSetRefId()) { setRefId(node.getRefId()); } } - + /* * (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#clone() @@ -110,8 +110,8 @@ @Override public ASTCiFunctionNode clone() { return new ASTCiFunctionNode(this); - } - + } + /* * (non-Javadoc) * @see org.sbml.jsbml.math.AbstractASTNode#compile(org.sbml.jsbml.math.compiler.ASTNode2Compiler) @@ -121,7 +121,7 @@ ASTNode2Value<?> value = null; FunctionDefinition variable = getReferenceInstance(); if (variable instanceof FunctionDefinition) { - value = compiler.function((FunctionDefinition) variable, + value = compiler.function(variable, getChildren()); } else { logger @@ -132,7 +132,7 @@ + ")"); throw new SBMLException( "ASTNode of type FUNCTION but the variable is not a FunctionDefinition! (" - + (isSetName() ? getName() : "null") + ", " + + (isSetName() ? getName() : "null") + ", " + (isSetParentSBMLObject() ? getParentSBMLObject().getElementName() : "null") + ")"); } @@ -145,23 +145,30 @@ */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ASTCiFunctionNode other = (ASTCiFunctionNode) obj; if (definitionURL == null) { - if (other.definitionURL != null) + if (other.definitionURL != null) { return false; - } else if (!definitionURL.equals(other.definitionURL)) + } + } else if (!definitionURL.equals(other.definitionURL)) { return false; + } if (name == null) { - if (other.name != null) + if (other.name != null) { return false; - } else if (!name.equals(other.name)) + } + } else if (!name.equals(other.name)) { return false; + } return true; } @@ -184,7 +191,7 @@ } /** - * Returns the variable ({@link FunctionDefinition}) of this {@link ASTCiFunctionNode}. + * Returns the variable ({@link FunctionDefinition}) of this {@link ASTCiFunctionNode}. * * @return the variable of this node */ @@ -200,8 +207,8 @@ } } else { logger.debug(MessageFormat.format( - "This ASTCiFunctionNode is not yet linked to a model. " - + "No element with id \"{0}\" could be found.", isSetRefId() ? getRefId() : null)); + "This ASTCiFunctionNode is not yet linked to a model. " + + "No element with id \"{0}\" could be found.", isSetRefId() ? getRefId() : null)); } return function; } @@ -232,7 +239,7 @@ final int prime = 1129; int result = super.hashCode(); result = prime * result - + ((definitionURL == null) ? 0 : definitionURL.hashCode()); + + ((definitionURL == null) ? 0 : definitionURL.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @@ -291,9 +298,9 @@ /** * Set the definitionURL of the MathML element represented by - * this {@link ASTCSymbolCiFunctionNode} + * this {@link ASTCiFunctionNode} * - * @param String definitionURL + * @param definitionURL */ public void setDefinitionURL(String definitionURL) { String old = this.definitionURL; @@ -302,11 +309,11 @@ } /** - * Set an instance of {@link FunctionDefinition} as the variable of this + * Set an instance of {@link FunctionDefinition} as the variable of this * {@link ASTCiFunctionNode}. Note that if the given variable does not - * have a declared {@code id} field, the pointer to this variable will + * have a declared {@code id} field, the pointer to this variable will * get lost when cloning this node. Only references to identifiers are - * permanently stored. The pointer can also not be written to an SBML + * permanently stored. The pointer can also not be written to an SBML * file without a valid identifier. * * @param function a pointer to a {@link FunctionDefinition}. @@ -332,7 +339,7 @@ @Override public String toFormula() throws SBMLException { if (isSetRefId()) { - return compile(new FormulaCompiler()).toString(); + return compile(new FormulaCompiler()).toString(); } throw new SBMLException(); } @@ -343,7 +350,7 @@ @Override public String toLaTeX() throws SBMLException { if (isSetRefId()) { - return compile(new LaTeXCompiler()).toString(); + return compile(new LaTeXCompiler()).toString(); } throw new SBMLException(); } @@ -355,7 +362,7 @@ public String toMathML() { try { if (isSetRefId()) { - return MathMLXMLStreamCompiler.toMathML(this); + return MathMLXMLStreamCompiler.toMathML(this); } throw new SBMLException(); } catch (RuntimeException e) { @@ -363,7 +370,7 @@ return null; } } - + /* (non-Javadoc) * @see java.lang.Object#toString() */ Modified: trunk/core/src/org/sbml/jsbml/math/ASTCiNumberNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/math/ASTCiNumberNode.java 2015-10-14 10:24:09 UTC (rev 2384) +++ trunk/core/src/org/sbml/jsbml/math/ASTCiNumberNode.java 2015-10-15 20:11:15 UTC (rev 2385) @@ -33,6 +33,7 @@ import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.QuantityWithUnit; import org.sbml.jsbml.SBMLException; +import org.sbml.jsbml.Variable; import org.sbml.jsbml.math.compiler.ASTNode2Compiler; import org.sbml.jsbml.math.compiler.ASTNode2Value; import org.sbml.jsbml.math.compiler.FormulaCompiler; @@ -53,359 +54,359 @@ public class ASTCiNumberNode extends ASTNumber implements ASTCSymbolBaseNode { - /** - * - */ - private static final long serialVersionUID = -6842905005458975038L; + /** + * + */ + private static final long serialVersionUID = -6842905005458975038L; - /** - * A {@link Logger} for this class. - */ - static final Logger logger = Logger.getLogger(ASTCiNumberNode.class); + /** + * A {@link Logger} for this class. + */ + static final Logger logger = Logger.getLogger(ASTCiNumberNode.class); - /** - * definitionURL attribute for MathML element - */ - protected String definitionURL; + /** + * definitionURL attribute for MathML element + */ + protected String definitionURL; - /** - * The name of the MathML element represented by this - * {@link ASTCiNumberNode}. - */ - private String refId; + /** + * The name of the MathML element represented by this + * {@link ASTCiNumberNode}. + */ + private String refId; - /** - * Creates a new {@link ASTCiNumberNode}. - */ - public ASTCiNumberNode() { - super(); - setDefinitionURL(null); - setRefId(null); - setType(Type.NAME); - } + /** + * Creates a new {@link ASTCiNumberNode}. + */ + public ASTCiNumberNode() { + super(); + setDefinitionURL(null); + setRefId(null); + setType(Type.NAME); + } - /** - * Copy constructor; Creates a deep copy of the given {@link ASTCiNumberNode}. - * - * @param node - * the {@link ASTCiNumberNode} to be copied. - */ - public ASTCiNumberNode(ASTCiNumberNode node) { - super(node); - if (node.isSetDefinitionURL()) { - setDefinitionURL(node.getDefinitionURL()); - } - if (node.isSetRefId()) { - setRefId(node.getRefId()); - } - } + /** + * Copy constructor; Creates a deep copy of the given {@link ASTCiNumberNode}. + * + * @param node + * the {@link ASTCiNumberNode} to be copied. + */ + public ASTCiNumberNode(ASTCiNumberNode node) { + super(node); + if (node.isSetDefinitionURL()) { + setDefinitionURL(node.getDefinitionURL()); + } + if (node.isSetRefId()) { + setRefId(node.getRefId()); + } + } - /*(non-Javadoc) - * @see org.sbml.jsbml.math.ASTNumber#clone() - */ - @Override - public ASTCiNumberNode clone() { - return new ASTCiNumberNode(this); - } + /*(non-Javadoc) + * @see org.sbml.jsbml.math.ASTNumber#clone() + */ + @Override + public ASTCiNumberNode clone() { + return new ASTCiNumberNode(this); + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) - */ - @Override - public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { - ASTNode2Value<?> value = isSetRefId() ? compiler.compile(getRefId()) : null; - return processValue(value); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTNode2#compile(org.sbml.jsbml.util.compilers.ASTNode2Compiler) + */ + @Override + public ASTNode2Value<?> compile(ASTNode2Compiler compiler) { + ASTNode2Value<?> value = isSetRefId() ? compiler.compile(getRefId()) : null; + return processValue(value); + } - /** - * Returns {@code true} or {@code false} depending on whether this - * {@link ASTCiNumberNode} refers to elements such as parameters or - * numbers with undeclared units. - * - * A return value of {@code true} indicates that the {@code UnitDefinition} - * returned by {@link Variable#getDerivedUnitDefinition()} may not accurately - * represent the units of the expression. - * - * @return {@code true} if the math expression of this {@link ASTCiNumberNode} - * includes parameters/numbers with undeclared units, - * {@code false} otherwise. - */ - public boolean containsUndeclaredUnits() { - if (isSetRefId()) { - CallableSBase reference = getReferenceInstance(); - if (reference != null && reference instanceof QuantityWithUnit) { - return ! ((QuantityWithUnit)reference).isSetUnits(); - } else { - // TODO: reaction doesn't have units but may still have undeclared units - // in kinetic law. - // arrays or other packages - logger.warn("??"); - return true; - } - } - return false; - } + /** + * Returns {@code true} or {@code false} depending on whether this + * {@link ASTCiNumberNode} refers to elements such as parameters or + * numbers with undeclared units. + * + * A return value of {@code true} indicates that the {@code UnitDefinition} + * returned by {@link Variable#getDerivedUnitDefinition()} may not accurately + * represent the units of the expression. + * + * @return {@code true} if the math expression of this {@link ASTCiNumberNode} + * includes parameters/numbers with undeclared units, + * {@code false} otherwise. + */ + public boolean containsUndeclaredUnits() { + if (isSetRefId()) { + CallableSBase reference = getReferenceInstance(); + if (reference != null && reference instanceof QuantityWithUnit) { + return ! ((QuantityWithUnit)reference).isSetUnits(); + } else { + // TODO: reaction doesn't have units but may still have undeclared units + // in kinetic law. + // arrays or other packages + logger.warn("??"); + return true; + } + } + return false; + } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (!super.equals(obj)) { - return false; - } - ASTCiNumberNode other = (ASTCiNumberNode) obj; - if (definitionURL == null) { - if (other.definitionURL != null) { - return false; - } - } else if (!definitionURL.equals(other.definitionURL)) { - return false; - } - if (refId == null) { - if (other.refId != null) { - return false; - } - } else if (!refId.equals(other.refId)) { - return false; - } - return true; - } + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + ASTCiNumberNode other = (ASTCiNumberNode) obj; + if (definitionURL == null) { + if (other.definitionURL != null) { + return false; + } + } else if (!definitionURL.equals(other.definitionURL)) { + return false; + } + if (refId == null) { + if (other.refId != null) { + return false; + } + } else if (!refId.equals(other.refId)) { + return false; + } + return true; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getDefinitionURL() - */ - @Override - public String getDefinitionURL() { - if (isSetDefinitionURL()) { - return definitionURL; - } - PropertyUndefinedError error = new PropertyUndefinedError("definitionURL", this); - if (isStrict()) { - throw error; - } - logger.warn(error); - return ""; - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getDefinitionURL() + */ + @Override + public String getDefinitionURL() { + if (isSetDefinitionURL()) { + return definitionURL; + } + PropertyUndefinedError error = new PropertyUndefinedError("definitionURL", this); + if (isStrict()) { + throw error; + } + logger.warn(error); + return ""; + } - /* (non-Javadoc) - * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getName() - */ - @Override - @Deprecated - public String getName() { - return getRefId(); - } + /* (non-Javadoc) + * @see org.sbml.jsbml.math.ASTCSymbolBaseNode#getName() + */ + @Override + @Deprecated + public String getName() { + return getRefId(); + } - /** - * Returns the variable ({@link CallableSBase}) of this {@link ASTCiNumberNode}. - * - * @return the variable of this node - */ - public CallableSBase getReferenceInstance() { - CallableSBase sbase = null; - if (isSetParentSBMLObject()) { - if (getParentSBMLObject() instanceof KineticLaw) { - sbase = isSetRefId() ? ((KineticLaw) getParentSBMLObject()) - .getLocalParameter(getRefId()): null; - } - if (sbase == null) { - Model m = isSetParentSBMLObject() ? getParentSBMLOb... [truncated message content] |