You can subscribe to this list here.
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(27) |
Jun
(63) |
Jul
(17) |
Aug
(58) |
Sep
(7) |
Oct
(9) |
Nov
(3) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(16) |
Feb
(5) |
Mar
(8) |
Apr
(3) |
May
(9) |
Jun
(7) |
Jul
(11) |
Aug
(1) |
Sep
(5) |
Oct
(33) |
Nov
(21) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(43) |
Mar
(36) |
Apr
(22) |
May
(69) |
Jun
(76) |
Jul
(66) |
Aug
(53) |
Sep
(39) |
Oct
(62) |
Nov
(28) |
Dec
(16) |
2015 |
Jan
(7) |
Feb
(2) |
Mar
(51) |
Apr
(97) |
May
(58) |
Jun
(20) |
Jul
(8) |
Aug
(5) |
Sep
(5) |
Oct
(27) |
Nov
(28) |
Dec
(43) |
2016 |
Jan
(17) |
Feb
(4) |
Mar
(12) |
Apr
(5) |
May
(15) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <nik...@us...> - 2015-10-05 09:08:30
|
Revision: 2363 http://sourceforge.net/p/jsbml/code/2363 Author: niko-rodrigue Date: 2015-10-05 09:08:27 +0000 (Mon, 05 Oct 2015) Log Message: ----------- removing the static blocking setting system properties for the XML parsers as this has some unwanted side effect, for example in OSGi where the properties are global but not all bundles include the stax library Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java 2015-09-25 16:21:10 UTC (rev 2362) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java 2015-10-05 09:08:27 UTC (rev 2363) @@ -82,12 +82,16 @@ */ public class SBMLReader { - static { - // Making sure that we use the good XML library - System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); - System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); - System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); - } + // Commenting out this static block as setting those system properties has some unwanted side + // effect, for example in OSGi where the properties are global + // The fact to use directly WstxOutputFactory and WstxInputFactory when creating the parser + // should prevent the problem that setting those properties was fixing. +// static { +// // Making sure that we use the good XML library +// System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); +// System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); +// System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); +// } /** * Contains all the initialized parsers. Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-09-25 16:21:10 UTC (rev 2362) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-10-05 09:08:27 UTC (rev 2363) @@ -85,12 +85,16 @@ */ public class SBMLWriter { - static { + // Commenting out this static block as setting those system properties has some unwanted side + // effect, for example in OSGi where the properties are global + // The fact to use directly WstxOutputFactory and WstxInputFactory when creating the parser + // should prevent the problem that setting those properties was fixing. + //static { // Making sure that we use the good XML library - System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); - System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); - System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); - } + // System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); + // System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); + // System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); + //} /** * Returns the default symbol to be used to indent new elements in the XML This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lea...@us...> - 2015-09-25 16:21:12
|
Revision: 2362 http://sourceforge.net/p/jsbml/code/2362 Author: leandrohw Date: 2015-09-25 16:21:10 +0000 (Fri, 25 Sep 2015) Log Message: ----------- Added a piece of code that handles the issue of having x +- y in the flattening code. Modified Paths: -------------- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-24 00:47:29 UTC (rev 2361) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-25 16:21:10 UTC (rev 2362) @@ -2346,7 +2346,7 @@ return dummy; } - + /** * * @param left @@ -3168,9 +3168,25 @@ plus(negValues); + ASTNode plus = getNode(); + ASTNode minus = new ASTNode(ASTNode.Type.MINUS); + if(plus.getChildCount() > 0) { + minus.addChild(plus.getChild(0)); + + for(int i = 1; i < plus.getChildCount(); i++) + { + if(plus.getChild(i).getType() == ASTNode.Type.MINUS && plus.getChild(i).getChildCount() == 1) + { + minus.addChild(plus.getChild(i).getChild(0)); + } + } + + setNode(minus); + } return dummy; } + /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#neq(org.sbml.jsbml.ASTNode, org.sbml.jsbml.ASTNode) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lea...@us...> - 2015-09-24 00:47:32
|
Revision: 2361 http://sourceforge.net/p/jsbml/code/2361 Author: leandrohw Date: 2015-09-24 00:47:29 +0000 (Thu, 24 Sep 2015) Log Message: ----------- Fixed a bug in the flattening where selector wasn't getting replaced when there was an expression in the children math Modified Paths: -------------- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.java Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-21 13:44:33 UTC (rev 2360) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-24 00:47:29 UTC (rev 2361) @@ -81,7 +81,7 @@ /** * */ - private final boolean useId; + private boolean useId; /** * */ @@ -4060,6 +4060,8 @@ nodes.get(0).compile(this); ASTNode vector = getNode(); ASTNode selector = new ASTNode(ASTNode.Type.FUNCTION_SELECTOR); + boolean temp = useId; + useId = false; boolean useNumber = true; for (int i = 1; i < nodes.size(); ++i) { nodes.get(i).compile(this); @@ -4089,6 +4091,7 @@ } else { setNode(selector); } + useId = temp; } return dummy; } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.java 2015-09-21 13:44:33 UTC (rev 2360) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.java 2015-09-24 00:47:29 UTC (rev 2361) @@ -88,7 +88,6 @@ Map<String, ASTNode> idToVector = new HashMap<String, ASTNode>(); getVectors(flattenedDoc.getModel(), idToVector); - convert(flattenedDoc, model, new ArraysCompiler(), idToVector, new ArrayList<Integer>()); convertMath(flattenedDoc, model, idToVector); @@ -134,8 +133,7 @@ catch(IllegalArgumentException exception) { throw new SBMLException(MessageFormat.format( - "Could not add SBase {0} because this object has an id that" - + " is already present in the model. Flattening Failed.", child)); + "Could not add SBase {0} because this object has an id that is already present in the model. Flattening Failed.", child)); } return; } @@ -150,8 +148,7 @@ } throw new SBMLException(MessageFormat.format( - "Could not add SBase {0} to the model because {1} does not" - + " have the correct type (ListOf).", child, parent)); + "Could not add SBase {0} to the model because {1} does not have the correct type (ListOf).", child, parent)); } /** @@ -600,22 +597,6 @@ } } - // /** - // * - // * @param sbase - // * @param dimId - // * @param index - // */ - // private static void updateIndexMath(SBase sbase, String dimId, int index) - // { - // ArraysSBasePlugin plugin = (ArraysSBasePlugin) sbase.getPlugin("arrays"); - // - // for(Index i : plugin.getListOfIndices()) - // { - // i.setMath(replaceDimensionId(i.getMath(), dimId, index)); - // } - // } - /** * This updates the metaid of an SBase. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-09-21 13:44:38
|
Revision: 2360 http://sourceforge.net/p/jsbml/code/2360 Author: niko-rodrigue Date: 2015-09-21 13:44:33 +0000 (Mon, 21 Sep 2015) Log Message: ----------- merge revisions: 2343 2348-52 2354 2355-59 + removed the stax-api-1.0.1.jar file as it should be included in the jdk + added a new method to the ASTNode class: toSimpleString. It should be used in SimpleTreeNodeChangeListener to display ASTNode and might become the default toString method in the near future. + added a new static variable to ASTNode: IMPLEMENTATION_VERSION, so that we can check easily which implementation we are using Modified Paths: -------------- branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.dot branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.pdf branches/astnode2-merging-alternate/core/doc/common/tex/literature.bib branches/astnode2-merging-alternate/core/doc/user_guide/JSBML_Acknowledgments.tex branches/astnode2-merging-alternate/core/doc/user_guide/JSBML_FAQ.tex branches/astnode2-merging-alternate/core/doc/user_guide/JSBML_compared_to_libSBML.tex branches/astnode2-merging-alternate/core/doc/user_guide/JSBML_extensions_overview.tex branches/astnode2-merging-alternate/core/doc/user_guide/JSBML_hello_world_examples.tex branches/astnode2-merging-alternate/core/doc/user_guide/User_Guide.tex branches/astnode2-merging-alternate/core/doc/user_guide/src/org/sbml/jsbml/gui/JSBMLvisualizer.java branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractSBase.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CVTerm.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/Creator.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/Model.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/Reaction.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/Species.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/validator/SBMLValidator.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/validator/SyntaxChecker.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/test/HashCodeTest.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java branches/astnode2-merging-alternate/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java branches/astnode2-merging-alternate/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java branches/astnode2-merging-alternate/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java branches/astnode2-merging-alternate/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java branches/astnode2-merging-alternate/extensions/layout/doc/img/type_hierarchy.dot branches/astnode2-merging-alternate/extensions/layout/doc/img/type_hierarchy.pdf branches/astnode2-merging-alternate/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java branches/astnode2-merging-alternate/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java branches/astnode2-merging-alternate/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java branches/astnode2-merging-alternate/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java branches/astnode2-merging-alternate/extensions/multi/doc/img/type_hierarchy.dot branches/astnode2-merging-alternate/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java branches/astnode2-merging-alternate/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java branches/astnode2-merging-alternate/extensions/qual/doc/img/type_hierarchy.dot branches/astnode2-merging-alternate/extensions/qual/doc/img/type_hierarchy.pdf branches/astnode2-merging-alternate/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java Added Paths: ----------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.newASTNode branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CompartmentalizedSBase.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserConstants.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserTokenManager.java branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java Removed Paths: ------------- branches/astnode2-merging-alternate/core/lib/stax-api-1.0.1.jar branches/astnode2-merging-alternate/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java branches/astnode2-merging-alternate/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupKind.java Property Changed: ---------------- branches/astnode2-merging-alternate/ Index: branches/astnode2-merging-alternate =================================================================== --- branches/astnode2-merging-alternate 2015-09-21 08:59:42 UTC (rev 2359) +++ branches/astnode2-merging-alternate 2015-09-21 13:44:33 UTC (rev 2360) Property changes on: branches/astnode2-merging-alternate ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:2191,2194-2195,2197-2200,2202-2206,2209-2213,2216-2220,2222,2224-2244,2246-2248,2251-2262,2280,2293,2296-2297,2301-2305,2307-2310,2313,2318,2320-2321,2325-2326,2332-2333 +/trunk:2191,2194-2195,2197-2200,2202-2206,2209-2213,2216-2220,2222,2224-2244,2246-2248,2251-2262,2280,2293,2296-2297,2301-2305,2307-2310,2313,2318,2320-2321,2325-2326,2332-2333,2343,2348-2352,2354-2359 \ No newline at end of property Modified: branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.dot =================================================================== --- branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.dot 2015-09-21 08:59:42 UTC (rev 2359) +++ branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.dot 2015-09-21 13:44:33 UTC (rev 2360) @@ -67,6 +67,7 @@ Assignment [label="<<interface>>\nAssignment", style="filled", fillcolor="#F0F8FF"]; CallableSBase [label="<<interface>>\nCallableSBase", style="filled", fillcolor="#F0F8FF"]; + CompartmentalizedSBase [label="<<interface>>\nCompartmentalized\nSBase", style="filled", fillcolor="#F0F8FF"]; MathContainer [label="<<interface>>\nMathContainer", style="filled", fillcolor="#F0F8FF"]; NamedSBase [label="<<interface>>\nNamedSBase", style="filled", fillcolor="#F0F8FF"]; NamedSBaseWithDerivedUnit [label="<<interface>>\nNamedSBase\nWithDerivedUnit", style="filled", fillcolor="#F0F8FF"]; @@ -127,7 +128,7 @@ RateRule [label="Rate\nRule"]; Reaction [label="Reaction"]; SBMLDocument [label="SBML\nDocument"]; - SimpleTreeNodeChangeListener [label="Simple\nTreeNode\nChangeListener", fillcolor="#FFFFE0"]; + SimpleTreeNodeChangeListener [label="Simple\nTreeNode\nChangeListener", style="filled", fillcolor="#F0F8FF"]; Species [label="Species"]; SpeciesReference [label="Species\nReference"]; SpeciesType [label="Species\nType"]; @@ -185,6 +186,8 @@ CallableSBase -> FunctionDefinition [dir=back,arrowtail=empty,style=dashed]; CallableSBase -> Reaction [dir=back,arrowtail=empty,style=dashed]; Cloneable -> TreeNodeWithChangeSupport [dir=back,arrowtail=empty,style=dashed]; + CompartmentalizedSBase -> Species [dir=back,arrowtail=empty,style=dashed]; + CompartmentalizedSBase -> Reaction [dir=back,arrowtail=empty,style=dashed]; EventObject -> PropertyChangeEvent [dir=back,arrowtail=empty]; EventListener -> PropertyChangeEvent [style=invis]; // Helper for better layout EventListener -> PropertyChangeListener [dir=back,arrowtail=empty,style=dashed]; @@ -194,6 +197,7 @@ MathContainer -> AbstractMathContainer [dir=back,arrowtail=empty,style=dashed]; MathContainer -> Assignment [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> AbstractNamedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> CompartmentalizedSBase [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> NamedSBaseWithDerivedUnit [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> UniqueNamedSBase [dir=back,arrowtail=empty,style=dashed]; NamedSBaseWithDerivedUnit -> AbstractNamedSBaseWithUnit [dir=back,arrowtail=empty,style=dashed]; Modified: branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.pdf =================================================================== --- branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.pdf 2015-09-21 08:59:42 UTC (rev 2359) +++ branches/astnode2-merging-alternate/core/doc/common/img/FullTypeHierarchy.pdf 2015-09-21 13:44:33 UTC (rev 2360) @@ -1,402 +1,540 @@ -%PDF-1.3 -%\xC4\xE5\xF2\xE5\xEB\xA7\xF3\xA0\xD0\xC4\xC6 -4 0 obj -<< /Length 5 0 R /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FB\xC1?\xE3+܌\xAD\x93\x94-\x84HF\xAB-/\x84H\xBC\xAEP1!\xE2.\xA2\xD931\xEA\x86\xE3w\x9C&\xC7\xF1\x8D\xF7\x85\xF86b\xC4O\xEA\xE2\xBEΕ\x9Cސ?5\xEB\xF7\x9E&v\xC8\xD2k\xFBh\xF6\xEAs-'\xE7?\x95QX'S x\xC2o\3;/\xB0\xB3\xD3\xE1\xBA\xFDA\xE9\xFE4\x8B\xD7\xC3p)\xB4\xC6 +\xA6\xA3\xDEX\xC0Bδ\xD5\xE9\xF1П\xDB\xF13o\xD4\xF29\xF7:o\xC4\xF2\xB4vI\xDC#\x96wh~cA\xE2*\x98\x90\xC1\x8A\xAC +\xF3\x8F\xF6\x84.\x94B\xE2\x998@E`\xED\xFB\xC6 +Z\xBBq\xB0\xC2ҧ\xBCf<Tx\xA2\xA1\x8Au@y \xED\x8C~^{\xF8\x8F\xB3j\x93XM;\xF8(T\xF10\xB6\xA4Z\x87\xA2\xE5\xBA\xD5ew\xF6\x9E\x88\xF7Z!\x86\xEBd\x96ֻF\xE0c\x9F\xD9f?\xC17\x806\xAB\xFC\x9DAFQ\x96A[\x92\x8Bͽ\xDF\xEEz\x9C\xC8B5x\xE0fM(L\xED\xC1\xE5\x90\xC3\xDF\xDD.\xF6K?ܨ\xEC\xE8\xA4W5\xE3\x8D +\x82\xF93T\xD8\xCE~V\x94\xE1\x945\xE6\xAC>iB\xFB\xE3\xE1\xFF\xC7c\xEF. endstream endobj -5 0 obj -13105 +4 0 obj + 8945 endobj 2 0 obj -<< /Type /Page /Parent 3 0 R /Resources 6 0 R /Contents 4 0 R /MediaBox [0 0 1601 783] +<< + /ExtGState << + /a0 << /CA 1 /ca 1 >> + >> + /Font << + /f-0-1 5 0 R + /f-1-1 6 0 R + /f-2-1 7 0 R + >> >> endobj -6 0 obj -<< /ProcSet [ /PDF /Text ] /ColorSpace << /Cs1 7 0 R >> /Font << /F2.0 9 0 R -/F1.0 8 0 R >> >> +8 0 obj +<< /Type /Page + /Parent 1 0 R + /MediaBox [ 0 0 1798 787 ] + /Contents 3 0 R + /Group << + /Type /Group + /S /Transparency + /I true + /CS /DeviceRGB + >> + /Resources 2 0 R +>> endobj -10 0 obj -<< /Length 11 0 R /N 3 /Alternate /DeviceRGB /Filter /FlateDecode >> +9 0 obj +<< /Length 10 0 R + /Filter /FlateDecode + /Length1 7516 +>> stream -x\x9D\x96wTS\xD9\x87Ͻ7\xBD\xD0" %\xF4z \xD2;HQ\x89I\x80P\x86\x84&vDF)VdT\xC0G\x87"cE\x83\x82b\xD7 \xF2P\xC6\xC1QDE\xE5k \xEF\xAD5\xF3ޚ\xFD\xC7Y\xDF\xD9\xE7\xB7\xD7\xD9g\xEF}-E\xD56<~&\xE5\x94S\xB3\xC52\xFF\xCA\xF4\x95)2\x8612\xA1 \xA2\xAC"\xE3įl\xF6\xA7\xE6+\xBBɘ\x97&\xE4\xA1Y\xCE\xBC4\x9E\x8C\xBBPޚ%ᣌ\xA1\\x98%\xE0g\xA3|e\xBDTI\x9A-\x84\xD5\xE16'~\x9Dkhu_-Ⱦ\xBCh\xAD\x91\xAFs\x8F2z\xFE\xE7\xFA\\x8An\xE1LA"S\xE6\xF6\x8Fdr%\xA2,\xA3߄l\xC1\x90t\xA0 -4\x81.0,` -\x803p\xDE -A1\xD8v\x83jp-\x86\xC1K0ށi\x82\xF0\xA2A\xAA\x90\xA4\x99B\xD6ZyCAP8\xC5C\x89\x90\x92@\xF9\xD0&\xA8*\x83\xAA\xA1CP=\xF4#t\xBA]\x83\xFA\xA0\xD0 4\xFD}\x84\x98\xD3a -\xD8-ߏƿ'\x90 Zk\x82!\x96 $l$T\xE7\xFD\x84\xC24Q\x81\xA8Ot"\x86y\xC4\b)\xB1\x8E\xD8A\xBCI&N\x93I\x86$R$)\x99\xB4\x81TIj"]&=&\xBD!\x93\xC9:dGrY@^O\xAE$\x9F _%\x92?P\x94(&OJEB\xD9N9J\xB9@y@yC\xA5R -\xA8n\xD4X\xAA\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xD3qI\x9C\xEEh]fٶ0\xF9\xC9hmF\xA1+LV\xF9Jk3\xB6e\xD6z\\x99\xB3\xAE\xCC\x8F\xE9k\x9E\xE3\xD7\xF2\xD7\xF2\xD3\xF8">?\x8Eܼȧ\xF0ɂ^\xD0 +!^\x88\x81\x93ߌT9\xB8\xE3\xE4+tbn\xDD5\x80\x9F4CN\xE7\xE1%\xCB&\xBF\xDCm\x8Bz亽3\xB4L\xEA\xF4\x87\x96H~\xE7ၮK\x88\xBBd\xF1\x80\xE4?]\x81\xB9-\x87\xBB|\x9D\xFE\x91߀\xF2\xF50\xDAQ\xBD\xA2\xF5\xA2\xB16\x9CkE\xF5%\x94U\xCB\xCAV\xC8cu\xB4^B\xDC*\x8B;\xE4\xB1Z\xE5\xB1Z\xE5\xB1:|\xCAX\xF2<\xBD\xCD\xD57\xF5ct⦉cFs\xA8n\xF6\xFC\xFC\x9A\xFA\xC3d\xB7\xBC\x93\xAE\x84\xFF\xAB\xAA\xBAG endstream endobj +10 0 obj + 4811 +endobj 11 0 obj -2612 +<< /Length 12 0 R + /Filter /FlateDecode +>> +stream +x\x9C]\x91\xCDj\xC5 \x85\xF7>\xC5,o\x93\xF4\x82P\xEE\xDDd\xD1\x9A\xF6\x8CNR\xE1Feby\xFBsI\xB1 +\x9F3Gg\xF8\xA997\xD6\xE0\xE4T\x8Bzc5\xE1\xE4fRƲ\xB2mT\xB8R\xBA\xD5(=\xE3Q\xDC.S\xC0\xB1\xB1\xBDcu +\xFC36\xA7@^\xB4\xEB\xF0\x86+endstream endobj -7 0 obj -[ /ICCBased 10 0 R ] -endobj -3 0 obj -<< /Type /Pages /MediaBox [0 0 1601 783] /Count 1 /Kids [ 2 0 R ] >> -endobj 12 0 obj -<< /Type /Catalog /Pages 3 0 R >> + 250 endobj 13 0 obj -<< /Length 14 0 R /Length1 10808 /Filter /FlateDecode >> -stream -x\xBDZw\T\xC7ڞ9ew)JY\xE9ew9,PIJ"\x8B`E,lA\xC4F,X\xBD\K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FFP)!\xD6;%\xCDO=\xCD\xFF\xE9\xD7+\x85\xA4Y\xF2&\xF9\xDB\xE4\xCA\x95\xE6\xD9^*C\xA0fK\xA40\xB6}['\x87_^\xFC\xAA\xC0o\xFE݇\xC9\x89\xF7\xD6(\x9C\xFB$\xE1\xBF\xCB\xC9$\xFF\x81@҈ \xBF\x9B\x88\9\x9BXH\x8E\xF2[\x84<\xFC\xFC\x86\xFD\xE2`,\xA7\xFC&\xA2-endstream +<< /Type /FontDescriptor + /FontName /ZGSWHW+Helvetica + /FontFamily (Helvetica) + /Flags 4 + /FontBBox [ -950 -480 1445 1121 ] + /ItalicAngle 0 + /Ascent 770 + /Descent -229 + /CapHeight 1121 + /StemV 80 + /StemH 80 + /FontFile2 9 0 R +>> endobj 14 0 obj -6690 +<< /Type /Font + /Subtype /CIDFontType2 + /BaseFont /ZGSWHW+Helvetica + /CIDSystemInfo + << /Registry (Adobe) + /Ordering (Identity) + /Supplement 0 + >> + /FontDescriptor 13 0 R + /W [0 [ 633 500 556 500 277 556 277 500 556 556 500 ]] +>> endobj +5 0 obj +<< /Type /Font + /Subtype /Type0 + /BaseFont /ZGSWHW+Helvetica + /Encoding /Identity-H + /DescendantFonts [ 14 0 R] + /ToUnicode 11 0 R +>> +endobj 15 0 obj -<< /Type /FontDescriptor /Ascent 770 /CapHeight 717 /Descent -230 /Flags 96 -/FontBBox [-933 -481 1571 1138] /FontName /FQPLCM+Helvetica-Oblique /ItalicAngle --6 /StemV 0 /AvgWidth -441 /MaxWidth 1500 /XHeight 523 /FontFile2 13 0 R >> +<< /Length 16 0 R + /Filter /FlateDecode + /Length1 16080 +>> +stream +x\x9C\xBD{y|TE\xB6-w\xEB5ݝ\xDE\xF7N\xA7\xBB\xD3\xE9,$! \xA4 + \x84%Ȣ\x90\xA0A\xF6M!,<F\x81+\xC8"\xE0\x82\xAB\x98\xA24 >\x8EO\xC1\x95q}\xA2\xC3,g\xE6\x87:t\xE7w\xEAv\x83Û\x8F\xCC\xE7\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V\xA3Nˌ\xC1Hcf\x99d\x970h5\xD2\xD32[\xC043\xCB\xDCu[\xE6&\x9D\xF5Vˬ\xC0\x85\xF0\xC5\xDC\xC1\xD0\xE37\xAB\xB9 +\xF8\xB5Dq\x9E\x89g\xB4%\x8A\xD8܌\xED\xB8\xCC\xCF\xE5\xBFB.\xE4F\x87\xA2e~+\xDE\xC2S\xF6p\xE3&~M*?J\xA2\xAB\z\xBDI\xE8\xE3\xA2\xEA>&\x85\x9B\xB8\xDD6\x9AG\xCAtyz\xBBW\x91g\xB3y\xBC\xBB|3\xA7\xFE0?l \xDCfv\xFA \xA7%\x90\xD4A\x95Y\x91\x8F4F]~r\x8E\x9Cps\x94/ϑҪ·9\x82H\xB2\xF9l\x8E\xF2o3Gl\x9A`\x96$\x9C\x9C%P\xBD\x86\xA42\x86u\xE0\xF3\x86@\xEB\xF9\xFC\x9C\xF7֟\xF2\x9Di\xFD$\xF1\xED_\xBF\xF9\xF4\xC1\xBE\xEES\xF6\x8D͉\x8F:\xD0+_\xBD|\xCC\xE0\xBFJ\>\xBE~w\xE2\xDDęD"\xF1\x9F\xFB\xEA7\}\xFAĎ\xFF\xC6/\xE3\xEA\xFFӥsq_\x99\xBB\x84\xA3&P0J\x94pDm߃\xB2\xC4˻tY\x92\xAC\xACikc\xC4L\xD6Ie\x9Fp>\xC0\xBF\xAC\xBD +=-\xD8&m\xD1=e~\x89\xDB+\xED\xD6\xED3Ǥs\xD2G\xDCW\xDA\xDF\xD5}$\xC1e\xD5.\x83\xCA&\xDAl&J\xB1;!\x93\xCD\xEE\x88a\xAC\x82\x86\x9ER,\xDE,dႪTX.= b\xD19^9\xA5QDX\x91d\xD0S-D\xB2@\x93RD +\xE9\x86B\x99\xCD\xC8H... [truncated message content] |
From: <and...@us...> - 2015-09-21 08:59:46
|
Revision: 2359 http://sourceforge.net/p/jsbml/code/2359 Author: andreas-draeger Date: 2015-09-21 08:59:42 +0000 (Mon, 21 Sep 2015) Log Message: ----------- Implemented a new interface CompartmentalizedSBase and changed all elements that can have a compartment accordingly. The new type hierarchy is now also reflected in all relevant dot files for the Users' Guide. I also updated all used URNs to identifiers.org URIs. Modified Paths: -------------- trunk/core/doc/common/img/FullTypeHierarchy.dot trunk/core/doc/common/img/FullTypeHierarchy.pdf trunk/core/src/org/sbml/jsbml/CVTerm.java trunk/core/src/org/sbml/jsbml/Reaction.java trunk/core/src/org/sbml/jsbml/Species.java trunk/core/test/org/sbml/jsbml/test/HashCodeTest.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java trunk/extensions/layout/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.pdf trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java trunk/extensions/multi/doc/img/type_hierarchy.dot trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java trunk/extensions/qual/doc/img/type_hierarchy.dot trunk/extensions/qual/doc/img/type_hierarchy.pdf trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java Added Paths: ----------- trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java Modified: trunk/core/doc/common/img/FullTypeHierarchy.dot =================================================================== --- trunk/core/doc/common/img/FullTypeHierarchy.dot 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/core/doc/common/img/FullTypeHierarchy.dot 2015-09-21 08:59:42 UTC (rev 2359) @@ -67,6 +67,7 @@ Assignment [label="<<interface>>\nAssignment", style="filled", fillcolor="#F0F8FF"]; CallableSBase [label="<<interface>>\nCallableSBase", style="filled", fillcolor="#F0F8FF"]; + CompartmentalizedSBase [label="<<interface>>\nCompartmentalized\nSBase", style="filled", fillcolor="#F0F8FF"]; MathContainer [label="<<interface>>\nMathContainer", style="filled", fillcolor="#F0F8FF"]; NamedSBase [label="<<interface>>\nNamedSBase", style="filled", fillcolor="#F0F8FF"]; NamedSBaseWithDerivedUnit [label="<<interface>>\nNamedSBase\nWithDerivedUnit", style="filled", fillcolor="#F0F8FF"]; @@ -127,7 +128,7 @@ RateRule [label="Rate\nRule"]; Reaction [label="Reaction"]; SBMLDocument [label="SBML\nDocument"]; - SimpleTreeNodeChangeListener [label="Simple\nTreeNode\nChangeListener", fillcolor="#FFFFE0"]; + SimpleTreeNodeChangeListener [label="Simple\nTreeNode\nChangeListener", style="filled", fillcolor="#F0F8FF"]; Species [label="Species"]; SpeciesReference [label="Species\nReference"]; SpeciesType [label="Species\nType"]; @@ -185,6 +186,8 @@ CallableSBase -> FunctionDefinition [dir=back,arrowtail=empty,style=dashed]; CallableSBase -> Reaction [dir=back,arrowtail=empty,style=dashed]; Cloneable -> TreeNodeWithChangeSupport [dir=back,arrowtail=empty,style=dashed]; + CompartmentalizedSBase -> Species [dir=back,arrowtail=empty,style=dashed]; + CompartmentalizedSBase -> Reaction [dir=back,arrowtail=empty,style=dashed]; EventObject -> PropertyChangeEvent [dir=back,arrowtail=empty]; EventListener -> PropertyChangeEvent [style=invis]; // Helper for better layout EventListener -> PropertyChangeListener [dir=back,arrowtail=empty,style=dashed]; @@ -194,6 +197,7 @@ MathContainer -> AbstractMathContainer [dir=back,arrowtail=empty,style=dashed]; MathContainer -> Assignment [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> AbstractNamedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> CompartmentalizedSBase [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> NamedSBaseWithDerivedUnit [dir=back,arrowtail=empty,style=dashed]; NamedSBase -> UniqueNamedSBase [dir=back,arrowtail=empty,style=dashed]; NamedSBaseWithDerivedUnit -> AbstractNamedSBaseWithUnit [dir=back,arrowtail=empty,style=dashed]; Modified: trunk/core/doc/common/img/FullTypeHierarchy.pdf =================================================================== (Binary files differ) Modified: trunk/core/src/org/sbml/jsbml/CVTerm.java =================================================================== --- trunk/core/src/org/sbml/jsbml/CVTerm.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/core/src/org/sbml/jsbml/CVTerm.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -506,7 +506,7 @@ * * @param urn * string representing the resource; e.g., - * 'urn:miriam:kegg.reaction:R00351' + * 'http://identifiers.org/kegg.reaction/R00351' * @return {@code true} as specified in {@link Collection#add(Object)} */ public boolean addResource(String urn) { @@ -522,7 +522,7 @@ * Adds list of resources to the {@link CVTerm}. * * @param resources a list of strings representing the resources; e.g., - * 'urn:miriam:kegg.reaction:R00351' + * 'http://identifiers.org/kegg.reaction/R00351' * @return {@code true} if all the resources have been added properly. */ public boolean addResources(String... resources) { @@ -540,7 +540,7 @@ * * @param uri * string representing the resource; e.g., - * 'urn:miriam:kegg.reaction:R00351' + * 'http://identifiers.org/kegg.reaction/R00351' * * @return {@code true} if 'uri' has been added to the list of resourceURI of this * CVTerm. @@ -578,7 +578,7 @@ * * @param patterns * an arbitrary number of {@link Pattern}(s), e.g., - * {@code urn:miriam:kegg.reaction:R.*}, {@code .*kegg.*} or just {@code kegg} that + * {@code http://identifiers.org/kegg.reaction/R.*}, {@code .*kegg.*} or just {@code kegg} that * are matched to all resources using an OR-operation, i.e., * if just one of the patterns matches a resource, this resource will * appear in the returned list. @@ -613,7 +613,7 @@ * * @param patterns * an arbitrary number of patterns, e.g., - * {@code urn:miriam:kegg.reaction:R.*}, {@code .*kegg.*} or just {@code kegg} that + * {@code http://idenifiers.org/kegg.reaction/R.*}, {@code .*kegg.*} or just {@code kegg} that * are matched to all resources using an OR-operation, i.e., * if just one of the patterns matches a resource, this resource will * appear in the returned list. Added: trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java (rev 0) +++ trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -0,0 +1,115 @@ +/* + * $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. + * + * Copyright (C) 2009-2015 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 + * + * 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; + +/** + * @author Andreas Dräger + * @version $Rev$ + * @since 1.1 + * @date 21.09.2015 + */ +public interface CompartmentalizedSBase extends NamedSBase { + + /** + * Returns the value of the referenced compartment. + * + * @return the value of the referenced compartment or an empty {@link String} + * if it is not set. + */ + public String getCompartment(); + + /** + * Returns the {@link Compartment} that is referenced by this {@link SBase}. + * + * Note that the return type of this method is {@link NamedSBase} because it + * could be possible that some subclasses link other elements than + * {@link Compartment}. + * + * @return the object in the {@link Model} that represents the linked + * {@link Compartment} or {@code null} if it does not exist or cannot + * be retrieved (e.g., if this component has not yet been linked to a + * {@link Model}). + */ + public NamedSBase getCompartmentInstance(); + + /** + * @return {@code true} if for this object the compartment attribute is + * mandatory, {@code false} otherwise. + */ + public boolean isCompartmentMandatory(); + + /** + * @return {@code true} if compartment attribute is set, i.e., not + * {@code null}, {@code false} otherwise. + */ + public boolean isSetCompartment(); + + /** + * @return {@code true} if the {@link Compartment} which has the compartment + * identifier stored in this {@link CompartmentalizedSBase} as id is + * not {@code null} and this {@link Compartment} can be retrieved from + * the {@link Model} that contains this {@link CompartmentalizedSBase}. + * In other words, this method also returns {@code false} if the + * this object is not linked to any model. + */ + public boolean isSetCompartmentInstance(); + + /** + * Sets the compartment identifiers of this {@link CompartmentalizedSBase} to + * the id of the {@link Compartment} 'compartment'. + * <p> + * The compartment attribute is used to add a reference to the id of + * the corresponding {@link Compartment} in the {@link Model}. + * In some situations, the compartment might be optional, so that the user can + * even specify {@link Compartment}s that are not part of the {@link Model}. + * + * @param compartment the {@link Compartment} whose identifier should be referenced. + * @return {@code true} if this operation caused any change. + * @see #setCompartment(String) + * @see #isCompartmentMandatory() + */ + public boolean setCompartment(Compartment compartment); + + /** + * Sets the compartment attribute. + * <p> + * The required attribute compartment is used to identify the + * {@link Compartment} in which the {@link CompartmentalizedSBase} is located. + * The attribute's value should be the identifier of an existing + * {@link Compartment} object in the model. + * + * @param compartmentId + * the identifier of the compartment to be set. + * @return {@code true} if this operation caused any change. + * @see #setCompartment(Compartment) + * @see #isCompartmentMandatory() + */ + public boolean setCompartment(String compartmentId); + + /** + * Remove the reference to a compartment, i.e., unset the value of the + * variable 'compartment'. + * + * @return {@code true} if compartment was set before, otherwise {@code false}. + */ + public boolean unsetCompartment(); + +} Property changes on: trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id URL Rev \ No newline at end of property Modified: trunk/core/src/org/sbml/jsbml/Reaction.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Reaction.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/core/src/org/sbml/jsbml/Reaction.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -41,8 +41,8 @@ * @since 0.8 * @version $Rev$ */ -public class Reaction extends AbstractNamedSBase implements CallableSBase, -UniqueNamedSBase { +public class Reaction extends AbstractNamedSBase +implements CallableSBase, CompartmentalizedSBase, UniqueNamedSBase { /** * Generated serial version identifier. @@ -543,18 +543,23 @@ * @return the compartmentID of this {@link Reaction}. The empty * {@link String} if it is not set. */ + @Override public String getCompartment() { return isSetCompartment() ? compartmentID : ""; } - /** - * - * @return the Compartment instance which has the compartmentID of this - * Reaction as id. Can be null if it doesn't exist. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartmentInstance() */ + @Override public Compartment getCompartmentInstance() { - Model m = getModel(); - return m != null ? m.getCompartment(compartmentID) : null; + if (isSetCompartment()) { + Model m = getModel(); + if (m != null) { + return m.getCompartment(compartmentID); + } + } + return null; } /* (non-Javadoc) @@ -911,6 +916,14 @@ return hasReactant(s) || hasProduct(s) || hasModifier(s); } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isCompartmentMandatory() + */ + @Override + public boolean isCompartmentMandatory() { + return false; + } + /** * * @return the boolean value of fast if it is set, {@code false} otherwise. @@ -935,22 +948,20 @@ return getReversible(); } - /** - * - * @return {@code true} if the compartmentID of this Reaction is not {@code null}. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartment() */ + @Override public boolean isSetCompartment() { return compartmentID != null; } - /** - * - * @return {@code true} if the Compartment which has the compartmentID of this - * Reaction as id is not null; + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartmentInstance() */ + @Override public boolean isSetCompartmentInstance() { - Model m = getModel(); - return m != null ? m.getCompartment(compartmentID) != null : false; + return getCompartmentInstance() != null; } /** @@ -1015,11 +1026,11 @@ if (!isAttributeRead) { isAttributeRead = true; - if (attributeName.equals("reversible")) { + if (attributeName.equals(TreeNodeChangeEvent.reversible)) { setReversible(StringTools.parseSBMLBoolean(value)); - } else if (attributeName.equals("fast")) { + } else if (attributeName.equals(TreeNodeChangeEvent.fast)) { setFast(StringTools.parseSBMLBoolean(value)); - } else if (attributeName.equals("compartment")) { + } else if (attributeName.equals(TreeNodeChangeEvent.compartment)) { this.setCompartment(value); } else { isAttributeRead = false; @@ -1180,14 +1191,12 @@ return remove(listOfReactants, id); } - /** - * Sets the compartmentID of this {@link Reaction} to the id of the {@link Compartment} - * 'compartment'. - * - * @param compartment + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(org.sbml.jsbml.Compartment) */ - public void setCompartment(Compartment compartment) { - setCompartment(compartment != null ? compartment.getId() : null); + @Override + public boolean setCompartment(Compartment compartment) { + return setCompartment(compartment != null ? compartment.getId() : null); } /** @@ -1198,15 +1207,20 @@ * @throws PropertyNotAvailableException * if Level < 3. */ - public void setCompartment(String compartmentID) { + @Override + public boolean setCompartment(String compartmentID) { if (getLevel() < 3) { throw new PropertyNotAvailableException(TreeNodeChangeEvent.compartment, this); } - String oldCompartmentID = this.compartmentID; - this.compartmentID = compartmentID; - firePropertyChange(TreeNodeChangeEvent.compartment, oldCompartmentID, - compartmentID); + if (compartmentID != this.compartmentID) { + String oldCompartmentID = this.compartmentID; + this.compartmentID = compartmentID; + firePropertyChange(TreeNodeChangeEvent.compartment, oldCompartmentID, + compartmentID); + return true; + } + return false; } /** @@ -1289,6 +1303,18 @@ firePropertyChange(TreeNodeChangeEvent.reversible, oldReversible, reversible); } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#unsetCompartment() + */ + @Override + public boolean unsetCompartment() { + if (getLevel() > 2) { + // Avoid exception when unsetting a compartment attribute. + return setCompartment((String) null); + } + return false; + } + /** * Sets the fast Boolean of this Reaction to {@code null}. */ @@ -1385,15 +1411,15 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetReversible()) { - attributes.put("reversible", Boolean.toString(getReversible())); + attributes.put(TreeNodeChangeEvent.reversible, Boolean.toString(getReversible())); } if (isSetFast()) { - attributes.put("fast", Boolean.toString(getFast())); + attributes.put(TreeNodeChangeEvent.fast, Boolean.toString(getFast())); } if (2 < getLevel()) { if (isSetCompartment()) { - attributes.put("compartment", getCompartment()); + attributes.put(TreeNodeChangeEvent.compartment, getCompartment()); } } Modified: trunk/core/src/org/sbml/jsbml/Species.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Species.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/core/src/org/sbml/jsbml/Species.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -37,17 +37,17 @@ * @since 0.8 * @version $Rev$ */ -public class Species extends Symbol { +public class Species extends Symbol implements CompartmentalizedSBase { /** - * Generated serial version identifier. + * A {@link Logger} for this class. */ - private static final long serialVersionUID = 4427015656530890393L; + private static final Logger logger = Logger.getLogger(Species.class); /** - * A {@link Logger} for this class. + * Generated serial version identifier. */ - private static final Logger logger = Logger.getLogger(Species.class); + private static final long serialVersionUID = 4427015656530890393L; /** * True means initial amount is set. False means that an initial @@ -103,7 +103,7 @@ private String speciesTypeID; /** - * Creates a Species instance. By default, the charge, compartmentID, + * Creates a Species instance. By default, the charge, {@link #compartmentID}, * speciesTypeID, conversionFactorID, hasOnlySubstanceUnits, * boundaryCondition are {@code null}. */ @@ -114,7 +114,7 @@ /** * Creates a Species instance from a level and version. By default, the - * charge, compartmentID, speciesTypeID, conversionFactorID, + * charge, {@link #compartmentID}, speciesTypeID, conversionFactorID, * hasOnlySubstanceUnits, boundaryCondition are {@code null}. * * @param level @@ -180,7 +180,7 @@ /** * Creates a Species instance from a level and verison. By default, the - * charge, compartmentID, speciesTypeID, conversionFactorID, + * charge, {@link #compartmentID}, speciesTypeID, conversionFactorID, * hasOnlySubstanceUnits, boundaryCondition are {@code null}. * * @param id @@ -287,25 +287,26 @@ return isSetCharge() ? charge : 0; } - /** - * - * @return the compartmentID of this Species. The empty String if it is not - * set. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartment() */ + @Override public String getCompartment() { return isSetCompartment() ? compartmentID : ""; } - /** - * - * @return The Compartment instance which as the compartmentID of this - * Species as id. Null if it doesn't exist. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartmentInstance() */ + @Override public Compartment getCompartmentInstance() { - if (getModel() == null) { - return null; + if (isSetCompartment()) { + Model model = getModel(); + if (model != null) { + return model.getCompartment(compartmentID); + } } - return getModel().getCompartment(compartmentID); + return null; } /** @@ -622,6 +623,14 @@ return isSetBoundaryCondition() ? boundaryCondition : false; } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isCompartmentMandatory() + */ + @Override + public boolean isCompartmentMandatory() { + return true; + } + /** * * @return the value of the hasOnlySubstanceUnits Boolean if it is set, @@ -648,24 +657,20 @@ return isSetCharge; } - /** - * - * @return {@code true} if the compartmentID of this Species is not {@code null}. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartment() */ + @Override public boolean isSetCompartment() { return compartmentID != null; } - /** - * - * @return {@code true} if the Compartment instance which has the compartmentID of - * this Species as id is not {@code null}. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartmentInstance() */ + @Override public boolean isSetCompartmentInstance() { - if (getModel() == null) { - return false; - } - return getModel().getCompartment(compartmentID) != null; + return getCompartmentInstance() != null; } /** @@ -894,26 +899,22 @@ firePropertyChange(TreeNodeChangeEvent.charge, oldCharge, this.charge); } - /** - * Sets the {@link #compartmentID} of this {@link Species} to the id of - * 'compartment'. - * - * @param compartment + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(org.sbml.jsbml.Compartment) */ - public void setCompartment(Compartment compartment) { + @Override + public boolean setCompartment(Compartment compartment) { if (compartment != null) { - setCompartment(compartment.getId()); - } else { - unsetCompartment(); + return setCompartment(compartment.getId()); } + return unsetCompartment(); } - /** - * Sets the {@link #compartmentID} of this {@link Species} to 'compartment'. - * - * @param compartment + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(java.lang.String) */ - public void setCompartment(String compartment) { + @Override + public boolean setCompartment(String compartment) { if ((compartment != null) && (compartment.trim().length() == 0)) { compartment = null; // If we pass the empty String or null, the value is reset. @@ -928,7 +929,9 @@ } firePropertyChange(TreeNodeChangeEvent.compartment, oldCompartment, compartmentID); + return true; } + return false; } /** @@ -1172,11 +1175,12 @@ firePropertyChange(TreeNodeChangeEvent.charge, oldCharge, charge); } - /** - * Remove the reference to a comparmtent. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#unsetCompartment() */ - public void unsetCompartment() { - setCompartment((String) null); + @Override + public boolean unsetCompartment() { + return setCompartment((String) null); } /** @@ -1227,14 +1231,14 @@ Map<String, String> attributes = super.writeXMLAttributes(); Locale en = Locale.ENGLISH; if (isSetCompartment()) { - attributes.put("compartment", getCompartment()); + attributes.put(TreeNodeChangeEvent.compartment, getCompartment()); } if (isSetInitialAmount()) { - attributes.put("initialAmount", + attributes.put(TreeNodeChangeEvent.initialAmount, StringTools.toString(en, getInitialAmount())); } if (isSetBoundaryCondition()) { - attributes.put("boundaryCondition", + attributes.put(TreeNodeChangeEvent.boundaryCondition, Boolean.toString(getBoundaryCondition())); } @@ -1244,19 +1248,19 @@ StringTools.toString(en, getInitialConcentration())); } if (isSetSubstanceUnits()) { - attributes.put("substanceUnits", getSubstanceUnits()); + attributes.put(TreeNodeChangeEvent.substanceUnits, getSubstanceUnits()); } if (isSetHasOnlySubstanceUnits()) { - attributes.put("hasOnlySubstanceUnits", + attributes.put(TreeNodeChangeEvent.hasOnlySubstanceUnits, Boolean.toString(getHasOnlySubstanceUnits())); } if (isSetConstant()) { - attributes.put("constant", Boolean.toString(getConstant())); + attributes.put(TreeNodeChangeEvent.constant, Boolean.toString(getConstant())); } } if (getLevel() < 3) { if (isSetCharge) { - attributes.put("charge", Integer.toString(getCharge())); + attributes.put(TreeNodeChangeEvent.charge, Integer.toString(getCharge())); } } if (getLevel() == 2) { Modified: trunk/core/test/org/sbml/jsbml/test/HashCodeTest.java =================================================================== --- trunk/core/test/org/sbml/jsbml/test/HashCodeTest.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/core/test/org/sbml/jsbml/test/HashCodeTest.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -55,7 +55,7 @@ Model model = doc1.createModel("test_model"); Compartment c = model.createCompartment("c1"); Species s = model.createSpecies("s1", c); - s.addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001")); + s.addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "http://identifiers.org/kegg.compound/C00001")); Rule r = model.createAlgebraicRule(); r.setMath(ASTNode.parseFormula("sin(3) + 1")); @@ -71,8 +71,8 @@ } assertTrue(doc1.hashCode() == doc2.hashCode()); assertTrue(model.hashCode() != doc2.hashCode()); - assertTrue(s.getCVTerm(0).equals(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001"))); - assertTrue(s.getCVTerm(0).hashCode() == (new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001")).hashCode()); + assertTrue(s.getCVTerm(0).equals(new CVTerm(CVTerm.Qualifier.BQB_IS, "http://identifiers.org/kegg.compound/C00001"))); + assertTrue(s.getCVTerm(0).hashCode() == (new CVTerm(CVTerm.Qualifier.BQB_IS, "http://identifiers.org/kegg.compound/C00001")).hashCode()); assertTrue(doc1.equals(doc2)); assertTrue(doc2.equals(doc1)); } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -66,27 +66,6 @@ /** * - */ - private String sbmlName; - - /** - * - * @param name - */ - private Type(String name) { - sbmlName = name; - } - - /* (non-Javadoc) - * @see java.lang.Enum#toString() - */ - @Override - public String toString() { - return sbmlName; - } - - /** - * * @param value * @return */ @@ -108,7 +87,28 @@ } + /** + * + */ + private String sbmlName; + /** + * + * @param name + */ + private Type(String name) { + sbmlName = name; + } + + /* (non-Javadoc) + * @see java.lang.Enum#toString() + */ + @Override + public String toString() { + return sbmlName; + } + + } /** @@ -251,19 +251,6 @@ /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 2383; - int result = super.hashCode(); - result = prime * result - + ((listOfFluxObjectives == null) ? 0 : listOfFluxObjectives.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -326,6 +313,13 @@ } /** + * @return + */ + public int getFluxObjectiveCount() { + return listOfFluxObjectives == null ? 0 : listOfFluxObjectives.size(); + } + + /** * Returns the listOfFluxObjectives * * @return the listOfFluxObjectives @@ -341,6 +335,16 @@ } /** + * + * @return + * @deprecated use {@link #getFluxObjectiveCount()} + */ + @Deprecated + public int getNumFluxObjectives() { + return getFluxObjectiveCount(); + } + + /** * Returns the type. * * @return the type @@ -349,6 +353,19 @@ return type; } + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 2383; + int result = super.hashCode(); + result = prime * result + + ((listOfFluxObjectives == null) ? 0 : listOfFluxObjectives.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } + /** * */ @@ -371,6 +388,15 @@ return (listOfFluxObjectives != null) && (listOfFluxObjectives.size() > 0); } + /** + * Returns whether type is set + * + * @return whether type is set + */ + public boolean isSetType() { + return type != null; + } + /* (non-Javadoc) * @see org.sbml.jsbml.element.SBase#readAttribute(String attributeName, String prefix, String value) */ @@ -394,6 +420,63 @@ } /** + * Removes an element from the listOfFluxObjectives. + * + * @param fluxObjective the element to be removed from the list + * @return {@code true} if the list contained the specified element + * @see java.util.List#remove(Object) + */ + public boolean removeFluxObjective(FluxObjective fluxObjective) { + if (isSetListOfFluxObjectives()) { + return getListOfFluxObjectives().remove(fluxObjective); + } + return false; + } + + + /** + * Removes an element from the listOfFluxObjectives at the given index. + * + * @param i the index where to remove the {@link FluxObjective} + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size) + */ + public void removeFluxObjective(int i) { + if (!isSetListOfFluxObjectives()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + getListOfFluxObjectives().remove(i); + } + + + /** + * Removes an element from the listOfFluxObjectives with the given id. + * + * @param id the id of the {@link FluxObjective} to remove. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size) + */ + public void removeFluxObjective(String id) { + getListOfFluxObjectives().removeFirst(new NameFilter(id)); + } + + /** + * This list houses the actual fluxes to partake in this objective function, + * which are encoded by {@link FluxObjective} + * + * Sets the given {@code ListOf<FluxObjective>}. If listOfFluxObjectives + * was defined before and contains some elements, they are all unset. + * + * @param listOfFluxObjectives + */ + public void setListOfFluxObjectives(ListOf<FluxObjective> listOfFluxObjectives) { + unsetListOfFluxObjectives(); + this.listOfFluxObjectives = listOfFluxObjectives; + registerChild(this.listOfFluxObjectives); + } + + + /** * The required type attribute contains a {@link Type} which represents the sense * of the optimality constraint and can take one of two values, minimize or maximize. * Sets the type from a {@link String}. @@ -425,71 +508,7 @@ } - /* (non-Javadoc) - * @see org.sbml.jsbml.element.SBase#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - - if (type != null) { - attributes.put(FBCConstants.shortLabel + ":type", getType().toString()); - } - if (isSetId()) { - attributes.remove("id"); - attributes.put(FBCConstants.shortLabel + ":id", getId()); - } - if (isSetName()) { - attributes.remove("name"); - attributes.put(FBCConstants.shortLabel + ":name", getName()); - } - - return attributes; - } - - /** - * Returns whether type is set - * - * @return whether type is set - */ - public boolean isSetType() { - return type != null; - } - - /** - * Unsets the variable type - * - * @return {@code true}, if type was set before, - * otherwise {@code false} - */ - public boolean unsetType() { - if (isSetType()) { - Type oldType = type; - type = null; - firePropertyChange(FBCConstants.type, oldType, type); - return true; - } - return false; - } - - - /** - * This list houses the actual fluxes to partake in this objective function, - * which are encoded by {@link FluxObjective} - * - * Sets the given {@code ListOf<FluxObjective>}. If listOfFluxObjectives - * was defined before and contains some elements, they are all unset. - * - * @param listOfFluxObjectives - */ - public void setListOfFluxObjectives(ListOf<FluxObjective> listOfFluxObjectives) { - unsetListOfFluxObjectives(); - this.listOfFluxObjectives = listOfFluxObjectives; - registerChild(this.listOfFluxObjectives); - } - - /** * Unsets the {@code listOfFluxObjectives}. * * <p>Returns {@code true}, if listOfFluxObjectives contain at least one element, @@ -508,44 +527,42 @@ return false; } - /** - * Removes an element from the listOfFluxObjectives. + * Unsets the variable type * - * @param fluxObjective the element to be removed from the list - * @return {@code true} if the list contained the specified element - * @see java.util.List#remove(Object) + * @return {@code true}, if type was set before, + * otherwise {@code false} */ - public boolean removeFluxObjective(FluxObjective fluxObjective) { - if (isSetListOfFluxObjectives()) { - return getListOfFluxObjectives().remove(fluxObjective); + public boolean unsetType() { + if (isSetType()) { + Type oldType = type; + type = null; + firePropertyChange(FBCConstants.type, oldType, type); + return true; } return false; } - /** - * Removes an element from the listOfFluxObjectives at the given index. - * - * @param i the index where to remove the {@link FluxObjective} - * @throws IndexOutOfBoundsException if the listOf is not set or - * if the index is out of bound (index < 0 || index > list.size) + /* (non-Javadoc) + * @see org.sbml.jsbml.element.SBase#writeXMLAttributes() */ - public void removeFluxObjective(int i) { - if (!isSetListOfFluxObjectives()) { - throw new IndexOutOfBoundsException(Integer.toString(i)); + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (type != null) { + attributes.put(FBCConstants.shortLabel + ":type", getType().toString()); } - getListOfFluxObjectives().remove(i); - } + if (isSetId()) { + attributes.remove("id"); + attributes.put(FBCConstants.shortLabel + ":id", getId()); + } + if (isSetName()) { + attributes.remove("name"); + attributes.put(FBCConstants.shortLabel + ":name", getName()); + } - /** - * Removes an element from the listOfFluxObjectives with the given id. - * - * @param id the id of the {@link FluxObjective} to remove. - * @throws IndexOutOfBoundsException if the listOf is not set or - * if the index is out of bound (index < 0 || index > list.size) - */ - public void removeFluxObjective(String id) { - getListOfFluxObjectives().removeFirst(new NameFilter(id)); + return attributes; } } Modified: trunk/extensions/layout/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-09-21 08:59:42 UTC (rev 2359) @@ -31,11 +31,12 @@ /* * Interfaces */ - - UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase"]; + CompartmentalizedSBase [label="<<interface>>\nCompartmentalized\nSBase", style="filled", fillcolor="#F0F8FF"]; + NamedSBase [label="<<interface>>\nNamedSBase", style="filled", fillcolor="#F0F8FF"]; + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase", style="filled", fillcolor="#F0F8FF"]; - /* + /* * Abstract data types */ AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; @@ -97,10 +98,10 @@ AbstractReferenceGlyph -> SpeciesGlyph [dir=back,arrowtail=empty]; AbstractReferenceGlyph -> SpeciesReferencesGlyph [dir=back,arrowtail=empty]; AbstractReferenceGlyph -> TextGlyph [dir=back,arrowtail=empty]; - GraphicalObject -> AbstractReferenceGlyph [dir=back,arrowtail=empty]; - LineSegment -> CubicBezier [dir=back,arrowtail=empty]; - CurveSegment -> LineSegment [dir=back,arrowtail=empty]; - SpeciesReferencesGlyph -> SpeciesReferenceRole [dir=back,arrowtail=empty]; + GraphicalObject -> AbstractReferenceGlyph [dir=back,arrowtail=empty]; + LineSegment -> CubicBezier [dir=back,arrowtail=empty]; + CurveSegment -> LineSegment [dir=back,arrowtail=empty]; + SpeciesReferencesGlyph -> SpeciesReferenceRole [dir=back,arrowtail=empty]; } @@ -108,20 +109,23 @@ * Inheritance graph * *********************/ - AbstractNamedSBase -> BoundingBox [dir=back,arrowtail=empty]; - AbstractNamedSBase -> Curve [dir=back,arrowtail=empty]; - AbstractSBase -> CurveSegment [dir=back,arrowtail=empty]; - AbstractNamedSBase -> Dimensions [dir=back,arrowtail=empty]; - AbstractNamedSBase -> GraphicalObject [dir=back,arrowtail=empty]; - AbstractNamedSBase -> Layout [dir=back,arrowtail=empty]; - AbstractNamedSBase -> Point [dir=back,arrowtail=empty]; - AbstractSBasePlugin -> LayoutModelPlugin [dir=back,arrowtail=empty]; - UniqueNamedSBase -> BoundingBox [dir=back,arrowtail=empty]; - UniqueNamedSBase -> Dimensions [dir=back,arrowtail=empty]; - UniqueNamedSBase -> GraphicalObject [dir=back,arrowtail=empty]; - UniqueNamedSBase -> Layout [dir=back,arrowtail=empty]; - UniqueNamedSBase -> Point [dir=back,arrowtail=empty]; - NameFilter -> NamedSBaseReferenceFilter [dir=back,arrowtail=empty]; - + AbstractNamedSBase -> BoundingBox [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Curve [dir=back,arrowtail=empty]; + AbstractSBase -> CurveSegment [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Dimensions [dir=back,arrowtail=empty]; + AbstractNamedSBase -> GraphicalObject [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Layout [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Point [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> LayoutModelPlugin [dir=back,arrowtail=empty]; + CompartmentalizedSBase -> CompartmentGlyph [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> AbstractNamedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> CompartmentalizedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> UniqueNamedSBase [dir=back,arrowtail=empty,style=dashed]; + UniqueNamedSBase -> BoundingBox [dir=back,arrowtail=empty,style=dashed]; + UniqueNamedSBase -> Dimensions [dir=back,arrowtail=empty,style=dashed]; + UniqueNamedSBase -> GraphicalObject [dir=back,arrowtail=empty,style=dashed]; + UniqueNamedSBase -> Layout [dir=back,arrowtail=empty,style=dashed]; + UniqueNamedSBase -> Point [dir=back,arrowtail=empty,style=dashed]; + NameFilter -> NamedSBaseReferenceFilter [dir=back,arrowtail=empty]; } Modified: trunk/extensions/layout/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -167,9 +167,10 @@ /** * @param sbase + * @return {@code true} if this operation caused any change. */ - public void setReference(String sbase) { - setReference(sbase, "reference"); + public boolean setReference(String sbase) { + return setReference(sbase, "reference"); } /** @@ -178,11 +179,16 @@ * * @param sbase * @param type + * @return {@code true} if this operation caused any change. */ - void setReference(String sbase, String type) { - String oldSBase = reference; - reference = sbase; - firePropertyChange(type, oldSBase, reference); + boolean setReference(String sbase, String type) { + if (sbase != reference) { + String oldSBase = reference; + reference = sbase; + firePropertyChange(type, oldSBase, reference); + return true; + } + return false; } /* (non-Javadoc) @@ -201,10 +207,10 @@ } /** - * + * @return {@code true} if this operation caused any change. */ - public void unsetReference() { - setReference((String) null); + public boolean unsetReference() { + return setReference((String) null); } } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -25,6 +25,7 @@ import java.util.Map; import org.sbml.jsbml.Compartment; +import org.sbml.jsbml.CompartmentalizedSBase; import org.sbml.jsbml.NamedSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -40,7 +41,7 @@ * @since 1.0 * @version $Rev$ */ -public class CompartmentGlyph extends AbstractReferenceGlyph { +public class CompartmentGlyph extends AbstractReferenceGlyph implements CompartmentalizedSBase { /** * Generated serial version identifier. @@ -102,20 +103,18 @@ return new CompartmentGlyph(this); } - /** - * - * @return + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartment() */ + @Override public String getCompartment() { return getReference(); } - /** - * Note that the return type of this method is {@link NamedSBase} because it - * could be possible to link some element from other packages to this glyph. - * - * @return + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartmentInstance() */ + @Override public NamedSBase getCompartmentInstance() { return getNamedSBaseInstance(); } @@ -134,13 +133,30 @@ throw new PropertyUndefinedError(LayoutConstants.order, this); } - /** - * @return + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isCompartmentMandatory() */ + @Override + public boolean isCompartmentMandatory() { + return false; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartment() + */ + @Override public boolean isSetCompartment() { return isSetReference(); } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartmentInstance() + */ + @Override + public boolean isSetCompartmentInstance() { + return getCompartmentInstance() != null; + } + /** * Returns whether order is set * @@ -180,27 +196,20 @@ return isAttributeRead; } - /** - * The compartment attribute is used to add a reference to the id of - * the corresponding {@link Compartment} in the {@link org.sbml.jsbml.Model}. Since - * the compartment is optional, the user can specify {@link Compartment}s - * in the {@link Layout} that are not part of the {@link org.sbml.jsbml.Model}. - * - * This attribute is optional. - * - * @param compartment + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(org.sbml.jsbml.Compartment) */ - public void setCompartment(Compartment compartment) { - setCompartment(compartment.getId()); + @Override + public boolean setCompartment(Compartment compartment) { + return setCompartment(compartment.getId()); } - /** - * See annotation for setCompartment(Compartment) - * - * @param compartment + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(java.lang.String) */ - public void setCompartment(String compartment) { - setReference(compartment, TreeNodeChangeEvent.compartment); + @Override + public boolean setCompartment(String compartment) { + return setReference(compartment, TreeNodeChangeEvent.compartment); } /** @@ -223,11 +232,12 @@ firePropertyChange(LayoutConstants.order, oldOrder, this.order); } - /** - * + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#unsetCompartment() */ - public void unsetCompartment() { - unsetReference(); + @Override + public boolean unsetCompartment() { + return unsetReference(); } /** Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -338,16 +338,15 @@ firePropertyChange(LayoutConstants.speciesGlyph, oldValue, this.glyph); } - /** - * The reference is an optional attribute that is used to connect the {@link ReferenceGlyph} - * with an element of the containing {@link Model}. + * The reference is an optional attribute that is used to connect the + * {@link ReferenceGlyph} with an element of the containing {@link Model}. * * @param reference */ @Override - public void setReference(String reference) { - setReference(reference, LayoutConstants.reference); + public boolean setReference(String reference) { + return setReference(reference, LayoutConstants.reference); } /** Modified: trunk/extensions/multi/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/multi/doc/img/type_hierarchy.dot 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/multi/doc/img/type_hierarchy.dot 2015-09-21 08:59:42 UTC (rev 2359) @@ -23,6 +23,22 @@ fontsize=10, shape=box ]; + + /* + * Interfaces + */ + CompartmentalizedSBase [label="<<interface>>\nCompartmentalized\nSBase", style="filled", fillcolor="#F0F8FF"]; + NamedSBase [label="<<interface>>\nNamedSBase", style="filled", fillcolor="#F0F8FF"]; + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase", style="filled", fillcolor="#F0F8FF"]; + + + /********************* + * Inheritance graph * + *********************/ + NamedSBase -> AbstractNamedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> CompartmentalizedSBase [dir=back,arrowtail=empty,style=dashed]; + NamedSBase -> UniqueNamedSBase [dir=back,arrowtail=empty,style=dashed]; + } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -19,22 +19,38 @@ * and also available online as <http://sbml.org/Software/JSBML/License>. * ---------------------------------------------------------------------------- */ - package org.sbml.jsbml.ext.multi; import java.util.Map; import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.Compartment; +import org.sbml.jsbml.CompartmentalizedSBase; import org.sbml.jsbml.LevelVersionError; +import org.sbml.jsbml.Model; +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.0 + * @date 21.09.2015 + */ +public class CompartmentReference extends AbstractNamedSBase implements CompartmentalizedSBase { -public class CompartmentReference extends AbstractNamedSBase { + /** + * Generated serial version identifier + */ + private static final long serialVersionUID = 6455311889725292763L; - private String compartment; - /** - * Creates an CompartmentReference instance + * */ + private String compartment; + + /** + * Creates an CompartmentReference instance + */ public CompartmentReference() { super(); initDefaults(); @@ -42,13 +58,16 @@ /** - * Creates a CompartmentReference instance with an id. - * - * @param id the identifier for the new element. + * Clone constructor + * @param obj */ - public CompartmentReference(String id) { - super(id); - initDefaults(); + public CompartmentReference(CompartmentReference obj) { + super(obj); + + // compartment + if (obj.isSetCompartment()) { + setCompartment(obj.getCompartment()); + } } @@ -64,6 +83,17 @@ /** + * Creates a CompartmentReference instance with an id. + * + * @param id the identifier for the new element. + */ + public CompartmentReference(String id) { + super(id); + initDefaults(); + } + + + /** * Creates a CompartmentReference instance with an id, level, and version. * * @param id the identifier for this element. @@ -93,96 +123,137 @@ initDefaults(); } + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractSBase#clone() + */ + @Override + public CompartmentReference clone() { + return new CompartmentReference(this); + } - /** - * Clone constructor + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartment() */ - public CompartmentReference(CompartmentReference obj) { - super(obj); - - // compartment - if (obj.isSetCompartment()) { - setCompartment(obj.getCompartment()); + @Override + public String getCompartment() { + if (isSetCompartment()) { + return compartment; } + + return null; } - - /** - * clones this class + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartmentInstance() */ - public CompartmentReference clone() { - return new CompartmentReference(this); + @Override + public Compartment getCompartmentInstance() { + if (isSetCompartment()) { + Model model = getModel(); + if (model != null) { + return model.getCompartment(getCompartment()); + } + } + return null; } - /** * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + // TODO - removed once the mechanism are in place to set package version and namespace + setNamespace(MultiConstants.namespaceURI); packageName = MultiConstants.shortLabel; setPackageVersion(-1); } - + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isCompartmentMandatory() + */ @Override - public boolean isIdMandatory() { - return false; + public boolean isCompartmentMandatory() { + return true; } - - /** - * Returns the value of {@link #compartment}. - * - * @return the value of {@link #compartment}. + /* (non-Javadoc) + * @see org.sbml.jsbml.NamedSBase#isIdMandatory() */ - public String getCompartment() { - if (isSetCompartment()) { - return compartment; - } - - return null; + @Override + public boolean isIdMandatory() { + return false; } - /** * Returns whether {@link #compartment} is set. * * @return whether {@link #compartment} is set. */ + @Override public boolean isSetCompartment() { return compartment != null; } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#isSetCompartmentInstance() + */ + @Override + public boolean isSetCompartmentInstance() { + return getCompartmentInstance() != null; + } - /** - * Sets the value of compartment - * - * @param compartment the value of compartment to be set. + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) */ - public void setCompartment(String compartment) { - String oldCompartment = this.compartment; - this.compartment = compartment; - firePropertyChange(MultiConstants.compartment, oldCompartment, this.compartment); + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + + if (!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(MultiConstants.compartment)) { + setCompartment(value); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(org.sbml.jsbml.Compartment) + */ + @Override + public boolean setCompartment(Compartment compartment) { + return setCompartment(compartment.getId()); + } - /** - * Unsets the variable compartment. - * - * @return {@code true} if compartment was set before, otherwise {@code false}. + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#setCompartment(java.lang.String) */ - public boolean unsetCompartment() { - if (isSetCompartment()) { + @Override + public boolean setCompartment(String compartment) { + if (compartment != this.compartment) { String oldCompartment = this.compartment; - this.compartment = null; + this.compartment = compartment; firePropertyChange(MultiConstants.compartment, oldCompartment, this.compartment); return true; } return false; } + /* (non-Javadoc) + * @see org.sbml.jsbml.CompartmentalizedSBase#unsetCompartment() + */ + @Override + public boolean unsetCompartment() { + return setCompartment((String) null); + } + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() + */ @Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); @@ -202,22 +273,4 @@ return attributes; } - - @Override - public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); - - if (!isAttributeRead) { - isAttributeRead = true; - - if (attributeName.equals(MultiConstants.compartment)) { - setCompartment(value); - } - else { - isAttributeRead = false; - } - } - return isAttributeRead; - } - } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java 2015-09-11 10:09:45 UTC (rev 2358) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java 2015-09-21 08:59:42 UTC (rev 2359) @@ -26,8 +26,11 @@ import javax.swing.tree.TreeNode; +import org.sbml.jsbml.Compartment; +import org.sbml.jsbml.CompartmentalizedSBase; import org.sbml.jsbml.LevelVersionError; import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.Model; import org.sbml.jsbml.UniqueNamedSBase; /** @@ -71,7 +74,7 @@ * */ @SuppressWarnings("deprecation") -public class SpeciesType extends org.sbml.jsbml.SpeciesType implements UniqueNamedSBase { +public class SpeciesType extends org.sbml.jsbml.SpeciesType implements CompartmentalizedSBase, UniqueNamedSBase { /** * Generated serial version identifier. @@ -84,17 +87,17 @@ * */ private String compartment; - + /** * */ - private ListOf<SpeciesFeatureType> listOfSpeciesFeatureTypes; + private ListOf<InSpeciesTypeBond> listOfInSpeciesTypeBonds; /** * */ - private ListOf<SpeciesTypeInstance> listOfSpeciesTypeInstances; - + private ListOf<SpeciesFeatureType> listOfSpeciesFeatureTypes; + /** * */ @@ -103,10 +106,10 @@ /** * */ - private ListOf<InSpeciesTypeBond> listOfInSpeciesTypeBonds; - + private ListOf<SpeciesTypeInstance> listOfSpeciesTypeInstances; + /** - * Creates an SpeciesType instance + * Creates an SpeciesType instance */ public SpeciesType() { super(); @@ -115,24 +118,51 @@ /** - * Creates a SpeciesType instance with an id. + * Creates a SpeciesType instance with a level and version. * - * @param id the identifier for the new element. + * @param level SBML Level + * @param version SBML Version */ - public SpeciesType(String id) { - super(id); - initDefaults(); + public SpeciesType(int level, int version) { + this(null, null, level, version); } /** - * Creates a SpeciesType instance with a level and version. + * Clone constructor + * @param obj + */ + public SpeciesType(SpeciesType obj) { + super(obj); + + // copy all class attributes + if (obj.isSetListOfSpeciesFeatureTypes()) { + setListOfSpeciesFeatureTypes(obj.getListOfSpeciesFeatureTypes().clone()); + } + if (obj.isSetListOfSpeciesTypeInstances()) { + setListOfSpeciesTypeInstances(obj.getListOfSpeciesTypeInstances().clone()); + } + if (obj.isSetListOfSpeciesTypeComponentIndexes()) { + setListOfSpeciesTypeComponentIndexes(obj.getListOfSpeciesTypeComponentIndexes().clone()); + } + if (obj.isSetListOfInSpeciesTypeBonds()) { + setListOfInSpeciesTypeBonds(obj.getListOfInSpeciesTypeBonds().clone()); + } + if (obj.isSetCompartment()) { + setCompartment(obj.getCompartment()); + } + + } + + + ... [truncated message content] |
From: <and...@us...> - 2015-09-11 10:09:47
|
Revision: 2358 http://sourceforge.net/p/jsbml/code/2358 Author: andreas-draeger Date: 2015-09-11 10:09:45 +0000 (Fri, 11 Sep 2015) Log Message: ----------- * Added more information to an error message in Model. * Added a variable for the SBasePlugin in AbstractSBase to avoid duplicate lookups in Hash. * Removed unnecessary UTF-8 character from FBCModelPlugin. * Removed enum GroupKind in the groups extension and created it as internal enum Group.Kind (to be consistent to other enums, e.g., Unit.Kind). * Changed the create method in GroupsModelPlugin for mutual method reuse. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/Model.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java Removed Paths: ------------- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupKind.java Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -792,7 +792,6 @@ return getHistory(); } - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#createPlugin(java.lang.String) */ @@ -1371,9 +1370,9 @@ PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); if (packageParser != null) { - - if (extensions.get(packageParser.getPackageName()) != null) { - return extensions.get(packageParser.getPackageName()); + SBasePlugin plugin = extensions.get(packageParser.getPackageName()); + if (plugin != null) { + return plugin; } else { return createPlugin(nameOrUri); } @@ -1515,17 +1514,26 @@ return false; } + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#isPackageURIEnabled(java.lang.String) + */ @Override public boolean isPackageURIEnabled(String packageURIOrName) { return isPackageEnabled(packageURIOrName); } + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#isPkgEnabled(java.lang.String) + */ @Override @Deprecated public boolean isPkgEnabled(String packageURIOrName) { return isPackageEnabled(packageURIOrName); } + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#isPkgURIEnabled(java.lang.String) + */ @Override @Deprecated public boolean isPkgURIEnabled(String packageURIOrName) { Modified: trunk/core/src/org/sbml/jsbml/Model.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Model.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/core/src/org/sbml/jsbml/Model.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -3951,8 +3951,8 @@ elem = mapOfUnitDefinitions.get(id); } logger.error(MessageFormat.format( - "An element of type {2} with the id \"{0}\" is already present in this model{1}. The new element will not be added to the model.", - id, (isSetId() ? " \"" + getId() + "\"" : ""), elem != null ? elem.getElementName() : "'unknown'")); + "An element of type {2} with the id \"{0}\" is already present in this model{1}. The new element of type {3} will not be added to the model.", + id, (isSetId() ? " \"" + getId() + "\"" : ""), elem != null ? elem.getElementName() : "'unknown'", unsb.getElementName())); return false; } mapOfUniqueNamedSBases.put(id, unsb); Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -73,7 +73,7 @@ * The mandatory attribute strict is used to apply an additional set of * restrictions to the model. * The strict attribute ensures that the Flux Balance Constraints package can - * be used to encode legacy FBA models expressible as Linear Programs (LP’s) + * be used to encode legacy FBA models expressible as Linear Programs (LP's) * with software that is unable to analyze arbitrary mathematical expressions. */ private Boolean strict; Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -42,6 +42,29 @@ public class Group extends AbstractNamedSBase implements UniqueNamedSBase { /** + * This is a collection of possible values for the {@code kind} attribute within + * a {@link Group}. It has been defined in version 3 of the Groups proposal. + * + * @author Clemens Wrzodek + * @since 3.0 + * @version $Rev$ + */ + public enum Kind { + /** + * the group is a class, and its members have an <i>is-a</i> relationship to the group + */ + classification, + /** + * the group is a collection of parts, and its members have a <i>part-of</i> relationship to the group + */ + partonomy, + /** + * the grouping is one of convenience, without an implied relationship + */ + collection + } + + /** * Generated serial version identifier. */ private static final long serialVersionUID = 2361503116934849753L; @@ -49,7 +72,7 @@ /** * Defined in version 3 of the groups proposal. */ - private GroupKind kind = null; + private Kind kind = null; /** * @@ -225,7 +248,7 @@ * * @return */ - public GroupKind getKind() { + public Kind getKind() { return kind; } @@ -244,14 +267,14 @@ listOfMembers.setPackageName(null); listOfMembers.setPackageName(GroupsConstants.shortLabel); listOfMembers.setSBaseListType(ListOf.Type.other); - + registerChild(listOfMembers); } return listOfMembers; } - + /** * Returns {@code true} if {@link #listOfMembers} is not null. * @@ -272,7 +295,7 @@ public void setListOfMembers(ListOf<Member> listOfMembers) { unsetListOfMembers(); this.listOfMembers = listOfMembers; - + if (listOfMembers != null) { listOfMembers.unsetNamespace(); listOfMembers.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace @@ -282,7 +305,7 @@ listOfMembers.setPackageName(GroupsConstants.shortLabel); listOfMembers.setSBaseListType(ListOf.Type.other); - registerChild(this.listOfMembers); + registerChild(this.listOfMembers); } } @@ -296,8 +319,8 @@ */ public boolean unsetListOfMembers() { if (isSetListOfMembers()) { - ListOf<Member> oldMembers = this.listOfMembers; - this.listOfMembers = null; + ListOf<Member> oldMembers = listOfMembers; + listOfMembers = null; oldMembers.fireNodeRemovedEvent(); return true; } @@ -423,7 +446,7 @@ return null; } - + /** * Returns the number of {@link Member}s of this {@link Group}. * @@ -526,7 +549,7 @@ public void setListOfMemberConstraints(ListOfMemberConstraint listOfMemberConstraints) { unsetListOfMemberConstraints(); this.listOfMemberConstraints = listOfMemberConstraints; - + if (listOfMemberConstraints != null) { listOfMemberConstraints.unsetNamespace(); listOfMemberConstraints.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace @@ -534,8 +557,8 @@ // changing the ListOf package name from 'core' to 'groups' listOfMemberConstraints.setPackageName(null); listOfMemberConstraints.setPackageName(GroupsConstants.shortLabel); - listOfMemberConstraints.setSBaseListType(ListOf.Type.other); - + listOfMemberConstraints.setSBaseListType(ListOf.Type.other); + registerChild(this.listOfMemberConstraints); } } @@ -633,7 +656,7 @@ if (!isAttributeRead && attributeName.equals("kind")) { try { - setKind(GroupKind.valueOf(value)); + setKind(Kind.valueOf(value)); isAttributeRead = true; } catch (Exception e) { throw new SBMLException("Could not recognized the value '" + value @@ -648,7 +671,7 @@ * * @param kind */ - public void setKind(GroupKind kind) { + public void setKind(Kind kind) { this.kind = kind; } Deleted: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupKind.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupKind.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupKind.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -1,45 +0,0 @@ -/* - * $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. - * - * Copyright (C) 2009-2015 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 - * - * 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.ext.groups; - -/** - * This is a collection of possible values for the {@code kind} attribute within - * a {@link Group}. It has been defined in version 3 of the Groups proposal. - * - * @author Clemens Wrzodek - * @since 3.0 - * @version $Rev$ - */ -public enum GroupKind { - /** - * the group is a class, and its members have an <i>is-a</i> relationship to the group - */ - classification, - /** - * the group is a collection of parts, and its members have a <i>part-of</i> relationship to the group - */ - partonomy, - /** - * the grouping is one of convenience, without an implied relationship - */ - collection -} Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -41,105 +41,139 @@ public class GroupsModelPlugin extends AbstractSBasePlugin { - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + /** + * Generated serial version identifier. */ - @Override - public String getPackageName() { - return GroupsConstants.shortLabel; - } + private static final long serialVersionUID = 3334444867660252255L; - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + /** + * */ - @Override - public String getPrefix() { - return GroupsConstants.shortLabel; - } + protected ListOf<Group> listOfGroups; - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + /** + * Creates a new {@link GroupsModelPlugin} instance cloned from the given parameter. + * + * @param groupModelPlugin */ - @Override - public String getURI() { - return getElementNamespace(); + public GroupsModelPlugin(GroupsModelPlugin groupModelPlugin) { + super(groupModelPlugin); + // We don't clone the pointer to the containing model. + if (groupModelPlugin.listOfGroups != null) { + setListOfGroups(groupModelPlugin.getListOfGroups().clone()); + } } - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() + /** + * Creates a new {@link GroupsModelPlugin} instance + * + * @param model */ - @Override - public SBMLDocument getParent() { - if (isSetExtendedSBase()) { - return (SBMLDocument) getExtendedSBase().getParent(); - } - - return null; + public GroupsModelPlugin(Model model) { + super(model); + initDefaults(); } + /** + * Adds a new element to the listOfGroups. + * <p>listOfGroups is initialized if necessary. + * + * @param group + * @return {@code true} (as specified by {@link Collection#add}) + */ + public boolean addGroup(Group group) { + return getListOfGroups().add(group); + } /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#clone() */ @Override - public SBMLDocument getParentSBMLObject() { - return getParent(); + public GroupsModelPlugin clone() { + return new GroupsModelPlugin(this); } /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 3334444867660252255L; - /** + * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. * + * @return the new {@link Group} instance. */ - protected ListOf<Group> listOfGroups; + public Group createGroup() { + return createGroup(null); + } /** - * Creates a new {@link GroupsModelPlugin} instance + * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. * - * @param model + * @param id the id to be set to the new {@link Group}. + * @return the new {@link Group} instance. */ - public GroupsModelPlugin(Model model) { - super(model); - initDefaults(); + public Group createGroup(String id) { + Group g = new Group(getLevel(), getVersion()); + if (id != null) { + g.setId(id); + } + addGroup(g); + return g; } /** - * Creates a new {@link GroupsModelPlugin} instance cloned from the given parameter. + * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. + * For each id in the memberIds array, a new {@link Member} instance is created and added to the {@link Group} + * as well. * - * @param groupModelPlugin + * @param id the id to be set to the new {@link Group}. + * @param memberIds the ids to be set to the new {@link Member} instances. + * @return the new {@link Group} instance. */ - public GroupsModelPlugin(GroupsModelPlugin groupModelPlugin) { - super(groupModelPlugin); - // We don't clone the pointer to the containing model. - if (groupModelPlugin.listOfGroups != null) { - setListOfGroups(groupModelPlugin.getListOfGroups().clone()); + public Group createGroup(String id, String... memberIds) { + Group g = createGroup(id); + + if (memberIds != null) { + for (String memberId: memberIds) { + g.createMember(memberId); + } } + + return g; } - /** - * + /* (non-Javadoc) + * @see javax.swing.tree.TreeNode#getAllowsChildren() */ - private void initDefaults() { - setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace - setPackageVersion(-1); + @Override + public boolean getAllowsChildren() { + return true; } - /** - * Adds a new element to the listOfGroups. - * <p>listOfGroups is initialized if necessary. - * - * @param group - * @return {@code true} (as specified by {@link Collection#add}) + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getChildAt(int) */ - public boolean addGroup(Group group) { - return getListOfGroups().add(group); + @Override + public SBase getChildAt(int childIndex) { + if (childIndex < 0 || childIndex >= 1) { + throw new IndexOutOfBoundsException(MessageFormat.format( + resourceBundle.getString("IndexExceedsBoundsException"), childIndex, + +Math.min(getChildCount(), 0))); + } + + return listOfGroups; } + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getChildCount() + */ + @Override + public int getChildCount() { + if (isSetListOfGroups()) { + return 1; + } + return 0; + } + /** * Returns the n-th {@link Group} object in this {@link GroupsModelPlugin}. * @@ -156,6 +190,29 @@ } /** + * Gets the {@link Group} that has the given id. + * + * @param sbmlID + * @return the {@link Group} that has the given id or {@code null} if no + * {@link Group} is found that matches {@code sbmlID}. + */ + public SBase getGroup(String sbmlID) { + if (isSetListOfGroups()) { + return listOfGroups.firstHit(new NameFilter(sbmlID)); + } + return null; + } + + /** + * Returns the number of {@link Group}s of this {@link GroupsModelPlugin}. + * + * @return the number of {@link Group}s of this {@link GroupsModelPlugin}. + */ + public int getGroupCount() { + return isSetListOfGroups() ? listOfGroups.size() : 0; + } + + /** * Returns the listOfGroups. If the {@link ListOf} is not defined, creates an empty one. * * @return the listOfGroups @@ -183,19 +240,62 @@ * Returns the number of {@link Group}s of this {@link GroupsModelPlugin}. * * @return the number of {@link Group}s of this {@link GroupsModelPlugin}. + * @libsbml.deprecated same as {@link #getGroupCount()} */ - public int getGroupCount() { - return isSetListOfGroups() ? listOfGroups.size() : 0; + public int getNumGroups() { + return getGroupCount(); } + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + */ + @Override + public String getPackageName() { + return GroupsConstants.shortLabel; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#getParent() + */ + @Override + public SBMLDocument getParent() { + if (isSetExtendedSBase()) { + return (SBMLDocument) getExtendedSBase().getParent(); + } + + return null; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() + */ + @Override + public SBMLDocument getParentSBMLObject() { + return getParent(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + */ + @Override + public String getPrefix() { + return GroupsConstants.shortLabel; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + */ + @Override + public String getURI() { + return getElementNamespace(); + } + /** - * Returns the number of {@link Group}s of this {@link GroupsModelPlugin}. * - * @return the number of {@link Group}s of this {@link GroupsModelPlugin}. - * @libsbml.deprecated same as {@link #getGroupCount()} */ - public int getNumGroups() { - return getGroupCount(); + private void initDefaults() { + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); } /** @@ -206,6 +306,15 @@ return listOfGroups != null; } + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#readAttribute(java.lang.String, java.lang.String, java.lang.String) + */ + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + // No attribute define on this plugin + return false; + } + /** * * @param listOfGroups @@ -229,6 +338,14 @@ } } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "GroupModelPlugin [nb Group = " + getGroupCount() + "]"; + } + /** * Removes the {@link #listOfGroups} from this {@link Model} and notifies * all registered instances of {@link org.sbml.jsbml.util.TreeNodeChangeListener}. @@ -247,31 +364,6 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#clone() - */ - @Override - public GroupsModelPlugin clone() { - return new GroupsModelPlugin(this); - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "GroupModelPlugin [nb Group = " + getGroupCount() + "]"; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, String value) { - // No attribute define on this plugin - return false; - } - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#writeXMLAttributes() */ @Override @@ -280,97 +372,4 @@ return null; } - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getChildAt(int) - */ - @Override - public SBase getChildAt(int childIndex) { - if (childIndex < 0 || childIndex >= 1) { - throw new IndexOutOfBoundsException(MessageFormat.format( - resourceBundle.getString("IndexExceedsBoundsException"), childIndex, - +Math.min(getChildCount(), 0))); - } - - return listOfGroups; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getChildCount() - */ - @Override - public int getChildCount() { - if (isSetListOfGroups()) { - return 1; - } - return 0; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getAllowsChildren() - */ - @Override - public boolean getAllowsChildren() { - return true; - } - - /** - * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. - * - * @return the new {@link Group} instance. - */ - public Group createGroup() { - Group g = new Group(); - addGroup(g); - return g; - } - - /** - * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. - * - * @param id the id to be set to the new {@link Group}. - * @return the new {@link Group} instance. - */ - public Group createGroup(String id) { - Group g = new Group(); - g.setId(id); - addGroup(g); - return g; - } - - /** - * Creates a new instance of {@link Group} and add it to this {@link GroupsModelPlugin}. - * For each id in the memberIds array, a new {@link Member} instance is created and added to the {@link Group} - * as well. - * - * - * @param id the id to be set to the new {@link Group}. - * @param memberIds the ids to be set to the new {@link Member} instances. - * @return the new {@link Group} instance. - */ - public Group createGroup(String id, String... memberIds) { - Group g = createGroup(id); - - if (memberIds != null) { - for (String memberId: memberIds) { - g.createMember(memberId); - } - } - - return g; - } - - /** - * Gets the {@link Group} that has the given id. - * - * @param sbmlID - * @return the {@link Group} that has the given id or {@code null} if no - * {@link Group} is found that matches {@code sbmlID}. - */ - public SBase getGroup(String sbmlID) { - if (isSetListOfGroups()) { - return listOfGroups.firstHit(new NameFilter(sbmlID)); - } - return null; - } - } Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java 2015-08-31 09:09:43 UTC (rev 2357) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java 2015-09-11 10:09:45 UTC (rev 2358) @@ -319,7 +319,19 @@ */ @Override public String toString() { - return "Member [idRef=" + idRef + " metaIdRef=" + metaIdRef + "]"; + StringBuilder builder = new StringBuilder(); + builder.append("Member [idRef="); + builder.append(idRef); + builder.append(", metaIdRef="); + builder.append(metaIdRef); + builder.append(", id="); + builder.append(getId()); + builder.append(", name="); + builder.append(getName()); + builder.append(", sboTerm="); + builder.append(getSBOTerm()); + builder.append("]"); + return builder.toString(); } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-08-31 09:09:45
|
Revision: 2357 http://sourceforge.net/p/jsbml/code/2357 Author: andreas-draeger Date: 2015-08-31 09:09:43 +0000 (Mon, 31 Aug 2015) Log Message: ----------- * Implemented new regex-based check for chemical formulas in the FBC package. * Corrected quotation marks in Messages.xml * Small changes for the Users' Guide code listing * Corrected indentation etc. in some other files. Modified Paths: -------------- trunk/core/doc/user_guide/src/org/sbml/jsbml/gui/JSBMLvisualizer.java trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java Modified: trunk/core/doc/user_guide/src/org/sbml/jsbml/gui/JSBMLvisualizer.java =================================================================== --- trunk/core/doc/user_guide/src/org/sbml/jsbml/gui/JSBMLvisualizer.java 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/core/doc/user_guide/src/org/sbml/jsbml/gui/JSBMLvisualizer.java 2015-08-31 09:09:43 UTC (rev 2357) @@ -41,7 +41,7 @@ /** * @param tree - * The sbml root node of an SBML file + * The SBML root node of an SBML file */ public JSBMLvisualizer(SBase tree) { super("SBML Structure Visualization"); @@ -57,7 +57,7 @@ * Main. Note: this doesn't perform error checking, but should. It is an * illustration only. * - * @param args + * @param args path to an SBML file. * @throws Exception */ public static void main(String[] args) throws Exception { Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml 2015-08-31 09:09:43 UTC (rev 2357) @@ -35,7 +35,7 @@ <entry key="SBMLCoreParser.instanciationError">The element ''{0}'' could not be instanciated as a Java object!</entry> <entry key="SBMLCoreParser.namespaceIgnored">Namespace ignored on ''{0}''! {1} = {2}</entry> <entry key="SBMLCoreParser.reactionWithoutParticipantsError">The reaction ''{0}'' does not contain any reactants or products.</entry> - <entry key="SBMLCoreParser.unknownAttributeOnElement">Could not recognize the attribute \"{0}\" on the element {1}. Please check the specification for SBML.</entry> + <entry key="SBMLCoreParser.unknownAttributeOnElement">Could not recognize the attribute ''{0}'' on the element {1}. Please check the specification for SBML.</entry> <entry key="SBMLCoreParser.unknownElement">The element ''{0}'' is not recognized.</entry> <entry key="SBMLCoreParser.unknownReferenceError1">No {0} matches the {1} ''{2}'' of {3} ''{4}''.</entry> <entry key="SBMLCoreParser.unknownReferenceError2">No {0} matches the {1} ''{2}'' of an {2}.</entry> Modified: trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java 2015-08-31 09:09:43 UTC (rev 2357) @@ -11,7 +11,7 @@ * 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 + * 5. The Babraham Institute, Cambridge, UK * * 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 @@ -37,14 +37,14 @@ * "(8639_AT1) || (26_AT1) || (314_AT2) || (314_AT1)". * <p> * Support almost the same syntax as defined in <a href="http://sbml.org/Software/libSBML/docs/java-api/org/sbml/libsbml/libsbml.html#parseL3Formula(java.lang.String)"> - * the LibSBML L3 parser</a>. + * the LibSBML L3 parser</a>. * <p>One of the main differences is that ID are allowed to start by a number so that ID like that '8639_AT1' are recognised as ID. - * + * * <p>The things not supported for now are the units associated with numbers. * * <p> * Parsing of the various MathML functions and constants are all - * case-sensitive by default: names such as + * case-sensitive by default: names such as * <code>Cos</code> and <code>COS</code> are not parsed as the MathML cosine * operator, <code><cos></code>. * @@ -81,8 +81,8 @@ <p> - * In the table above, <em>operand</em> implies the construct is an operand, - * <em>prefix</em> implies the operation is applied to the following arguments, + * In the table above, <em>operand</em> implies the construct is an operand, + * <em>prefix</em> implies the operation is applied to the following arguments, * <em>unary</em> implies there is one argument, and <em>binary</em> implies there are * two arguments. The values in the <b>Precedence</b> column show how the * order of different types of operation are determined. For example, the @@ -106,7 +106,7 @@ * functions added in SBML Level 2 and Level 3: <p> - * <table border="0" width="95%" + * <table border="0" width="95%" class="centered text-table normal-font alt-row-colors"> <tr> <th align="left" width="60">Name</th> @@ -115,8 +115,8 @@ <th align="left" width="90">Argument Constraints</th> <th align="left" width="90">Result constraints</th> </tr> -<tr><td><code>abs</code></td> - <td><em>x</em></td> +<tr><td><code>abs</code></td> + <td><em>x</em></td> <td>Absolute value of <em>x</em>.</td> <td></td> <td></td> @@ -470,16 +470,16 @@ * * <p>The default behavior is to be case sensitive, meaning * '{@code cos}' would be recognized as the mathematical <a href="http://www.w3.org/TR/MathML2/chapter4.html#contm.trig">cosinus</a> but - * '{@code Cos}', '{@code cOs}' or any other alternatives would be recognized + * '{@code Cos}', '{@code cOs}' or any other alternatives would be recognized * as a name and read as a 'ci' element. If you pass {@code false} to this method * all the different versions of {@code cos} would be recognized as the mathematical - * <a href="http://www.w3.org/TR/MathML2/chapter4.html#contm.trig">cosinus</a>. + * <a href="http://www.w3.org/TR/MathML2/chapter4.html#contm.trig">cosinus</a>. * - * @param caseSensitive boolean to define if the parser should be case sensitive or not. + * @param caseSensitive boolean to define if the parser should be case sensitive or not. */ public void setCaseSensitive(boolean caseSensitive) { - this.ignoreCase = !caseSensitive; + ignoreCase = !caseSensitive; } private void checkSize(ArrayList < ASTNode > arguments, int i) throws ParseException @@ -516,44 +516,44 @@ } } -/** - * Returns a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. - * - * <p/> The formula produced for 'a % b' or modulo(a, b) is 'piecewise(floor(a/b), gt(a/b, 0), ceil(a/b))' - * - * @param leftChild - * @param rightChild - * @return a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. - * @see http://sbml.org/Documents/FAQ#Why_can.27t_I_use_the_.3Crem.3E_operator_in_SBML_MathML.3F - */ + /** + * Returns a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. + * + * <p/> The formula produced for 'a % b' or modulo(a, b) is 'piecewise(floor(a/b), gt(a/b, 0), ceil(a/b))' + * + * @param leftChild + * @param rightChild + * @return a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. + * @see "http://sbml.org/Documents/FAQ#Why_can.27t_I_use_the_.3Crem.3E_operator_in_SBML_MathML.3F" + */ private ASTNode createModulo(ASTNode leftChild, ASTNode rightChild) { - ASTNode node = new ASTNode(ASTNode.Type.FUNCTION_PIECEWISE); + ASTNode node = new ASTNode(ASTNode.Type.FUNCTION_PIECEWISE); - ASTNode floorNode = new ASTNode(ASTNode.Type.FUNCTION_FLOOR); - ASTNode aDividedByB = new ASTNode(ASTNode.Type.DIVIDE); - aDividedByB.addChild(leftChild); - aDividedByB.addChild(rightChild); + ASTNode floorNode = new ASTNode(ASTNode.Type.FUNCTION_FLOOR); + ASTNode aDividedByB = new ASTNode(ASTNode.Type.DIVIDE); + aDividedByB.addChild(leftChild); + aDividedByB.addChild(rightChild); - floorNode.addChild(aDividedByB); - node.addChild(floorNode); + floorNode.addChild(aDividedByB); + node.addChild(floorNode); - ASTNode greaterThan = new ASTNode(ASTNode.Type.RELATIONAL_GT); - greaterThan.addChild(aDividedByB.clone()); - greaterThan.addChild(new ASTNode(0)); + ASTNode greaterThan = new ASTNode(ASTNode.Type.RELATIONAL_GT); + greaterThan.addChild(aDividedByB.clone()); + greaterThan.addChild(new ASTNode(0)); - node.addChild(greaterThan); + node.addChild(greaterThan); - ASTNode ceilNode = new ASTNode(ASTNode.Type.FUNCTION_CEILING); - ceilNode.addChild(aDividedByB.clone()); + ASTNode ceilNode = new ASTNode(ASTNode.Type.FUNCTION_CEILING); + ceilNode.addChild(aDividedByB.clone()); - node.addChild(ceilNode); + node.addChild(ceilNode); - return node; + return node; } final public Token string() throws ParseException { - Token t; + Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LOG: t = jj_consume_token(LOG); @@ -566,19 +566,24 @@ jj_consume_token(-1); throw new ParseException(); } - {if (true) return t;} + {if (true) { + return t; + }} throw new Error("Missing return statement in function"); } + @Override final public ASTNode parse() throws ParseException { - ASTNode node = null; + ASTNode node = null; node = expression(); - {if (true) return node;} + {if (true) { + return node; + }} throw new Error("Missing return statement in function"); } final private ASTNode expression() throws ParseException { - ASTNode value = null; + ASTNode value = null; value = termLevel2(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: @@ -592,229 +597,243 @@ jj_consume_token(-1); throw new ParseException(); } - {if (true) return value;} + {if (true) { + return value; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel2() throws ParseException { - ASTNode rightChild = null; - ASTNode leftChild; - ASTNode node = null; - Token t; + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + Token t; leftChild = termLevel3(); label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN_LOGIC: - ; - break; - default: - jj_la1[2] = jj_gen; - break label_1; - } - t = jj_consume_token(BOOLEAN_LOGIC); - rightChild = termLevel3(); - // TODO - do we want to ignore the case for those cases ? - String s = t.image; - Type type = null; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN_LOGIC: + ; + break; + default: + jj_la1[2] = jj_gen; + break label_1; + } + t = jj_consume_token(BOOLEAN_LOGIC); + rightChild = termLevel3(); + // TODO - do we want to ignore the case for those cases ? + String s = t.image; + Type type = null; - if (s.equalsIgnoreCase("or") || s.equalsIgnoreCase("||")) - { - type = ASTNode.Type.LOGICAL_OR; + if (s.equalsIgnoreCase("or") || s.equalsIgnoreCase("||")) + { + type = ASTNode.Type.LOGICAL_OR; + } + else if (s.equalsIgnoreCase("and") || s.equalsIgnoreCase("&&")) + { + type = ASTNode.Type.LOGICAL_AND; + } + else if (s.equalsIgnoreCase("xor")) + { + type = ASTNode.Type.LOGICAL_XOR; + } + node = new ASTNode(type); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; } - else if (s.equalsIgnoreCase("and") || s.equalsIgnoreCase("&&")) - { - type = ASTNode.Type.LOGICAL_AND; - } - else if (s.equalsIgnoreCase("xor")) - { - type = ASTNode.Type.LOGICAL_XOR; - } - node = new ASTNode(type); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - } - {if (true) return leftChild;} + {if (true) { + return leftChild; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel3() throws ParseException { - ASTNode rightChild = null; - ASTNode leftChild; - ASTNode node = null; - Token t; + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + Token t; leftChild = termLevel4(); label_2: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMPARISON: - ; - break; - default: - jj_la1[3] = jj_gen; - break label_2; - } - t = jj_consume_token(COMPARISON); - rightChild = termLevel4(); - String s = t.image; - Type type = null; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMPARISON: + ; + break; + default: + jj_la1[3] = jj_gen; + break label_2; + } + t = jj_consume_token(COMPARISON); + rightChild = termLevel4(); + String s = t.image; + Type type = null; - if (s.equalsIgnoreCase("<")) - { - type = ASTNode.Type.RELATIONAL_LT; + if (s.equalsIgnoreCase("<")) + { + type = ASTNode.Type.RELATIONAL_LT; + } + else if (s.equalsIgnoreCase(">")) + { + type = ASTNode.Type.RELATIONAL_GT; + } + else if (s.equalsIgnoreCase("==")) + { + type = ASTNode.Type.RELATIONAL_EQ; + } + else if (s.equalsIgnoreCase("!=")) + { + type = ASTNode.Type.RELATIONAL_NEQ; + } + else if (s.equalsIgnoreCase(">=")) + { + type = ASTNode.Type.RELATIONAL_GEQ; + } + else if (s.equalsIgnoreCase("<=")) + { + type = ASTNode.Type.RELATIONAL_LEQ; + } + node = new ASTNode(type); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; } - else if (s.equalsIgnoreCase(">")) - { - type = ASTNode.Type.RELATIONAL_GT; - } - else if (s.equalsIgnoreCase("==")) - { - type = ASTNode.Type.RELATIONAL_EQ; - } - else if (s.equalsIgnoreCase("!=")) - { - type = ASTNode.Type.RELATIONAL_NEQ; - } - else if (s.equalsIgnoreCase(">=")) - { - type = ASTNode.Type.RELATIONAL_GEQ; - } - else if (s.equalsIgnoreCase("<=")) - { - type = ASTNode.Type.RELATIONAL_LEQ; - } - node = new ASTNode(type); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - } - {if (true) return leftChild;} + {if (true) { + return leftChild; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel4() throws ParseException { - ASTNode rightChild = null; - ASTNode leftChild; - ASTNode node = null; + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; leftChild = termLevel5(); label_3: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - ; - break; - default: - jj_la1[4] = jj_gen; - break label_3; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + case MINUS: + ; + break; + default: + jj_la1[4] = jj_gen; + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + rightChild = termLevel5(); + node = new ASTNode('+'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + case MINUS: + jj_consume_token(MINUS); + rightChild = termLevel5(); + node = new ASTNode('-'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + default: + jj_la1[5] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - rightChild = termLevel5(); - node = new ASTNode('+'); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - break; - case MINUS: - jj_consume_token(MINUS); - rightChild = termLevel5(); - node = new ASTNode('-'); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - break; - default: - jj_la1[5] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return leftChild;} + {if (true) { + return leftChild; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel5() throws ParseException { - ASTNode rightChild = null; - ASTNode leftChild; - ASTNode node = null; + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; leftChild = termLevel6(); label_4: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TIMES: - case DIVIDE: - case MODULO: - ; - break; - default: - jj_la1[6] = jj_gen; - break label_4; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TIMES: + case DIVIDE: + case MODULO: + ; + break; + default: + jj_la1[6] = jj_gen; + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TIMES: + jj_consume_token(TIMES); + rightChild = termLevel6(); + node = new ASTNode('*'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + case DIVIDE: + jj_consume_token(DIVIDE); + rightChild = termLevel6(); + Integer left, right; + left = getInteger(leftChild); + right = getInteger(rightChild); + // TODO - check if libsbml behave the same way + if (left != null && right != null) // Node transformed into a ASTNode.Type.RATIONAL number if both left and right are integer + { + node = new ASTNode(); + node.setValue(left, right); + leftChild = node; + } + else + { + node = new ASTNode('/'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + } + break; + case MODULO: + jj_consume_token(MODULO); + rightChild = termLevel6(); + node = createModulo(leftChild, rightChild); + leftChild = node; + break; + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TIMES: - jj_consume_token(TIMES); - rightChild = termLevel6(); - node = new ASTNode('*'); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - break; - case DIVIDE: - jj_consume_token(DIVIDE); - rightChild = termLevel6(); - Integer left, right; - left = getInteger(leftChild); - right = getInteger(rightChild); - // TODO - check if libsbml behave the same way - if (left != null && right != null) // Node transformed into a ASTNode.Type.RATIONAL number if both left and right are integer - { - node = new ASTNode(); - node.setValue(left, right); - leftChild = node; - } - else - { - node = new ASTNode('/'); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - } - break; - case MODULO: - jj_consume_token(MODULO); - rightChild = termLevel6(); - node = createModulo(leftChild, rightChild); - leftChild = node; - break; - default: - jj_la1[7] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return leftChild;} + {if (true) { + return leftChild; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel6() throws ParseException { - ASTNode node = null; + ASTNode node = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case MINUS: jj_consume_token(MINUS); node = termLevel7(); - ASTNode uiMinus = new ASTNode('-'); - uiMinus.addChild(node); - {if (true) return uiMinus;} + ASTNode uiMinus = new ASTNode('-'); + uiMinus.addChild(node); + {if (true) { + return uiMinus; + }} break; case NOT: jj_consume_token(NOT); node = termLevel7(); - ASTNode not = new ASTNode(Type.LOGICAL_NOT); - not.addChild(node); - {if (true) return not;} + ASTNode not = new ASTNode(Type.LOGICAL_NOT); + not.addChild(node); + {if (true) { + return not; + }} break; case INTEGER: case NUMBER: @@ -824,7 +843,9 @@ case LOG: case STRING: node = termLevel7(); - {if (true) return node;} + {if (true) { + return node; + }} break; default: jj_la1[8] = jj_gen; @@ -835,68 +856,76 @@ } final private ASTNode termLevel7() throws ParseException { - ASTNode rightChild; - ASTNode leftChild; - ASTNode node = null; + ASTNode rightChild; + ASTNode leftChild; + ASTNode node = null; leftChild = termLevel8(); label_5: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case POWER: - ; - break; - default: - jj_la1[9] = jj_gen; - break label_5; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case POWER: + ; + break; + default: + jj_la1[9] = jj_gen; + break label_5; + } + jj_consume_token(POWER); + rightChild = termLevel8(); + node = new ASTNode(Type.POWER); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; } - jj_consume_token(POWER); - rightChild = termLevel8(); - node = new ASTNode(Type.POWER); - node.addChild(leftChild); - node.addChild(rightChild); - leftChild = node; - } - {if (true) return leftChild;} + {if (true) { + return leftChild; + }} throw new Error("Missing return statement in function"); } final private ASTNode termLevel8() throws ParseException, NumberFormatException { - Token t; - double d; - int i; - ASTNode node = new ASTNode(); - ASTNode vector = null; - ASTNode child, furtherChild; - String s; - String vals [ ]; - ArrayList < ASTNode > arguments = new ArrayList < ASTNode > (); + Token t; + double d; + int i; + ASTNode node = new ASTNode(); + ASTNode vector = null; + ASTNode child, furtherChild; + String s; + String vals [ ]; + ArrayList < ASTNode > arguments = new ArrayList < ASTNode > (); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER: t = jj_consume_token(INTEGER); - i = Integer.parseInt(t.image); // Could use StringTools.parseXXX methods here but not doing so allow to support different locale ?? - node.setValue(i); - {if (true) return node;} + i = Integer.parseInt(t.image); // Could use StringTools.parseXXX methods here but not doing so allow to support different locale ?? + node.setValue(i); + {if (true) { + return node; + }} break; case NUMBER: t = jj_consume_token(NUMBER); - d = Double.parseDouble(t.image); - node.setValue(d); - {if (true) return node;} + d = Double.parseDouble(t.image); + node.setValue(d); + {if (true) { + return node; + }} break; case EXPNUMBER: t = jj_consume_token(EXPNUMBER); - s = t.image; - vals = s.toLowerCase().split("e"); - if (vals [ 1 ].startsWith("+")) - { - i = Integer.parseInt(vals [ 1 ].substring(1)); - } - else - { - i = Integer.parseInt(vals [ 1 ]); - } - node.setValue(Double.parseDouble(vals [ 0 ]), i); - {if (true) return node;} + s = t.image; + vals = s.toLowerCase().split("e"); + if (vals [ 1 ].startsWith("+")) + { + i = Integer.parseInt(vals [ 1 ].substring(1)); + } + else + { + i = Integer.parseInt(vals [ 1 ]); + } + node.setValue(Double.parseDouble(vals [ 0 ]), i); + {if (true) { + return node; + }} break; default: jj_la1[14] = jj_gen; @@ -905,226 +934,240 @@ jj_consume_token(OPEN_PAR); child = termLevel2(); label_6: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SPLITTER: - ; - break; - default: - jj_la1[10] = jj_gen; - break label_6; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SPLITTER: + ; + break; + default: + jj_la1[10] = jj_gen; + break label_6; + } + jj_consume_token(SPLITTER); + furtherChild = termLevel2(); + arguments.add(furtherChild); } - jj_consume_token(SPLITTER); - furtherChild = termLevel2(); - arguments.add(furtherChild); + jj_consume_token(CLOSE_PAR); + s = t.image; + Type type = null; + if (ignoreCase) + { + s = s.toLowerCase(); } - jj_consume_token(CLOSE_PAR); - s = t.image; - Type type = null; - if (ignoreCase) - { - s = s.toLowerCase(); - } - if (stringToType.containsKey(s)) - { - type = ASTNode.Type.valueOf(stringToType.getProperty(s.toLowerCase()).toUpperCase()); - } - if (s.equals("pow") || s.equals("power")) - { - checkSize(arguments, 1); - node.addChild(child); - } - else if (s.equals("sqr")) - { - checkSize(arguments, 0); - node.addChild(child); - node.addChild(new ASTNode(2)); - } - else if (s.equals("sqrt")) - { - checkSize(arguments, 0); - node.addChild(new ASTNode(2)); - node.addChild(child); - } - else if (s.equals("not")) - { - checkSize(arguments, 0); - node.addChild(child); - type = Type.LOGICAL_NOT; - } - else if (s.equals("ln")) - { - checkSize(arguments, 0); - node.addChild(child); - type = Type.FUNCTION_LN; - } - else if (s.equals("lambda")) - { - node.addChild(child); - type = Type.LAMBDA; - } - else if (s.equals("piecewise")) - { - node.addChild(child); - type = Type.FUNCTION_PIECEWISE; - } - else if (s.equals("modulo") || s.equals("mod")) - { - checkSize(arguments, 1); - ASTNode rightChild = arguments.get(0); - arguments.clear(); - node = createModulo(child, rightChild); - {if (true) return node;} - } - else - { - node.addChild(child); - } - if (type != null) - { - node.setType(type); - // TODO - should we set the name of the ASTNode for FUNCTION, ... - } - else - { - node.setName(s); - } - for (ASTNode argument : arguments) - { - node.addChild(argument); - } - {if (true) return node;} + if (stringToType.containsKey(s)) + { + type = ASTNode.Type.valueOf(stringToType.getProperty(s.toLowerCase()).toUpperCase()); + } + if (s.equals("pow") || s.equals("power")) + { + checkSize(arguments, 1); + node.addChild(child); + } + else if (s.equals("sqr")) + { + checkSize(arguments, 0); + node.addChild(child); + node.addChild(new ASTNode(2)); + } + else if (s.equals("sqrt")) + { + checkSize(arguments, 0); + node.addChild(new ASTNode(2)); + node.addChild(child); + } + else if (s.equals("not")) + { + checkSize(arguments, 0); + node.addChild(child); + type = Type.LOGICAL_NOT; + } + else if (s.equals("ln")) + { + checkSize(arguments, 0); + node.addChild(child); + type = Type.FUNCTION_LN; + } + else if (s.equals("lambda")) + { + node.addChild(child); + type = Type.LAMBDA; + } + else if (s.equals("piecewise")) + { + node.addChild(child); + type = Type.FUNCTION_PIECEWISE; + } + else if (s.equals("modulo") || s.equals("mod")) + { + checkSize(arguments, 1); + ASTNode rightChild = arguments.get(0); + arguments.clear(); + node = createModulo(child, rightChild); + {if (true) { + return node; + }} + } + else + { + node.addChild(child); + } + if (type != null) + { + node.setType(type); + // TODO - should we set the name of the ASTNode for FUNCTION, ... + } + else + { + node.setName(s); + } + for (ASTNode argument : arguments) + { + node.addChild(argument); + } + {if (true) { + return node; + }} } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case OPEN_PAR: jj_consume_token(OPEN_PAR); node = termLevel2(); jj_consume_token(CLOSE_PAR); - {if (true) return node;} + {if (true) { + return node; + }} break; default: jj_la1[15] = jj_gen; if (jj_2_2(4)) { t = jj_consume_token(STRING); - ASTNode selector = new ASTNode(); - selector.setType(ASTNode.Type.FUNCTION_SELECTOR); - selector.addChild(new ASTNode(t.image)); + ASTNode selector = new ASTNode(); + selector.setType(ASTNode.Type.FUNCTION_SELECTOR); + selector.addChild(new ASTNode(t.image)); label_7: - while (true) { - jj_consume_token(LEFT_BRACKET); - node = termLevel2(); - selector.addChild(node); - jj_consume_token(RIGHT_BRACKET); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LEFT_BRACKET: - ; - break; - default: - jj_la1[11] = jj_gen; - break label_7; + while (true) { + jj_consume_token(LEFT_BRACKET); + node = termLevel2(); + selector.addChild(node); + jj_consume_token(RIGHT_BRACKET); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LEFT_BRACKET: + ; + break; + default: + jj_la1[11] = jj_gen; + break label_7; + } } - } - {if (true) return selector;} + {if (true) { + return selector; + }} } else if (jj_2_3(2)) { jj_consume_token(LEFT_BRACES); node = termLevel2(); - ASTNode selector = new ASTNode(); - vector = new ASTNode(); - boolean isSelector = false; - selector.setType(ASTNode.Type.FUNCTION_SELECTOR); - vector.setType(ASTNode.Type.VECTOR); - vector.addChild(node); + ASTNode selector = new ASTNode(); + vector = new ASTNode(); + boolean isSelector = false; + selector.setType(ASTNode.Type.FUNCTION_SELECTOR); + vector.setType(ASTNode.Type.VECTOR); + vector.addChild(node); label_8: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SPLITTER: - ; - break; - default: - jj_la1[12] = jj_gen; - break label_8; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SPLITTER: + ; + break; + default: + jj_la1[12] = jj_gen; + break label_8; + } + jj_consume_token(SPLITTER); + node = termLevel2(); + vector.addChild(node); } - jj_consume_token(SPLITTER); - node = termLevel2(); - vector.addChild(node); - } jj_consume_token(RIGHT_BRACES); - selector.addChild(vector); + selector.addChild(vector); label_9: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LEFT_BRACKET: - ; - break; - default: - jj_la1[13] = jj_gen; - break label_9; + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LEFT_BRACKET: + ; + break; + default: + jj_la1[13] = jj_gen; + break label_9; + } + jj_consume_token(LEFT_BRACKET); + node = termLevel2(); + isSelector = true; + selector.addChild(node); + jj_consume_token(RIGHT_BRACKET); } - jj_consume_token(LEFT_BRACKET); - node = termLevel2(); - isSelector = true; - selector.addChild(node); - jj_consume_token(RIGHT_BRACKET); - } - {if (true) return isSelector ? selector : vector;} + {if (true) { + return isSelector ? selector : vector; + }} } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LEFT_BRACES: jj_consume_token(LEFT_BRACES); - vector = new ASTNode(); - vector.setType(ASTNode.Type.VECTOR); + vector = new ASTNode(); + vector.setType(ASTNode.Type.VECTOR); jj_consume_token(RIGHT_BRACES); - {if (true) return vector;} + {if (true) { + return vector; + }} break; case STRING: t = jj_consume_token(STRING); - s = t.image; - if (ignoreCase) - { - s = s.toLowerCase(); - } - // TODO - should we set the name of the ASTNode - if (s.equalsIgnoreCase("true")) // TODO - do we want to ignore the case for those ? - { - node = new ASTNode(Type.CONSTANT_TRUE); - } - else if (s.equalsIgnoreCase("false")) // TODO - do we want to ignore the case for those ? - { - node = new ASTNode(Type.CONSTANT_FALSE); - } - else if (s.equals("pi")) - { - node = new ASTNode(Type.CONSTANT_PI); - } - else if (s.equals("avogadro")) - { - node = new ASTNode(Type.NAME_AVOGADRO); - } - else if (s.equals("time")) // TODO - do we want to ignore the case for those ? - { - node = new ASTNode(Type.NAME_TIME); - } - else if (s.equals("exponentiale")) - { - node = new ASTNode(Type.CONSTANT_E); - } - else if (s.equals("-infinity") || s.equals("-INF")) - { - node = new ASTNode(Double.NEGATIVE_INFINITY); - } - else if (s.equals("infinity") || s.equals("INF")) - { - node = new ASTNode(Double.POSITIVE_INFINITY); - } - else if (s.equals("NotANumber") || s.equals("NaN")) // TODO - do we want to ignore the case for those ? - { - node = new ASTNode(Double.NaN); - } - else - { - node = new ASTNode(s); - } - {if (true) return node;} + s = t.image; + if (ignoreCase) + { + s = s.toLowerCase(); + } + // TODO - should we set the name of the ASTNode + if (s.equalsIgnoreCase("true")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.CONSTANT_TRUE); + } + else if (s.equalsIgnoreCase("false")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.CONSTANT_FALSE); + } + else if (s.equals("pi")) + { + node = new ASTNode(Type.CONSTANT_PI); + } + else if (s.equals("avogadro")) + { + node = new ASTNode(Type.NAME_AVOGADRO); + } + else if (s.equals("time")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.NAME_TIME); + } + else if (s.equals("exponentiale")) + { + node = new ASTNode(Type.CONSTANT_E); + } + else if (s.equals("-infinity") || s.equals("-INF")) + { + node = new ASTNode(Double.NEGATIVE_INFINITY); + } + else if (s.equals("infinity") || s.equals("INF")) + { + node = new ASTNode(Double.POSITIVE_INFINITY); + } + else if (s.equals("NotANumber") || s.equals("NaN")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Double.NaN); + } + else + { + node = new ASTNode(s); + } + {if (true) { + return node; + }} break; default: jj_la1[16] = jj_gen; @@ -1163,49 +1206,75 @@ Token xsp; xsp = jj_scanpos; if (jj_3R_23()) { - jj_scanpos = xsp; - if (jj_3R_24()) { - jj_scanpos = xsp; - if (jj_3R_25()) return true; + jj_scanpos = xsp; + if (jj_3R_24()) { + jj_scanpos = xsp; + if (jj_3R_25()) { + return true; + } + } } - } return false; } private boolean jj_3R_23() { - if (jj_scan_token(MINUS)) return true; - if (jj_3R_29()) return true; + if (jj_scan_token(MINUS)) { + return true; + } + if (jj_3R_29()) { + return true; + } return false; } private boolean jj_3R_11() { - if (jj_scan_token(LEFT_BRACKET)) return true; - if (jj_3R_12()) return true; - if (jj_scan_token(RIGHT_BRACKET)) return true; + if (jj_scan_token(LEFT_BRACKET)) { + return true; + } + if (jj_3R_12()) { + return true; + } + if (jj_scan_token(RIGHT_BRACKET)) { + return true; + } return false; } private boolean jj_3R_36() { - if (jj_scan_token(LEFT_BRACES)) return true; - if (jj_scan_token(RIGHT_BRACES)) return true; + if (jj_scan_token(LEFT_BRACES)) { + return true; + } + if (jj_scan_token(RIGHT_BRACES)) { + return true; + } return false; } private boolean jj_3_1() { - if (jj_3R_10()) return true; - if (jj_scan_token(OPEN_PAR)) return true; + if (jj_3R_10()) { + return true; + } + if (jj_scan_token(OPEN_PAR)) { + return true; + } return false; } private boolean jj_3R_28() { - if (jj_scan_token(MODULO)) return true; + if (jj_scan_token(MODULO)) { + return true; + } return false; } private boolean jj_3_2() { - if (jj_scan_token(STRING)) return true; + if (jj_scan_token(STRING)) { + return true; + } Token xsp; - if (jj_3R_11()) return true; + if (jj_3R_11()) { + return true; + } while (true) { xsp = jj_scanpos; if (jj_3R_11()) { jj_scanpos = xsp; break; } @@ -1214,28 +1283,40 @@ } private boolean jj_3R_22() { - if (jj_scan_token(MINUS)) return true; + if (jj_scan_token(MINUS)) { + return true; + } return false; } private boolean jj_3R_31() { - if (jj_scan_token(POWER)) return true; + if (jj_scan_token(POWER)) { + return true; + } return false; } private boolean jj_3R_35() { - if (jj_scan_token(OPEN_PAR)) return true; - if (jj_3R_12()) return true; + if (jj_scan_token(OPEN_PAR)) { + return true; + } + if (jj_3R_12()) { + return true; + } return false; } private boolean jj_3R_14() { - if (jj_scan_token(BOOLEAN_LOGIC)) return true; + if (jj_scan_token(BOOLEAN_LOGIC)) { + return true; + } return false; } private boolean jj_3R_29() { - if (jj_3R_30()) return true; + if (jj_3R_30()) { + return true; + } Token xsp; while (true) { xsp = jj_scanpos; @@ -1245,7 +1326,9 @@ } private boolean jj_3R_12() { - if (jj_3R_13()) return true; + if (jj_3R_13()) { + return true; + } Token xsp; while (true) { xsp = jj_scanpos; @@ -1258,24 +1341,32 @@ Token xsp; xsp = jj_scanpos; if (jj_3R_21()) { - jj_scanpos = xsp; - if (jj_3R_22()) return true; + jj_scanpos = xsp; + if (jj_3R_22()) { + return true; + } } return false; } private boolean jj_3R_21() { - if (jj_scan_token(PLUS)) return true; + if (jj_scan_token(PLUS)) { + return true; + } return false; } private boolean jj_3R_16() { - if (jj_scan_token(COMPARISON)) return true; + if (jj_scan_token(COMPARISON)) { + return true; + } return false; } private boolean jj_3R_15() { - if (jj_3R_17()) return true; + if (jj_3R_17()) { + return true; + } Token xsp; while (true) { xsp = jj_scanpos; @@ -1285,12 +1376,16 @@ } private boolean jj_3R_34() { - if (jj_scan_token(EXPNUMBER)) return true; + if (jj_scan_token(EXPNUMBER)) { + return true; + } return false; } private boolean jj_3R_13() { - if (jj_3R_15()) return true; + if (jj_3R_15()) { + return true; + } Token xsp; while (true) { xsp = jj_scanpos; @@ -1300,17 +1395,23 @@ } private boolean jj_3R_33() { - if (jj_scan_token(NUMBER)) return true; + if (jj_scan_token(NUMBER)) { + return true; + } return false; } private boolean jj_3R_27() { - if (jj_scan_token(DIVIDE)) return true; + if (jj_scan_token(DIVIDE)) { + return true; + } return false; } private boolean jj_3R_25() { - if (jj_3R_29()) return true; + if (jj_3R_29()) { + return true; + } return false; } @@ -1318,14 +1419,18 @@ Token xsp; xsp = jj_scanpos; if (jj_scan_token(26)) { - jj_scanpos = xsp; - if (jj_scan_token(27)) return true; + jj_scanpos = xsp; + if (jj_scan_token(27)) { + return true; + } } return false; } private boolean jj_3R_32() { - if (jj_scan_token(INTEGER)) return true; + if (jj_scan_token(INTEGER)) { + return true; + } return false; } @@ -1333,47 +1438,59 @@ Token xsp; xsp = jj_scanpos; if (jj_3R_32()) { - jj_scanpos = xsp; - if (jj_3R_33()) { - jj_scanpos = xsp; - if (jj_3R_34()) { - jj_scanpos = xsp; - if (jj_3_1()) { - jj_scanpos = xsp; - if (jj_3R_35()) { - jj_scanpos = xsp; - if (jj_3_2()) { - jj_scanpos = xsp; - if (jj_3_3()) { - jj_scanpos = xsp; - if (jj_3R_36()) { - jj_scanpos = xsp; - if (jj_3R_37()) return true; + jj_scanpos = xsp; + if (jj_3R_33()) { + jj_scanpos = xsp; + if (jj_3R_34()) { + jj_scanpos = xsp; + if (jj_3_1()) { + jj_scanpos = xsp; + if (jj_3R_35()) { + jj_scanpos = xsp; + if (jj_3_2()) { + jj_scanpos = xsp; + if (jj_3_3()) { + jj_scanpos = xsp; + if (jj_3R_36()) { + jj_scanpos = xsp; + if (jj_3R_37()) { + return true; + } + } + } + } + } + } + } + } } - } - } - } - } - } - } - } return false; } private boolean jj_3_3() { - if (jj_scan_token(LEFT_BRACES)) return true; - if (jj_3R_12()) return true; + if (jj_scan_token(LEFT_BRACES)) { + return true; + } + if (jj_3R_12()) { + return true; + } return false; } private boolean jj_3R_26() { - if (jj_scan_token(TIMES)) return true; + if (jj_scan_token(TIMES)) { + return true; + } return false; } private boolean jj_3R_24() { - if (jj_scan_token(NOT)) return true; - if (jj_3R_29()) return true; + if (jj_scan_token(NOT)) { + return true; + } + if (jj_3R_29()) { + return true; + } return false; } @@ -1381,22 +1498,28 @@ Token xsp; xsp = jj_scanpos; if (jj_3R_26()) { - jj_scanpos = xsp; - if (jj_3R_27()) { - jj_scanpos = xsp; - if (jj_3R_28()) return true; + jj_scanpos = xsp; + if (jj_3R_27()) { + jj_scanpos = xsp; + if (jj_3R_28()) { + return true; + } + } } - } return false; } private boolean jj_3R_37() { - if (jj_scan_token(STRING)) return true; + if (jj_scan_token(STRING)) { + return true; + } return false; } private boolean jj_3R_17() { - if (jj_3R_19()) return true; + if (jj_3R_19()) { + return true; + } Token xsp; while (true) { xsp = jj_scanpos; @@ -1419,18 +1542,18 @@ final private int[] jj_la1 = new int[17]; static private int[] jj_la1_0; static { - jj_la1_init_0(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0xc000000,0x40000001,0x200000,0x100000,0x500,0x500,0x3800,0x3800,0xe014468,0x200,0x80,0x40000,0x80,0x40000,0x68,0x4000,0x8010000,}; - } + jj_la1_init_0(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0xc000000,0x40000001,0x200000,0x100000,0x500,0x500,0x3800,0x3800,0xe014468,0x200,0x80,0x40000,0x80,0x40000,0x68,0x4000,0x8010000,}; + } final private JJCalls[] jj_2_rtns = new JJCalls[3]; private boolean jj_rescan = false; private int jj_gc = 0; /** Constructor with InputStream. */ public CobraFormulaParser(java.io.InputStream stream) { - this(stream, null); + this(stream, null); } /** Constructor with InputStream and supplied encoding */ public CobraFormulaParser(java.io.InputStream stream, String encoding) { @@ -1439,23 +1562,33 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } /** Reinitialise. */ + @Override public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); + ReInit(stream, null); } /** Reinitialise. */ + @Override public void ReInit(java.io.InputStream stream, String encoding) { try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } /** Constructor. */ @@ -1465,19 +1598,28 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } /** Reinitialise. */ + @Override public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } /** Constructor with generated Token Manager. */ @@ -1486,8 +1628,12 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } /** Reinitialise. */ @@ -1496,14 +1642,21 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 17; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + for (int i = 0; i < 17; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } } private Token jj_consume_token(int kind) throws ParseException { Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); + if ((oldToken = token).next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } jj_ntk = -1; if (token.kind == kind) { jj_gen++; @@ -1512,7 +1665,9 @@ for (int i = 0; i < jj_2_rtns.length; i++) { JJCalls c = jj_2_rtns[i]; while (c != null) { - if (c.gen < jj_gen) c.first = null; + if (c.gen < jj_gen) { + c.first = null; + } c = c.next; } } @@ -1540,38 +1695,51 @@ if (jj_rescan) { int i = 0; Token tok = token; while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); + if (tok != null) { + jj_add_error_token(kind, i); + } } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + if (jj_scanpos.kind != kind) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + throw jj_ls; + } return false; } -/** Get the next Token. */ + /** Get the next Token. */ final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); + if (token.next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } jj_ntk = -1; jj_gen++; return token; } -/** Get the specific Token. */ + /** Get the specific Token. */ final public Token getToken(int index) { Token t = token; for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); + if (t.next != null) { + t = t.next; + } else { + t = t.next = token_source.getNextToken(); + } } return t; } private int jj_ntk() { - if ((jj_nt=token.next) == null) + if ((jj_nt=token.next) == null) { return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else + } else { return (jj_ntk = jj_nt.kind); + } } private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); @@ -1581,7 +1749,9 @@ private int jj_endpos; private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; + if (pos >= 100) { + return; + } if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; } else if (jj_endpos != 0) { @@ -1601,7 +1771,9 @@ break jj_entries_loop; } } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } } } @@ -1650,19 +1822,19 @@ private void jj_rescan_token() { jj_rescan = true; for (int i = 0; i < 3; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { case 0: jj_3_1(); break; case 1: jj_3_2(); break; case 2: jj_3_3(); break; + } } - } - p = p.next; - } while (p != null); + p = p.next; + } while (p != null); } catch(LookaheadSuccess ls) { } } jj_rescan = false; Modified: trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java =================================================================== --- trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java 2015-08-31 09:09:43 UTC (rev 2357) @@ -545,7 +545,7 @@ try { SBMLErrorLog sbmlErrorLog = (SBMLErrorLog) xstream.fromXML(reader); - logger.debug("Call and Parsing of the results done !!!"); + logger.debug("Call and Parsing of the results done!"); // logger.debug("File = " + resultsObj.getFile().getName()); Modified: trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java =================================================================== --- trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java 2015-08-31 09:09:43 UTC (rev 2357) @@ -44,11 +44,60 @@ public class SyntaxChecker { /** + * + */ + private static Pattern chemicalFormulaPattern; + + /** * The only instance of this class. */ private static final SyntaxChecker syntaxChecker = new SyntaxChecker(); /** + * + * @return + */ + private static Pattern initChemicalFormulaPattern() { + String period[] = new String[7]; + String lanthanide = "La|Ce|Pr|Nd|Pm|Sm|Eu|Gd|Tb|Dy|Ho|Er|Tm|Yb|Lu"; + String actinide = "Ac|Th|Pa|U|Np|Pu|Am|Cm|Bk|Cf|Es|Fm|Md|No|Lr"; + period[0] = "H|He"; + period[1] = "Li|Be|B|C|N|O|F|Ne"; + period[2] = "Na|Mg|Al|Si|P|S|Cl|Ar"; + period[3] = "K|Ca|Sc|Ti|V|Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr"; + period[4] = "Rb|Sr|Y|Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I|Xe"; + period[5] = "Cs|Ba|" + lanthanide + "|Hf|Ta|W|Re|Os|Ir|Pt|Au|Hg|Tl|Pb|Bi|Po|At|Rn"; + period[6] = "Fr|Ra|" + actinide + "Rf|Db|Sg|Bh|Hs|Mt|Ds|Rg|Cn|Uut|Fl|Uup|Lv|Uus|Uuo"; + + StringBuilder atoms = new StringBuilder(); + atoms.append(period[0]); + for (int i = 1; i < period.length; i++) { + atoms.append('|'); + atoms.append(period[i]); + } + + String compoundName = "[A-Z][a-z]*"; + + String residues = "[A-Z][a-z]*"; + + String regex = "((" + atoms.toString() + "|" + residues + ")+\\d*)*|(" + compoundName + ")?"; + + return Pattern.compile(regex); + } + + /** + * + * @param chemicalFormula + * @return + */ + public static boolean isValidChemicalFormula(String chemicalFormula) { + if (chemicalFormulaPattern == null) { + SyntaxChecker.chemicalFormulaPattern = initChemicalFormulaPattern(); + } + return SyntaxChecker.chemicalFormulaPattern.matcher(chemicalFormula).matches(); + } + + /** * Definition of valid e-mail address {@link String}s. * <table> * <tr> @@ -96,6 +145,7 @@ return syntaxChecker.emailPattern.matcher(email).matches(); } + /** * Checks whether the given idCandidate is a valid identifier according to * the SBML specifications. @@ -149,7 +199,6 @@ return syntaxChecker.SIdL2Pattern.matcher(idCandidate).matches(); } - /** * Checks if the given identifier candidate satisfies the requirements for a * valid meta identifier (see SBML L2V4 p. 12 for details). @@ -179,17 +228,11 @@ * Definition of valid e-mail addresses. Initialized upon first use. */ private Pattern emailPattern; - /** * {@link Pattern} to recognize valid meta-identifier strings for SBML * elements. */ private Pattern metaIdPattern; - /** - * Simplified {@link Pattern} to recognize valid meta-identifier strings for - * SBML elements. - */ - private Pattern simpleMetaIdPattern; /** * Collection of reserved names that must not be used as identifiers (names) @@ -209,6 +252,12 @@ private Pattern SIdL2Pattern; /** + * Simplified {@link Pattern} to recognize valid meta-identifier strings for + * SBML elements. + */ + private Pattern simpleMetaIdPattern; + + /** * Name {@link Pattern} for SBML Level 1 version 1. */ private Pattern SNameL1V1; Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java 2015-08-28 00:19:09 UTC (rev 2356) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java 2015-08-31 09:09:43 UTC (rev 2357) @@ -27,10 +27,12 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.Species; import org.sbml.jsbml.util.StringTools; +import org.sbml.jsbml.validator.SyntaxChecker; /** * {@link FBCSpeciesPlugin} is the extended {@link Species} class with the additional @@ -44,6 +46,11 @@ */ public class FBCSpeciesPlugin extends AbstractFBCSBasePlugin { + /** + * A {@link Logger} for this class. + */ + private static final transient Logger logger = Logger.getLogger(FBCSpeciesPlugin.class); + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#getParent() */ @@ -213,7 +220,11 @@ setCharge(StringTools.parseSBMLInt(value)); return true; } else if (attributeName.equals(FBCConstants.chemicalFormula)) { - setChemicalFormula(value); + try { + setChemicalFormula(value); + } catch (IllegalArgumentException exc) { + logger.error("Skipped invalid chemical formula: " + chemicalFormula); + } return true; } @@ -236,14 +247,19 @@ /** * Sets the value of chemicalFormula. * - * The format of chemical formula must consist only of atomic names (as in the Periodic Table) - * or user defined compounds either of which take the form of a single capital letter followed - * by zero or more lower-case letters. Where there is more than a single atom present, - * this is indicated with an integer. With regards to o... [truncated message content] |
From: <ale...@us...> - 2015-08-28 00:19:11
|
Revision: 2356 http://sourceforge.net/p/jsbml/code/2356 Author: alex-thomas Date: 2015-08-28 00:19:09 +0000 (Fri, 28 Aug 2015) Log Message: ----------- Update to the User Guide which adds an overview of SBML packages. Modified Paths: -------------- trunk/core/doc/common/tex/literature.bib trunk/core/doc/user_guide/JSBML_Acknowledgments.tex trunk/core/doc/user_guide/JSBML_FAQ.tex trunk/core/doc/user_guide/JSBML_compared_to_libSBML.tex trunk/core/doc/user_guide/JSBML_extensions_overview.tex trunk/core/doc/user_guide/JSBML_hello_world_examples.tex trunk/core/doc/user_guide/User_Guide.tex Modified: trunk/core/doc/common/tex/literature.bib =================================================================== --- trunk/core/doc/common/tex/literature.bib 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/common/tex/literature.bib 2015-08-28 00:19:09 UTC (rev 2356) @@ -1,6 +1,28 @@ % This file was created with JabRef 2.5. % Encoding: Cp1252 +@article{breitling2008, + title={A structured approach for the engineering of biochemical network models, illustrated for signalling pathways}, + author={Breitling, Rainer and Gilbert, David and Heiner, Monika and Orton, Richard}, + journal={Briefings in bioinformatics}, + volume={9}, + number={5}, + pages={404--421}, + year={2008}, + publisher={Oxford Univ Press} +} + +@article{Chaouiya2013, + title={SBML qualitative models: a model representation format and infrastructure to foster interactions between qualitative modelling formalisms and tools}, + author={Chaouiya, Claudine and B{\'e}renguier, Duncan and Keating, Sarah M and Naldi, Aur{\'e}lien and Van Iersel, Martijn P and Rodriguez, Nicolas and Dr{\"a}ger, Andreas and B{\"u}chel, Finja and Cokelaer, Thomas and Kowal, Bryan and others}, + journal={BMC systems biology}, + volume={7}, + number={1}, + pages={135}, + year={2013}, + publisher={BioMed Central Ltd} +} + @article{Courtot2011a, author = {Courtot, M\'{e}lanie and Juty, Nick and Kn\"upfer, Christian and Waltemath, Dagmar and Zhukova, Anna and Dr\"ager, Andreas and Dumontier, @@ -454,6 +476,43 @@ url = {http://bioinformatics.oxfordjournals.org/cgi/content/abstract/19/4/524} } +@article{gauges2006, + title={A model diagram layout extension for SBML}, + author={Gauges, Ralph and Rost, Ursula and Sahle, Sven and Wegner, Katja}, + journal={Bioinformatics}, + volume={22}, + number={15}, + pages={1879--1885}, + year={2006}, + publisher={Oxford Univ Press} +} + +@article{Gomez2014, + title={Dynamic Structures, Version 1 Release .1.}, + author={Gomez, Harold}, + year={2014}, + url = {http://sourceforge.net/p/sbml/code/HEAD/tree/trunk/specifications/sbml-level-3/version-1/dyn/spec/sbml-dyn-v1-rel0.1.pdf?format=raw} +} + +@article{lewis2012, + title={Constraining the metabolic genotype--phenotype relationship using a phylogeny of in silico methods}, + author={Lewis, Nathan E and Nagarajan, Harish and Palsson, Bernhard O}, + journal={Nature Reviews Microbiology}, + volume={10}, + number={4}, + pages={291--305}, + year={2012}, + publisher={Nature Publishing Group} +} + +@article{Moodie2013, + title={Distributions, Version .13.}, + author={Moodie,S.L. and Smith, L.P.}, + year={2013}, + url = {http://sourceforge.net/p/sbml/code/18403/tree/trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.pdf?format=raw} +} + + @ARTICLE{Novere2006, author = {Le Nov{\`e}re, Nicolas}, title = {Model storage, exchange and integration}, @@ -547,6 +606,53 @@ url = {http://www.nature.com/nbt/journal/v23/n12/abs/nbt1156.html} } +@article{olivier2013, + title={SBML Level 3 Package: Flux Balance Constraints ('fbc')}, + author={Olivier, Brett G and Bergmann, Frank T}, + year={2013} +} + +@article{Schaff2014, + title={Spatial Processes, Version 1 Release .88.}, + author={Schaff, J.C.}, + year={2014}, + url = {https://docs.google.com/file/d/0B71r5kLs3FliUW4yaGZSX2QyX1U/edit} +} + +@article{shmulevich2002, + title={From Boolean to probabilistic Boolean networks as models of genetic regulatory networks}, + author={Shmulevich, Ilya and Dougherty, Edward R and Zhang, Wei}, + journal={Proceedings of the IEEE}, + volume={90}, + number={11}, + pages={1778--1792}, + year={2002}, + publisher={IEEE} +} + +@article{smith2010, + title={SBML Level 3 hierarchical model composition}, + author={Smith, Lucian P and Hucka, Michael}, + year={2010}, + publisher={Nature Publishing Group} +} + +@article{Smith2013, + title={Required Elements}, + author={Smith, Lucian P and Hucka, Michael}, + year={2013}, + url = {https://docs.google.com/file/d/0B71r5kLs3FliWGxFN3o0dnNrZE0/edit} +} + +@article{Watanabe2013, + title={Arrays, Version 1 Release .1.}, + author={Watanabe, Leandro and Myers, Chris}, + year={2014}, + url = {https://sourceforge.net/p/sbml/code/18411/tree/trunk/specifications/sbml-level-3/version-1/arrays/spec/arrays-proposal-sept2013.pdf?format=raw} +} + + + @MISC{JavaDownloadURL, author = {{Oracle, Inc.}}, title = {Java\texttrademark}, Modified: trunk/core/doc/user_guide/JSBML_Acknowledgments.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_Acknowledgments.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/JSBML_Acknowledgments.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -18,6 +18,14 @@ Eichner. \end{itemize} +In addition, JSBML has been fortunate to participate in the Google Summer of Code. Here are various information for these projects. + +\begin{itemize} +\item Arrays package development, Leandro Watanabe: \url{http://lhwatanabe.blogspot.com/} +\item CellDesigner Layout interface, Ibrahim Vazirabad: \url{http://jsbmlcelldesigner2014.blogspot.com/} +\item ASTNode interface revamp, Victor Kofia: \url{http://kofiav.github.io/2015/08/03/astnode-vs-astnode2/} +\end{itemize} + The development of JSBML is currently funded by the following organizations: \begin{itemize} \item The National Institute of General Medical Sciences (USA) via grant Modified: trunk/core/doc/user_guide/JSBML_FAQ.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_FAQ.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/JSBML_FAQ.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -72,9 +72,8 @@ In version 0.8, JSBML did not provide an abstract programming interface for extension packages.% \index{extension packages} Since then, the JSBML community has - actively developed extension packages for the following SBML extensions: - \code{fbc}, \code{groups}, \code{layout}, \code{multi}, - \code{qual}, and \code{spatial}. These packages can be used with the + actively developed extension packages for all SBML extensions, + see \sec{sec:sec:extensionsOverview}. These packages can be used with the version 1.0 or later of JSBML. \end{description} Modified: trunk/core/doc/user_guide/JSBML_compared_to_libSBML.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_compared_to_libSBML.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/JSBML_compared_to_libSBML.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -1181,7 +1181,7 @@ JSBML data structure with corresponding libSBML data structures. \begin{figure}[htb] - \exampleFile{src/libSBMLio_example.java} + \exampleFile{src/org/sbml/jsbml/xml/libsbml/libSBMLio_example.java} \caption{A simple example showing how to convert libSBML data structures into JSBML data objects. To run this example, you need libSBML installed on your system. You may need to set environment variables, @@ -1210,7 +1210,7 @@ in a tree, like the example in \fig{fig:JSBMLvisualizer-output}. \begin{figure}[thb] - \exampleFile{src/cdplugin_example.java} + \exampleFile{src/org/sbml/jsbml/celldesigner/cdplugin_example.java} \caption{A simple implementation of CellDesigner's abstract class \code{PluginAction}.} \label{lst:PluginAction} @@ -1229,14 +1229,14 @@ synchronization of changes in JSBML's data structures with CellDesigner. \begin{figure}[thb] - \exampleFile[style = java, lastline = 66]{src/SimpleCellDesignerPlugin.java} + \exampleFile[style = java, lastline = 66]{src/org/sbml/jsbml/celldesigner/SimpleCellDesignerPlugin.java} \caption{A simple example for a CellDesigner plugin using JSBML as a communication layer. Continued in next figure.} \label{lst:Plugin1} \end{figure} \begin{figure}[thb] - \exampleFile[style = java, firstline = 67]{src/SimpleCellDesignerPlugin.java} + \exampleFile[style = java, firstline = 67]{src/org/sbml/jsbml/celldesigner/SimpleCellDesignerPlugin.java} \caption{(Continued.) A simple example for a CellDesigner plugin using JSBML as a communication layer.} \label{lst:Plugin2} Modified: trunk/core/doc/user_guide/JSBML_extensions_overview.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_extensions_overview.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/JSBML_extensions_overview.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -1,37 +1,39 @@ % -*- TeX-master: "User_guide"; fill-column: 75 -*- -\chapter{JSBML Extensions Overview} +\section{SBML packages overview} \label{sec:extensionsOverview} -In this chapter, we quickly overview the \SBMLthree packages currently -implemented for JSBML. +In this section, we quickly overview the state of the \SBMLthree packages currently +implemented for JSBML to provide users with documentation of what's possible with SBML and JSBML. +Each package description is accompanied by a +class hierarchy describing the current state of development for the +package. Note smaller package descriptions correspond to packages in +active standards development, however, packages are up to date +with respect to the latest released standards. -\section{Qualitative Models Package} -\label{sec:qual-overview} - -Qualitative Models package (qual, for short) allows species in a model to -have non-quantitative or non-continuous concentrations (Chaouiya et al., 2013). -This may manifest as Boolean or discrete values, and is primarily employed in -modeling gene regulation, sig-naling pathways, and metabolic networks using -logical/Boolean networks (Schmulevich et al., 2002) or Petri nets -(Breitling et al., 2008), which in turn, do not rely on traditional quantitative -coeffi-cients to encode relationships between biochemical entities. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/qual/doc/img/type_hierarchy.pdf} - \caption[The qualitative models extension]{} + \caption[Class diagram of the qualitative models extension]{Class diagram of the qualitative models extension. Qualitative Models package (\code{qual}, for short) allows species in a model to +have non-quantitative or non-continuous concentrations \cite{Chaouiya2013}. +This may manifest as Boolean or discrete values, and is primarily employed in +modelling gene regulation, signalling pathways, and metabolic networks using +logical/Boolean networks \cite{shmulevich2002} or Petri nets +\cite{breitling2008}, which in turn, do not rely on traditional quantitative +coefficients to encode relationships between biochemical entities.} \label{fig:qual} \end{figure} -\section{Flux Balance Constraints Package} -\label{sec:fbc-overview} -Constraints based modeling (Lewis et al., 2012) utilizes a class of models in which -the canonical stoichiometric relations between reac-tions and metabolites are specified +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/fbc/doc/img/type_hierarchy.pdf} + \caption[Class diagram of the flux balance constraints extension.]{Class diagram of the flux balance constraints extension. Constraints-based modelling \cite{lewis2012} utilizes a class of models in which +the canonical stoichiometric relations between reactions and metabolites are specified as constraints for convex analysis and mathematical optimization. Although species, reactions, and stoichiometry can be encoded using the SBML L3V1, -Flux Balance Constraints (fbc, Olivier and Bergmann, 2013) enable a constraints +Flux Balance Constraints (\code{fbc}, \cite{olivier2013}) enable a constraints based perspective. For example, the constraints based approach called Flux Balance Analysis (FBA) often aims to find the maximum growth rate of the cell given a set of uptake possibilities and the ratio of molecules needed @@ -40,173 +42,130 @@ metabolites and bounds on the variable reaction fluxes. Because this formulation is underdetermined, an objective, usually one that maximizes a biomass function which corresponds to growth rate, is supplied which optimizes the reaction fluxes. Therefore, -the fbc package extends the SBML Level 3 core to specifically encode for bounds on +the \code{fbc} package extends the SBML Level 3 core to specifically encode for bounds on fluxes, constraints, and objective functions, which facilitates a fluid interface to -existing constraints based modeling software and optimization solvers. +existing constraints-based modelling software and optimization solvers.} + \label{fig:fbc} +\end{figure} \begin{figure}[hb] \centering \vspace*{2ex} - \includegraphics[width=\textwidth]{../../../extensions/fbc/doc/img/type_hierarchy.pdf} - \caption[The flux balance constraints extension]{} - \label{fig:fbc} -\end{figure} - -\section{Layout Package} -\label{sec:layout-overview} - -SBML encodes a core set of components (species, reactions) that make up -biochemical networks. The layout extension supports specifying graphical + \includegraphics[width=\textwidth]{../../../extensions/layout/doc/img/type_hierarchy.pdf} + \caption[Class diagram of the layout extension]{Class diagram of the layout extension. SBML encodes a core set of components (species, reactions) that make up +biochemical networks. The \code{layout} extension supports specifying graphical information for these components. The structure for this extension mirrors -the SBML Level 3 core hierarchy by introducing graphical object (glyph) -counterparts to reactions and species. Glyphs can optionally correspond -to elements in standard SBML, and there can be many glyphs for one element. -In addition, layout elements of non-standard model components can be specified -using the generic GraphicalObject class. Although this exten-sion is powerful +the SBML Level 3 core hierarchy by introducing graphical object (\code{glyph}) +counterparts to reactions and species. Different \code{glyph} types can optionally correspond +to elements in standard SBML, and there can be many \code{glyphs} for one element. +In addition, \code{layout} elements of non-standard model components can be specified +using the generic \code{GraphicalObject} class. Although this extension is powerful enough to encode the position of all biochemically related graph components, it should be noted that the scope of this package does not include rendering -of these components. This functionality is provided by the Render package. -Ultimately, the layout extension provides a common language that biochemical -graph editors and viewers can utilize to couple a model to a graph layout. +of these components. This functionality is provided by the \code{Render} package. +Ultimately, the \code{layout} extension provides a common language that biochemical +graph editors and viewers can utilize to couple a model to a graph layout.} + \label{fig:layout} +\end{figure} \begin{figure}[hb] \centering \vspace*{2ex} - \includegraphics[width=\textwidth]{../../../extensions/layout/doc/img/type_hierarchy.pdf} - \caption[The layout extension]{} - \label{fig:layout} -\end{figure} - -\section{Hierarchical Model Composition Package} -\label{sec:comp-overview} -As the amount of information for biochemical networks increases, models tend to -increase in complexity as well. The Hierarchical Model Composition extension (comp; Smith et al., 2013) + \includegraphics[width=\textwidth]{../../../extensions/comp/doc/img/type_hierarchy.pdf} + \caption[Class diagram of the hierarchical model composition extension]{Class diagram of the hierarchical model composition extension. As the amount of information for biochemical networks increases, models tend to +increase in complexity as well. The Hierarchical Model Composition extension (\code{comp}; \cite{smith2010}) attempts to contextualize this complexity by providing a generic framework to encode models as hierarchical entities in an SBML document. This functionality also allows for storing multiple instances of a model within an enclosing model or document, which can be used to build libraries of models within a document or to independently manage -different parts of a large model. Classes allow modelers to access elements within -sub-models and interface with other submodels, and comp provides a standardized approach -to define submodel differences with respect to parent or reference models. Overall, comp -is a powerful exten-sion to the SBML Level 3 core that gives modelers and programmers -options to standardize the encoding of complex, modular modeling frameworks. +different parts of a large model. Classes allow modellers to access elements within +sub-models and interface with other sub-models, and \code{comp} provides a standardized approach +to define sub-model differences with respect to parent or reference models. Overall, \code{comp} +is a powerful extension to the SBML Level 3 core that gives modellers and programmers +options to standardize the encoding of complex, modular modelling frameworks. +} + \label{fig:comp} +\end{figure} \begin{figure}[hb] \centering \vspace*{2ex} - \includegraphics[width=\textwidth]{../../../extensions/comp/doc/img/type_hierarchy.pdf} - \caption[The hierarchical model composition extension]{} - \label{fig:comp} -\end{figure} - -\section{Spatial Processes Package} -\label{sec:comp-overview} -The Spatial Processes extension (spatial, Schaff et al., 2014) + \includegraphics[width=\textwidth]{../../../extensions/spatial/doc/img/type_hierarchy.pdf} + \caption[Class diagram of the spatial processes extension]{Class diagram of the spatial processes extension. The Spatial Processes extension (\code{spatial}, \cite{Schaff2014}) provides the ability to the SBML Level 3 core to specify subcellular, geometric locations for components in biochemical models. Although subcellular locations can be abstractly represented via -compartments in the SBML core specifica-tions, spatial enables the encoding of +compartments in the SBML core specifications, \code{spatial} enables the encoding of a cellular coordinate system which can describe non-uniform molecular distributions, -diffusive transport, and spatially localized reactions. The Geometry class holds -the spatial information and the extended Species, Reaction, Compartment, and -Parameter objects have mappings to the spatial objects that hold information on -molecular transport coefficients, geometric domains, and coordinates. Spatial is -therefore able to store the geometric information commonly used in spatial modeling -tools for the biochemical entities from standard SBML. - -\begin{figure}[hb] - \centering - \vspace*{2ex} - \includegraphics[width=\textwidth]{../../../extensions/spatial/doc/img/type_hierarchy.pdf} - \caption[The spatial processes extension]{} +diffusive transport, and spatially localized reactions. The \code{Geometry} class holds +the spatial information and the extended \code{Species}, \code{Reaction}, \code{Compartment}, and +\code{Parameter} objects have mappings to the \code{spatial} objects that hold information on +molecular transport coefficients, geometric domains, and coordinates. \code{Spatial} is +therefore able to store the geometric information commonly used in spatial modelling +tools for the biochemical entities from standard SBML.} \label{fig:spatial} \end{figure} - -\section{Groups Package} -\label{sec:groups-overview} -The other draft extension that is fully supported by JSBML is groups. -This a small extension links together elements in an SBML model. Coupling -groups information with annotation and SBO terms (Courtot et al., 2011) -contextualizes these sets of objects for properly conveying roles of groups -for other programmers and modelers. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/groups/doc/img/type_hierarchy.pdf} - \caption[The groups extension]{} + \caption[Class diagram of the groups extension]{Class diagram of the groups extension. \code{Groups} is a simple extension that links together elements in an SBML model. Coupling +\code{groups} information with annotation and SBO terms \cite{Courtot2011a} +contextualizes these sets of objects for properly conveying roles of groups +for other programmers and modellers.} \label{fig:groups} \end{figure} -\section{Arrays Package} -\label{sec:arrays-overview} -Arrays (arrays, Watanabe et al., 2013) extends SBML variables to include arrays of values, -thereby representing repeated or regular model structures more efficiently. -Arrays provides the ability to access sets of values with indices instead of explicit -declaration and creation of sub-data objects. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/arrays/doc/img/type_hierarchy.pdf} - \caption[The arrays extension]{} + \caption[Class diagram of the arrays extension]{Class diagram of the arrays extension. Arrays (\code{arrays}, \cite{Watanabe2013}) extends SBML variables to include arrays of values, +thereby representing repeated or regular model structures more efficiently. +\code{Arrays} provides the ability to access sets of values with indices instead of explicit +declaration and creation of sub-data objects.} \label{fig:arrays} \end{figure} -\section{Required Elements Package} -\label{sec:req-overview} -Required Elements (req, Smith and Hucka, 2013) allows a model to indicate which -components have had their mathematical meanings changed by (e.g.) the use of -another SBML package. \begin{figure}[hb] \centering \vspace*{2ex} - \includegraphics[width=\textwidth]{../../../extensions/req/doc/img/type_hierarchy.pdf} - \caption[The arrays extension]{} + \includegraphics[width=.5\textwidth]{../../../extensions/req/doc/img/type_hierarchy.pdf} + \caption[Class diagram of the required elements extension]{Class diagram of the required elements extension. Required Elements (\code{req}, \cite{Smith2013}) allows a model to indicate which +components have had their mathematical meanings changed by (e.g.) the use of +another SBML package.} \label{fig:arrays} \end{figure} -\section{Distributions Package} -\label{sec:distrib-overview} -Distributions (distrib, Moodie and Smith, 2013) encodes -statistical distributions and their sampling. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/distrib/doc/img/type_hierarchy.pdf} - \caption[The distributions extension]{} + \caption[Class diagram of the distributions extension.]{ Class diagram of the distributions extension. Distributions + (\code{distrib}, \cite{Moodie2013}) encodes statistical distributions and their sampling.} \label{fig:distrib} \end{figure} - -\section{Dynamic Structures Package} -\label{sec:dyn-overview} -Dynamic Structures (dyn, Gomez et al., 2014), supports the definition -of dynamical behaviors for model entities. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/dyn/doc/img/type_hierarchy.pdf} - \caption[The dynamic structures extension]{} + \caption[Class diagram of the dynamic structures extension]{Class diagram of the dynamic structures extension. Dynamic Structures (\code{dyn}, \cite{Gomez2014}), supports the definition of dynamical behaviors for model entities. +} \label{fig:dyn} \end{figure} -\section{Rendering Package} -\label{sec:render-overview} -Rendering (render, Gauges et al., 2011) couples with Layout to provide -symbol and style information for network diagrams. - \begin{figure}[hb] \centering \vspace*{2ex} \includegraphics[width=\textwidth]{../../../extensions/render/doc/img/type_hierarchy.pdf} - \caption[The rendering extension]{} + \caption[Class diagram of the rendering extension.]{Class diagram of the rendering extension. Rendering (\code{render}, \cite{gauges2006}) couples with \cite{Layout} to provide symbol and style information for network diagrams.} \label{fig:render} \end{figure} + + Modified: trunk/core/doc/user_guide/JSBML_hello_world_examples.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_hello_world_examples.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/JSBML_hello_world_examples.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -53,7 +53,7 @@ third-party libraries. \begin{figure}[ht] - \exampleFile{src/JSBMLvisualizer.java} + \exampleFile{src/org/sbml/jsbml/gui/JSBMLvisualizer.java} \caption{Parsing and visualizing the content of an SBML file.} \label{fig:JSBMLvisualizer-source} \index{graphical user interface!\code{JFrame}} @@ -123,7 +123,7 @@ \begin{figure}[bht] \vspace*{-1ex} - \exampleFile{src/JSBMLexample.java} + \exampleFile{src/org/sbml/jsbml/demo/JSBMLexample.java} \vspace*{-1.5ex} \caption{Creating a new \code{SBMLDocument} object and writing its content into a file.} Modified: trunk/core/doc/user_guide/User_Guide.tex =================================================================== --- trunk/core/doc/user_guide/User_Guide.tex 2015-08-26 08:51:07 UTC (rev 2355) +++ trunk/core/doc/user_guide/User_Guide.tex 2015-08-28 00:19:09 UTC (rev 2356) @@ -135,8 +135,7 @@ \input{JSBML_compared_to_libSBML} \input{JSBML_howto_write_extensions} - - +\input{JSBML_extensions_overview} \chapter{Acknowledgments} \label{chp:acknowledgements} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-08-26 08:51:10
|
Revision: 2355 http://sourceforge.net/p/jsbml/code/2355 Author: niko-rodrigue Date: 2015-08-26 08:51:07 +0000 (Wed, 26 Aug 2015) Log Message: ----------- added a new formula parser for COBRA style formula: CobraFormulaParser Added Paths: ----------- trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserConstants.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserTokenManager.java Added: trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java (rev 0) +++ trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java 2015-08-26 08:51:07 UTC (rev 2355) @@ -0,0 +1,1687 @@ +/* Generated By:JavaCC: Do not edit this line. CobraFormulaParser.java */ +/* + * $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. + * + * Copyright (C) 2009-2015 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 + * + * 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.text.parser; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.InvalidPropertiesFormatException; +import java.util.Properties; +import org.sbml.jsbml.ASTNode; +import org.sbml.jsbml.ASTNode.Type; +import org.sbml.jsbml.resources.Resource; +import org.sbml.jsbml.text.parser.IFormulaParser; + +/** + * Class used to parse infix mathematical formula written by the COBRA toolbox + * and returns a representation of it as an Abstract Syntax Tree (AST). Here is an example of such formula: + * "(8639_AT1) || (26_AT1) || (314_AT2) || (314_AT1)". + * <p> + * Support almost the same syntax as defined in <a href="http://sbml.org/Software/libSBML/docs/java-api/org/sbml/libsbml/libsbml.html#parseL3Formula(java.lang.String)"> + * the LibSBML L3 parser</a>. + * <p>One of the main differences is that ID are allowed to start by a number so that ID like that '8639_AT1' are recognised as ID. + * + * <p>The things not supported for now are the units associated with numbers. + * + * <p> + * Parsing of the various MathML functions and constants are all + * case-sensitive by default: names such as + * <code>Cos</code> and <code>COS</code> are not parsed as the MathML cosine + * operator, <code><cos></code>. + * + * <p> You can change this behaviour by using the {@link #setCaseSensitive(boolean)} + * method. + * + * + * <p> + * <table border="0" width="95%" + class="centered text-table normal-font alt-row-colors" + style="padding-bottom: 0.5em"> + <tr style="background: lightgray; font-size: 14px;"> + <th align="left">Token</th> + <th align="left">Operation</th> + <th align="left">Class</th> + <th>Precedence</th> + <th align="left">Associates</th> + </tr> +<tr><td><em>name</em></td><td>symbol reference</td><td>operand</td><td align="center">8</td><td>n/a</td></tr> +<tr><td><code>(</code><em>expression</em><code>)</code></td><td>expression grouping</td><td>operand</td><td align="center">8</td><td>n/a</td></tr> +<tr><td><code>f(</code><em>...</em><code>)</code></td><td>function call</td><td>prefix</td><td align="center">8</td><td>left</td></tr> +<tr><td><code>^</code></td><td>power</td><td>binary</td><td align="center">7</td><td>left</td></tr> +<tr><td><code>-, !</code></td><td>negation and boolean 'not'</td><td>unary</td><td align="center">6</td><td>right</td></tr> +<tr><td><code>*, /, %</code></td><td>multiplication, division, and modulo</td><td>binary</td><td align="center">5</td><td>left</td></tr> +<tr><td><code>+, -</code></td><td>addition and subtraction</td><td>binary</td><td align="center">4</td><td>left</td></tr> +<tr><td><code>==, <, >, <=, >=, !=</code></td><td>boolean equality, inequality, and comparison</td><td>binary</td><td align="center">3</td><td>left</td></tr> +<tr><td><code>&&, ||</code></td><td>boolean 'and' and 'or'</td><td>binary</td><td align="center">2</td><td>left</td></tr> +<tr><td><code>,</code></td><td>argument delimiter</td><td>binary</td><td align="center">1</td><td>left</td></tr> + +<caption class="top-caption">Expression operators and their precedence in the + text-string format for mathematical expressions. +</caption> +</table> + + + <p> + * In the table above, <em>operand</em> implies the construct is an operand, + * <em>prefix</em> implies the operation is applied to the following arguments, + * <em>unary</em> implies there is one argument, and <em>binary</em> implies there are + * two arguments. The values in the <b>Precedence</b> column show how the + * order of different types of operation are determined. For example, the + * expression <code>a + b * c</code> is evaluated as <code>a + (b * c)</code> + * because the @c * operator has higher precedence. The + * <b>Associates</b> column shows how the order of similar precedence + * operations is determined; for example, <code>a && b || c</code> is + * evaluated as <code>(a && b) || c</code> because the <code>&&</code> and <code>||</code> + * operators are left-associative and have the same precedence. + <p> + * The function call syntax consists of a function name, followed by an opening parenthesis token, + * followed by a sequence of zero or more arguments separated by commas (with each comma + * optionally preceded and/or followed by zero or more white space + * characters), followed by a closing parenthesis token. The function name + * must be chosen from one of the pre-defined functions in SBML or a + * user-defined function in the model. The following table lists the names + * of certain common mathematical functions; this table corresponds to + * Table 6 in the <a target='_blank' + * href='http://sbml.org/Documents/Specifications#SBML_Level_1_Version_2'>SBML + * Level 1 Version 2 specification</a> with additions based on the + * functions added in SBML Level 2 and Level 3: + <p> + + * <table border="0" width="95%" + class="centered text-table normal-font alt-row-colors"> + <tr> + <th align="left" width="60">Name</th> + <th align="left" width="75">Argument(s)</th> + <th align="left">Formula or meaning</th> + <th align="left" width="90">Argument Constraints</th> + <th align="left" width="90">Result constraints</th> + </tr> +<tr><td><code>abs</code></td> + <td><em>x</em></td> + <td>Absolute value of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acos</code>, <code>arccos</code></td> + <td><em>x</em></td> + <td>Arccosine of <em>x</em> in radians.</td> + <td>–1.0 ≤ <em>x</em> ≤ 1.0</td> + <td>0 ≤ <em>acos(x)</em> ≤ π</td> +</tr> +<tr><td><code>acosh</code>, <code>arccosh</code></td> + <td><em>x</em></td> + <td>Hyperbolic arccosine of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acot</code>, <code>arccot</code></td> + <td><em>x</em></td> + <td>Arccotangent of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acoth</code>, <code>arccoth</code></td> + <td><em>x</em></td> + <td>Hyperbolic arccotangent of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acsc</code>, <code>arccsc</code></td> + <td><em>x</em></td> + <td>Arccosecant of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acsch</code>, <code>arccsch</code></td> + <td><em>x</em></td> + <td>Hyperbolic arccosecant of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>asec</code>, <code>arcsec</code></td> + <td><em>x</em></td> + <td>Arcsecant of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>asech</code>, <code>arcsech</code></td> + <td><em>x</em></td> + <td>Hyperbolic arcsecant of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>asin</code>, <code>arcsin</code></td> + <td><em>x</em></td><td>Arcsine of <em>x</em> in radians.</td> + <td>–1.0 ≤ <em>x</em> ≤ 1.0</td> + <td>0 ≤ <em>asin(x)</em> ≤ π</td> +</tr> +<tr><td><code>atan</code>, <code>arctan</code></td> + <td><em>x</em></td> + <td>Arctangent of <em>x</em> in radians.</td> + <td></td> + <td>0 ≤ <em>atan(x)</em> ≤ π</td> +</tr> +<tr><td><code>atanh</code>, <code>arctanh</code></td> + <td><em>x</em></td> + <td>Hyperbolic arctangent of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>ceil</code>, <code>ceiling</code></td> + <td><em>x</em></td> + <td>Smallest number not less than <em>x</em> whose value is an exact integer.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>cos</code></td> + <td><em>x</em></td> + <td>Cosine of <em>x</em></td> + <td></td> + <td></td> +</tr> +<tr><td><code>cosh</code></td> + <td><em>x</em></td> + <td>Hyperbolic cosine of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>cot</code></td> + <td><em>x</em></td> + <td>Cotangent of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>coth</code></td> + <td><em>x</em></td> + <td>Hyperbolic cotangent of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>csc</code></td> + <td><em>x</em></td> + <td>Cosecant of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>csch</code></td> + <td><em>x</em></td> + <td>Hyperbolic cosecant of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>delay</code></td> + <td><em>x, y</em></td> + <td>The value of <em>x</em> at <em>y</em> time units in the past.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>factorial</code></td> + <td><em>n</em></td> + <td>The factorial of <em>n</em>. Factorials are defined by <em>n! = n*(n–1)* ... * 1</em>.</td> + <td><em>n</em> must be an integer.</td> + <td></td> +</tr> +<tr><td><code>exp</code></td> + <td><em>x</em></td> + <td><em>e</em><sup><em> x</em></sup>, where <em>e</em> is the base of the natural logarithm.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>floor</code></td> + <td><em>x</em></td> + <td>The largest number not greater than <em>x</em> whose value is an exact integer.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>ln</code></td> + <td><em>x</em></td> + <td>Natural logarithm of <em>x</em>.</td> + <td><em>x</em> > 0</td> + <td></td> +</tr> +<tr><td><code>log</code></td> + <td><em>x</em></td> + <td>By default, the base 10 logarithm of <em>x</em>, but can be set to be the natural logarithm of <em>x</em>, or to be an illegal construct.</td> + <td><em>x</em> > 0</td> + <td></td> +</tr> +<tr><td><code>log</code></td> + <td><em>x, y</em></td> + <td>The base <em>x</em> logarithm of <em>y</em>.</td> + <td><em>y</em> > 0</td> + <td></td> +</tr> +<tr><td><code>log10</code></td> + <td><em>x</em></td> + <td>Base 10 logarithm of <em>x</em>.</td> + <td><em>x</em> > 0</td> + <td></td> +</tr> +<tr><td><code>piecewise</code></td> + <td><em>x1, y1, [x2, y2,] [...] [z]</em></td> + <td>A piecewise function: if (<em>y1</em>), <em>x1</em>. Otherwise, if (<em>y2</em>), <em>x2</em>, etc. Otherwise, z. </td> + <td><em>y1, y2, y3 [etc]</em> must be boolean</td> + <td></td> +</tr> +<tr><td><code>pow</code>, <code>power</code> </td> + <td><em>x, y</em></td> + <td><em>x</em><sup><em> y</em></sup>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>root</code></td> + <td><em>b, x</em></td> + <td>The root base <em>b</em> of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>sec</code></td> + <td><em>x</em></td> + <td>Secant of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>sech</code></td> + <td><em>x</em></td> + <td>Hyperbolic secant of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>sqr</code></td> + <td><em>x</em></td> + <td><em>x</em><sup><em>2</em></sup>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>sqrt</code></td> + <td><em>x</em></td> + <td>√<em>x</em>.</td> + <td><em>x</em> > 0</td> + <td><em>sqrt(x)</em> ≥ 0</td> +</tr> +<tr><td><code>sin</code></td> + <td><em>x</em></td> + <td>Sine of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>sinh</code></td> + <td><em>x</em></td> + <td>Hyperbolic sine of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>tan</code></td> + <td><em>x</em></td> + <td>Tangent of <em>x</em>.</td> + <td>x ≠ n*π/2, for odd integer <em>n</em></td> + <td></td> +</tr> +<tr><td><code>tanh</code></td> + <td><em>x</em></td> + <td>Hyperbolic tangent of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>and</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>and(x, y, z...)</em>: returns <code>true</code> if all of its arguments are true. Note that <code>and</code> is an n-ary function, taking 0 or more arguments, and that <code>and()</code> returns <code>true</code>.</td> + <td>All arguments must be boolean</td> + <td></td> +</tr> +<tr><td><code>not</code></td> + <td><em>x</em></td> + <td>Boolean <em>not(x)</em></td> + <td><em>x</em> must be boolean</td> + <td></td> +</tr> +<tr><td><code>or</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>or(x, y, z...)</em>: returns <code>true</code> if at least one of its arguments is true. Note that <code>or</code> is an n-ary function, taking 0 or more arguments, and that <code>or()</code> returns <code>false</code>.</td> + <td>All arguments must be boolean</td> + <td></td> +</tr> +<tr><td><code>xor</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>xor(x, y, z...)</em>: returns <code>true</code> if an odd number of its arguments is true. Note that <code>xor</code> is an n-ary function, taking 0 or more arguments, and that <code>xor()</code> returns <code>false</code>.</td> + <td>All arguments must be boolean</td> + <td></td> +</tr> +<tr><td><code>eq</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>eq(x, y, z...)</em>: returns <code>true</code> if all arguments are equal. Note that <code>eq</code> is an n-ary function, but must take 2 or more arguments.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>geq</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>geq(x, y, z...)</em>: returns <code>true</code> if each argument is greater than or equal to the argument following it. Note that <code>geq</code> is an n-ary function, but must take 2 or more arguments.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>gt</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>gt(x, y, z...)</em>: returns <code>true</code> if each argument is greater than the argument following it. Note that <code>gt</code> is an n-ary function, but must take 2 or more arguments.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>leq</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>leq(x, y, z...)</em>: returns <code>true</code> if each argument is less than or equal to the argument following it. Note that <code>leq</code> is an n-ary function, but must take 2 or more arguments.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>lt</code></td> + <td><em>x, y, z...</em></td> + <td>Boolean <em>lt(x, y, z...)</em>: returns <code>true</code> if each argument is less than the argument following it. Note that <code>lt</code> is an n-ary function, but must take 2 or more arguments.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>neq</code></td> + <td><em>x, y</em></td> + <td>Boolean <em>x</em> != <em>y</em>: returns <code>true</code> unless x and y are equal.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>plus</code></td> + <td><em>x, y, z...</em></td> + <td><em>x</em> + <em>y</em> + <em>z</em> + <em>...</em>: The sum of the arguments of the function. Note that <code>plus</code> is an n-ary function taking 0 or more arguments, and that <code>plus()</code> returns <code>0</code>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>times</code></td> + <td><em>x, y, z...</em></td> + <td><em>x</em> * <em>y</em> * <em>z</em> * <em>...</em>: The product of the arguments of the function. Note that <code>times</code> is an n-ary function taking 0 or more arguments, and that <code>times()</code> returns <code>1</code>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>minus</code></td> + <td><em>x, y</em></td> + <td><em>x</em> – <em>y</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>divide</code></td> + <td><em>x, y</em></td> + <td><em>x</em> / <em>y</em>.</td> + <td></td> + <td></td> +</tr> + +<caption class="top-caption">Mathematical functions defined +in the text-string formula syntax.</caption> + +</table> + + + * + * + * + * @author Alexander Dörr + * @author Nicolas Rodriguez + * @since 1.0 + * @version $Rev$ + */ +public class CobraFormulaParser implements IFormulaParser, CobraFormulaParserConstants { + + public static Properties stringToType = new Properties(); + + private boolean ignoreCase = false; + + + static + { + String path = "cfg/ASTNodeTokens.xml"; + try + { + stringToType.loadFromXML(Resource.class.getResourceAsStream(path)); + } + catch (InvalidPropertiesFormatException e) + { + throw new RuntimeException("Invalid configuration file entries in file " + Resource.class.getResource(path), e); + } + catch (IOException e) + { + throw new RuntimeException("Could not read configuration file " + Resource.class.getResource(path), e); + } + } + + /** + * Sets the case sensitivity of the parser, for the mathml elements. + * + * <p>The default behavior is to be case sensitive, meaning + * '{@code cos}' would be recognized as the mathematical <a href="http://www.w3.org/TR/MathML2/chapter4.html#contm.trig">cosinus</a> but + * '{@code Cos}', '{@code cOs}' or any other alternatives would be recognized + * as a name and read as a 'ci' element. If you pass {@code false} to this method + * all the different versions of {@code cos} would be recognized as the mathematical + * <a href="http://www.w3.org/TR/MathML2/chapter4.html#contm.trig">cosinus</a>. + * + * @param caseSensitive boolean to define if the parser should be case sensitive or not. + */ + public void setCaseSensitive(boolean caseSensitive) + { + this.ignoreCase = !caseSensitive; + } + + private void checkSize(ArrayList < ASTNode > arguments, int i) throws ParseException + { + if (arguments.size() > i) + { + throw new ParseException(); + } + } + + private Integer getInteger(ASTNode node) + { + if (node.isUMinus()) + { + if (node.getChild(0).isInteger()) + { + return - node.getChild(0).getInteger(); + } + else + { + return null; + } + } + else + { + if (node.isInteger()) + { + return node.getInteger(); + } + else + { + return null; + } + } + } + +/** + * Returns a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. + * + * <p/> The formula produced for 'a % b' or modulo(a, b) is 'piecewise(floor(a/b), gt(a/b, 0), ceil(a/b))' + * + * @param leftChild + * @param rightChild + * @return a piecewise {@link ASTNode} representing the modulo operation between the left and right child given. + * @see http://sbml.org/Documents/FAQ#Why_can.27t_I_use_the_.3Crem.3E_operator_in_SBML_MathML.3F + */ + private ASTNode createModulo(ASTNode leftChild, ASTNode rightChild) + { + ASTNode node = new ASTNode(ASTNode.Type.FUNCTION_PIECEWISE); + + ASTNode floorNode = new ASTNode(ASTNode.Type.FUNCTION_FLOOR); + ASTNode aDividedByB = new ASTNode(ASTNode.Type.DIVIDE); + aDividedByB.addChild(leftChild); + aDividedByB.addChild(rightChild); + + floorNode.addChild(aDividedByB); + node.addChild(floorNode); + + ASTNode greaterThan = new ASTNode(ASTNode.Type.RELATIONAL_GT); + greaterThan.addChild(aDividedByB.clone()); + greaterThan.addChild(new ASTNode(0)); + + node.addChild(greaterThan); + + ASTNode ceilNode = new ASTNode(ASTNode.Type.FUNCTION_CEILING); + ceilNode.addChild(aDividedByB.clone()); + + node.addChild(ceilNode); + + return node; + } + + final public Token string() throws ParseException { + Token t; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LOG: + t = jj_consume_token(LOG); + break; + case STRING: + t = jj_consume_token(STRING); + break; + default: + jj_la1[0] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return t;} + throw new Error("Missing return statement in function"); + } + + final public ASTNode parse() throws ParseException { + ASTNode node = null; + node = expression(); + {if (true) return node;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode expression() throws ParseException { + ASTNode value = null; + value = termLevel2(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 0: + jj_consume_token(0); + break; + case EOL: + jj_consume_token(EOL); + break; + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return value;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel2() throws ParseException { + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + Token t; + leftChild = termLevel3(); + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN_LOGIC: + ; + break; + default: + jj_la1[2] = jj_gen; + break label_1; + } + t = jj_consume_token(BOOLEAN_LOGIC); + rightChild = termLevel3(); + // TODO - do we want to ignore the case for those cases ? + String s = t.image; + Type type = null; + + if (s.equalsIgnoreCase("or") || s.equalsIgnoreCase("||")) + { + type = ASTNode.Type.LOGICAL_OR; + } + else if (s.equalsIgnoreCase("and") || s.equalsIgnoreCase("&&")) + { + type = ASTNode.Type.LOGICAL_AND; + } + else if (s.equalsIgnoreCase("xor")) + { + type = ASTNode.Type.LOGICAL_XOR; + } + node = new ASTNode(type); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + } + {if (true) return leftChild;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel3() throws ParseException { + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + Token t; + leftChild = termLevel4(); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMPARISON: + ; + break; + default: + jj_la1[3] = jj_gen; + break label_2; + } + t = jj_consume_token(COMPARISON); + rightChild = termLevel4(); + String s = t.image; + Type type = null; + + if (s.equalsIgnoreCase("<")) + { + type = ASTNode.Type.RELATIONAL_LT; + } + else if (s.equalsIgnoreCase(">")) + { + type = ASTNode.Type.RELATIONAL_GT; + } + else if (s.equalsIgnoreCase("==")) + { + type = ASTNode.Type.RELATIONAL_EQ; + } + else if (s.equalsIgnoreCase("!=")) + { + type = ASTNode.Type.RELATIONAL_NEQ; + } + else if (s.equalsIgnoreCase(">=")) + { + type = ASTNode.Type.RELATIONAL_GEQ; + } + else if (s.equalsIgnoreCase("<=")) + { + type = ASTNode.Type.RELATIONAL_LEQ; + } + node = new ASTNode(type); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + } + {if (true) return leftChild;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel4() throws ParseException { + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + leftChild = termLevel5(); + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + case MINUS: + ; + break; + default: + jj_la1[4] = jj_gen; + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + rightChild = termLevel5(); + node = new ASTNode('+'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + case MINUS: + jj_consume_token(MINUS); + rightChild = termLevel5(); + node = new ASTNode('-'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + default: + jj_la1[5] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return leftChild;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel5() throws ParseException { + ASTNode rightChild = null; + ASTNode leftChild; + ASTNode node = null; + leftChild = termLevel6(); + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TIMES: + case DIVIDE: + case MODULO: + ; + break; + default: + jj_la1[6] = jj_gen; + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TIMES: + jj_consume_token(TIMES); + rightChild = termLevel6(); + node = new ASTNode('*'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + break; + case DIVIDE: + jj_consume_token(DIVIDE); + rightChild = termLevel6(); + Integer left, right; + left = getInteger(leftChild); + right = getInteger(rightChild); + // TODO - check if libsbml behave the same way + if (left != null && right != null) // Node transformed into a ASTNode.Type.RATIONAL number if both left and right are integer + { + node = new ASTNode(); + node.setValue(left, right); + leftChild = node; + } + else + { + node = new ASTNode('/'); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + } + break; + case MODULO: + jj_consume_token(MODULO); + rightChild = termLevel6(); + node = createModulo(leftChild, rightChild); + leftChild = node; + break; + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return leftChild;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel6() throws ParseException { + ASTNode node = null; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case MINUS: + jj_consume_token(MINUS); + node = termLevel7(); + ASTNode uiMinus = new ASTNode('-'); + uiMinus.addChild(node); + {if (true) return uiMinus;} + break; + case NOT: + jj_consume_token(NOT); + node = termLevel7(); + ASTNode not = new ASTNode(Type.LOGICAL_NOT); + not.addChild(node); + {if (true) return not;} + break; + case INTEGER: + case NUMBER: + case EXPNUMBER: + case OPEN_PAR: + case LEFT_BRACES: + case LOG: + case STRING: + node = termLevel7(); + {if (true) return node;} + break; + default: + jj_la1[8] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel7() throws ParseException { + ASTNode rightChild; + ASTNode leftChild; + ASTNode node = null; + leftChild = termLevel8(); + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case POWER: + ; + break; + default: + jj_la1[9] = jj_gen; + break label_5; + } + jj_consume_token(POWER); + rightChild = termLevel8(); + node = new ASTNode(Type.POWER); + node.addChild(leftChild); + node.addChild(rightChild); + leftChild = node; + } + {if (true) return leftChild;} + throw new Error("Missing return statement in function"); + } + + final private ASTNode termLevel8() throws ParseException, NumberFormatException { + Token t; + double d; + int i; + ASTNode node = new ASTNode(); + ASTNode vector = null; + ASTNode child, furtherChild; + String s; + String vals [ ]; + ArrayList < ASTNode > arguments = new ArrayList < ASTNode > (); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INTEGER: + t = jj_consume_token(INTEGER); + i = Integer.parseInt(t.image); // Could use StringTools.parseXXX methods here but not doing so allow to support different locale ?? + node.setValue(i); + {if (true) return node;} + break; + case NUMBER: + t = jj_consume_token(NUMBER); + d = Double.parseDouble(t.image); + node.setValue(d); + {if (true) return node;} + break; + case EXPNUMBER: + t = jj_consume_token(EXPNUMBER); + s = t.image; + vals = s.toLowerCase().split("e"); + if (vals [ 1 ].startsWith("+")) + { + i = Integer.parseInt(vals [ 1 ].substring(1)); + } + else + { + i = Integer.parseInt(vals [ 1 ]); + } + node.setValue(Double.parseDouble(vals [ 0 ]), i); + {if (true) return node;} + break; + default: + jj_la1[14] = jj_gen; + if (jj_2_1(2)) { + t = string(); + jj_consume_token(OPEN_PAR); + child = termLevel2(); + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SPLITTER: + ; + break; + default: + jj_la1[10] = jj_gen; + break label_6; + } + jj_consume_token(SPLITTER); + furtherChild = termLevel2(); + arguments.add(furtherChild); + } + jj_consume_token(CLOSE_PAR); + s = t.image; + Type type = null; + if (ignoreCase) + { + s = s.toLowerCase(); + } + if (stringToType.containsKey(s)) + { + type = ASTNode.Type.valueOf(stringToType.getProperty(s.toLowerCase()).toUpperCase()); + } + if (s.equals("pow") || s.equals("power")) + { + checkSize(arguments, 1); + node.addChild(child); + } + else if (s.equals("sqr")) + { + checkSize(arguments, 0); + node.addChild(child); + node.addChild(new ASTNode(2)); + } + else if (s.equals("sqrt")) + { + checkSize(arguments, 0); + node.addChild(new ASTNode(2)); + node.addChild(child); + } + else if (s.equals("not")) + { + checkSize(arguments, 0); + node.addChild(child); + type = Type.LOGICAL_NOT; + } + else if (s.equals("ln")) + { + checkSize(arguments, 0); + node.addChild(child); + type = Type.FUNCTION_LN; + } + else if (s.equals("lambda")) + { + node.addChild(child); + type = Type.LAMBDA; + } + else if (s.equals("piecewise")) + { + node.addChild(child); + type = Type.FUNCTION_PIECEWISE; + } + else if (s.equals("modulo") || s.equals("mod")) + { + checkSize(arguments, 1); + ASTNode rightChild = arguments.get(0); + arguments.clear(); + node = createModulo(child, rightChild); + {if (true) return node;} + } + else + { + node.addChild(child); + } + if (type != null) + { + node.setType(type); + // TODO - should we set the name of the ASTNode for FUNCTION, ... + } + else + { + node.setName(s); + } + for (ASTNode argument : arguments) + { + node.addChild(argument); + } + {if (true) return node;} + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case OPEN_PAR: + jj_consume_token(OPEN_PAR); + node = termLevel2(); + jj_consume_token(CLOSE_PAR); + {if (true) return node;} + break; + default: + jj_la1[15] = jj_gen; + if (jj_2_2(4)) { + t = jj_consume_token(STRING); + ASTNode selector = new ASTNode(); + selector.setType(ASTNode.Type.FUNCTION_SELECTOR); + selector.addChild(new ASTNode(t.image)); + label_7: + while (true) { + jj_consume_token(LEFT_BRACKET); + node = termLevel2(); + selector.addChild(node); + jj_consume_token(RIGHT_BRACKET); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LEFT_BRACKET: + ; + break; + default: + jj_la1[11] = jj_gen; + break label_7; + } + } + {if (true) return selector;} + } else if (jj_2_3(2)) { + jj_consume_token(LEFT_BRACES); + node = termLevel2(); + ASTNode selector = new ASTNode(); + vector = new ASTNode(); + boolean isSelector = false; + selector.setType(ASTNode.Type.FUNCTION_SELECTOR); + vector.setType(ASTNode.Type.VECTOR); + vector.addChild(node); + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SPLITTER: + ; + break; + default: + jj_la1[12] = jj_gen; + break label_8; + } + jj_consume_token(SPLITTER); + node = termLevel2(); + vector.addChild(node); + } + jj_consume_token(RIGHT_BRACES); + selector.addChild(vector); + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LEFT_BRACKET: + ; + break; + default: + jj_la1[13] = jj_gen; + break label_9; + } + jj_consume_token(LEFT_BRACKET); + node = termLevel2(); + isSelector = true; + selector.addChild(node); + jj_consume_token(RIGHT_BRACKET); + } + {if (true) return isSelector ? selector : vector;} + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LEFT_BRACES: + jj_consume_token(LEFT_BRACES); + vector = new ASTNode(); + vector.setType(ASTNode.Type.VECTOR); + jj_consume_token(RIGHT_BRACES); + {if (true) return vector;} + break; + case STRING: + t = jj_consume_token(STRING); + s = t.image; + if (ignoreCase) + { + s = s.toLowerCase(); + } + // TODO - should we set the name of the ASTNode + if (s.equalsIgnoreCase("true")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.CONSTANT_TRUE); + } + else if (s.equalsIgnoreCase("false")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.CONSTANT_FALSE); + } + else if (s.equals("pi")) + { + node = new ASTNode(Type.CONSTANT_PI); + } + else if (s.equals("avogadro")) + { + node = new ASTNode(Type.NAME_AVOGADRO); + } + else if (s.equals("time")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Type.NAME_TIME); + } + else if (s.equals("exponentiale")) + { + node = new ASTNode(Type.CONSTANT_E); + } + else if (s.equals("-infinity") || s.equals("-INF")) + { + node = new ASTNode(Double.NEGATIVE_INFINITY); + } + else if (s.equals("infinity") || s.equals("INF")) + { + node = new ASTNode(Double.POSITIVE_INFINITY); + } + else if (s.equals("NotANumber") || s.equals("NaN")) // TODO - do we want to ignore the case for those ? + { + node = new ASTNode(Double.NaN); + } + else + { + node = new ASTNode(s); + } + {if (true) return node;} + break; + default: + jj_la1[16] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + } + throw new Error("Missing return statement in function"); + } + + private boolean jj_2_1(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + private boolean jj_2_2(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + private boolean jj_2_3(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + private boolean jj_3R_19() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_23()) { + jj_scanpos = xsp; + if (jj_3R_24()) { + jj_scanpos = xsp; + if (jj_3R_25()) return true; + } + } + return false; + } + + private boolean jj_3R_23() { + if (jj_scan_token(MINUS)) return true; + if (jj_3R_29()) return true; + return false; + } + + private boolean jj_3R_11() { + if (jj_scan_token(LEFT_BRACKET)) return true; + if (jj_3R_12()) return true; + if (jj_scan_token(RIGHT_BRACKET)) return true; + return false; + } + + private boolean jj_3R_36() { + if (jj_scan_token(LEFT_BRACES)) return true; + if (jj_scan_token(RIGHT_BRACES)) return true; + return false; + } + + private boolean jj_3_1() { + if (jj_3R_10()) return true; + if (jj_scan_token(OPEN_PAR)) return true; + return false; + } + + private boolean jj_3R_28() { + if (jj_scan_token(MODULO)) return true; + return false; + } + + private boolean jj_3_2() { + if (jj_scan_token(STRING)) return true; + Token xsp; + if (jj_3R_11()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_11()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_22() { + if (jj_scan_token(MINUS)) return true; + return false; + } + + private boolean jj_3R_31() { + if (jj_scan_token(POWER)) return true; + return false; + } + + private boolean jj_3R_35() { + if (jj_scan_token(OPEN_PAR)) return true; + if (jj_3R_12()) return true; + return false; + } + + private boolean jj_3R_14() { + if (jj_scan_token(BOOLEAN_LOGIC)) return true; + return false; + } + + private boolean jj_3R_29() { + if (jj_3R_30()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_31()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_12() { + if (jj_3R_13()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_14()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_18() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_21()) { + jj_scanpos = xsp; + if (jj_3R_22()) return true; + } + return false; + } + + private boolean jj_3R_21() { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_16() { + if (jj_scan_token(COMPARISON)) return true; + return false; + } + + private boolean jj_3R_15() { + if (jj_3R_17()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_18()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_34() { + if (jj_scan_token(EXPNUMBER)) return true; + return false; + } + + private boolean jj_3R_13() { + if (jj_3R_15()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_16()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_33() { + if (jj_scan_token(NUMBER)) return true; + return false; + } + + private boolean jj_3R_27() { + if (jj_scan_token(DIVIDE)) return true; + return false; + } + + private boolean jj_3R_25() { + if (jj_3R_29()) return true; + return false; + } + + private boolean jj_3R_10() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(26)) { + jj_scanpos = xsp; + if (jj_scan_token(27)) return true; + } + return false; + } + + private boolean jj_3R_32() { + if (jj_scan_token(INTEGER)) return true; + return false; + } + + private boolean jj_3R_30() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_32()) { + jj_scanpos = xsp; + if (jj_3R_33()) { + jj_scanpos = xsp; + if (jj_3R_34()) { + jj_scanpos = xsp; + if (jj_3_1()) { + jj_scanpos = xsp; + if (jj_3R_35()) { + jj_scanpos = xsp; + if (jj_3_2()) { + jj_scanpos = xsp; + if (jj_3_3()) { + jj_scanpos = xsp; + if (jj_3R_36()) { + jj_scanpos = xsp; + if (jj_3R_37()) return true; + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3_3() { + if (jj_scan_token(LEFT_BRACES)) return true; + if (jj_3R_12()) return true; + return false; + } + + private boolean jj_3R_26() { + if (jj_scan_token(TIMES)) return true; + return false; + } + + private boolean jj_3R_24() { + if (jj_scan_token(NOT)) return true; + if (jj_3R_29()) return true; + return false; + } + + private boolean jj_3R_20() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_26()) { + jj_scanpos = xsp; + if (jj_3R_27()) { + jj_scanpos = xsp; + if (jj_3R_28()) return true; + } + } + return false; + } + + private boolean jj_3R_37() { + if (jj_scan_token(STRING)) return true; + return false; + } + + private boolean jj_3R_17() { + if (jj_3R_19()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_20()) { jj_scanpos = xsp; break; } + } + return false; + } + + /** Generated Token Manager. */ + public CobraFormulaParserTokenManager token_source; + SimpleCharStream jj_input_stream; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + private int jj_gen; + final private int[] jj_la1 = new int[17]; + static private int[] jj_la1_0; + static { + jj_la1_init_0(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0xc000000,0x40000001,0x200000,0x100000,0x500,0x500,0x3800,0x3800,0xe014468,0x200,0x80,0x40000,0x80,0x40000,0x68,0x4000,0x8010000,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[3]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with InputStream. */ + public CobraFormulaParser(java.io.InputStream stream) { + this(stream, null); + } + /** Constructor with InputStream and supplied encoding */ + public CobraFormulaParser(java.io.InputStream stream, String encoding) { + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source = new CobraFormulaParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public CobraFormulaParser(java.io.Reader stream) { + jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new CobraFormulaParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader stream) { + jj_input_stream.ReInit(stream, 1, 1); + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public CobraFormulaParser(CobraFormulaParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(CobraFormulaParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 17; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + +/** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + +/** Get the specific Token. */ + final public Token getToken(int index) { + Token t = token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + private int jj_ntk() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) return; + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); + if (oldentry.length == jj_expentry.length) { + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + continue jj_entries_loop; + } + } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[31]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 17; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1<<j)) != 0) { + la1tokens[j] = true; + } + } + } + } + for (int i = 0; i < 31; i++) { + if (la1tokens[i]) { + jj_expentry = new int[1]; + jj_expentry[0] = i; + jj_expentries.add(jj_expentry); + } + } + jj_endpos = 0; + jj_rescan_token(); + jj_add_error_token(0, 0); + int[][] exptokseq = new int[jj_expentries.size()][]; + for (int i = 0; i < jj_expentries.size(); i++) { + exptokseq[i] = jj_expentries.get(i); + } + return new ParseException(token, exptokseq, tokenImage); + } + + /** Enable tracing. */ + final public void enable_tracing() { + } + + /** Disable tracing. */ + final public void disable_tracing() { + } + + private void jj_rescan_token() { + jj_rescan = true; + for (int i = 0; i < 3; i++) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + } + } + p = p.next; + } while (p != null); + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } + +} Property changes on: trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj =================================================================== --- trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj (rev 0) +++ trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj 2015-08-26 08:51:07 UTC (rev 2355) @@ -0,0 +1,1273 @@ +/** + * JavaCC template file created by SF JavaCC plugin 1.5.17+ wizard for JavaCC 1.5.0+ + */ +options +{ + JDK_VERSION = "1.5"; + + static = false; +} + +PARSER_BEGIN(CobraFormulaParser) +/* + * $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. + * + * Copyright (C) 2009-2015 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 + * + * 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.text.parser; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.InvalidPropertiesFormatException; +import java.util.Properties; +import org.sbml.jsbml.ASTNode; +import org.sbml.jsbml.ASTNode.Type; +import org.sbml.jsbml.resources.Resource; +import org.sbml.jsbml.text.parser.IFormulaParser; + +/** + * Class used to parse infix mathematical formula written by the COBRA toolbox + * and returns a representation of it as an Abstract Syntax Tree (AST). Here is an example of such formula: + * "(8639_AT1) || (26_AT1) || (314_AT2) || (314_AT1)". + * <p> + * Support almost the same syntax as defined in <a href="http://sbml.org/Software/libSBML/docs/java-api/org/sbml/libsbml/libsbml.html#parseL3Formula(java.lang.String)"> + * the LibSBML L3 parser</a>. + * <p>One of the main differences is that ID are allowed to start by a number so that ID like that '8639_AT1' are recognised as ID. + * + * <p>The things not supported for now are the units associated with numbers. + * + * <p> + * Parsing of the various MathML functions and constants are all + * case-sensitive by default: names such as + * <code>Cos</code> and <code>COS</code> are not parsed as the MathML cosine + * operator, <code><cos></code>. + * + * <p> You can change this behaviour by using the {@link #setCaseSensitive(boolean)} + * method. + * + * + * <p> + * <table border="0" width="95%" + class="centered text-table normal-font alt-row-colors" + style="padding-bottom: 0.5em"> + <tr style="background: lightgray; font-size: 14px;"> + <th align="left">Token</th> + <th align="left">Operation</th> + <th align="left">Class</th> + <th>Precedence</th> + <th align="left">Associates</th> + </tr> +<tr><td><em>name</em></td><td>symbol reference</td><td>operand</td><td align="center">8</td><td>n/a</td></tr> +<tr><td><code>(</code><em>expression</em><code>)</code></td><td>expression grouping</td><td>operand</td><td align="center">8</td><td>n/a</td></tr> +<tr><td><code>f(</code><em>...</em><code>)</code></td><td>function call</td><td>prefix</td><td align="center">8</td><td>left</td></tr> +<tr><td><code>^</code></td><td>power</td><td>binary</td><td align="center">7</td><td>left</td></tr> +<tr><td><code>-, !</code></td><td>negation and boolean 'not'</td><td>unary</td><td align="center">6</td><td>right</td></tr> +<tr><td><code>*, /, %</code></td><td>multiplication, division, and modulo</td><td>binary</td><td align="center">5</td><td>left</td></tr> +<tr><td><code>+, -</code></td><td>addition and subtraction</td><td>binary</td><td align="center">4</td><td>left</td></tr> +<tr><td><code>==, <, >, <=, >=, !=</code></td><td>boolean equality, inequality, and comparison</td><td>binary</td><td align="center">3</td><td>left</td></tr> +<tr><td><code>&&, ||</code></td><td>boolean 'and' and 'or'</td><td>binary</td><td align="center">2</td><td>left</td></tr> +<tr><td><code>,</code></td><td>argument delimiter</td><td>binary</td><td align="center">1</td><td>left</td></tr> + +<caption class="top-caption">Expression operators and their precedence in the + text-string format for mathematical expressions. +</caption> +</table> + + + <p> + * In the table above, <em>operand</em> implies the construct is an operand, + * <em>prefix</em> implies the operation is applied to the following arguments, + * <em>unary</em> implies there is one argument, and <em>binary</em> implies there are + * two arguments. The values in the <b>Precedence</b> column show how the + * order of different types of operation are determined. For example, the + * expression <code>a + b * c</code> is evaluated as <code>a + (b * c)</code> + * because the @c * operator has higher precedence. The + * <b>Associates</b> column shows how the order of similar precedence + * operations is determined; for example, <code>a && b || c</code> is + * evaluated as <code>(a && b) || c</code> because the <code>&&</code> and <code>||</code> + * operators are left-associative and have the same precedence. + <p> + * The function call syntax consists of a function name, followed by an opening parenthesis token, + * followed by a sequence of zero or more arguments separated by commas (with each comma + * optionally preceded and/or followed by zero or more white space + * characters), followed by a closing parenthesis token. The function name + * must be chosen from one of the pre-defined functions in SBML or a + * user-defined function in the model. The following table lists the names + * of certain common mathematical functions; this table corresponds to + * Table 6 in the <a target='_blank' + * href='http://sbml.org/Documents/Specifications#SBML_Level_1_Version_2'>SBML + * Level 1 Version 2 specification</a> with additions based on the + * functions added in SBML Level 2 and Level 3: + <p> + + * <table border="0" width="95%" + class="centered text-table normal-font alt-row-colors"> + <tr> + <th align="left" width="60">Name</th> + <th align="left" width="75">Argument(s)</th> + <th align="left">Formula or meaning</th> + <th align="left" width="90">Argument Constraints</th> + <th align="left" width="90">Result constraints</th> + </tr> +<tr><td><code>abs</code></td> + <td><em>x</em></td> + <td>Absolute value of <em>x</em>.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acos</code>, <code>arccos</code></td> + <td><em>x</em></td> + <td>Arccosine of <em>x</em> in radians.</td> + <td>–1.0 ≤ <em>x</em> ≤ 1.0</td> + <td>0 ≤ <em>acos(x)</em> ≤ π</td> +</tr> +<tr><td><code>acosh</code>, <code>arccosh</code></td> + <td><em>x</em></td> + <td>Hyperbolic arccosine of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acot</code>, <code>arccot</code></td> + <td><em>x</em></td> + <td>Arccotangent of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acoth</code>, <code>arccoth</code></td> + <td><em>x</em></td> + <td>Hyperbolic arccotangent of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acsc</code>, <code>arccsc</code></td> + <td><em>x</em></td> + <td>Arccosecant of <em>x</em> in radians.</td> + <td></td> + <td></td> +</tr> +<tr><td><code>acsch</code>, <code>arccs... [truncated message content] |
From: <and...@us...> - 2015-08-03 20:22:14
|
Revision: 2354 http://sourceforge.net/p/jsbml/code/2354 Author: andreas-draeger Date: 2015-08-03 20:22:11 +0000 (Mon, 03 Aug 2015) Log Message: ----------- Added another static method to create a piecewise function. Thanks to Ally Hume for pointing this out. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-08-03 16:18:22 UTC (rev 2353) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-08-03 20:22:11 UTC (rev 2354) @@ -1076,8 +1076,22 @@ * @return a piecewise {@link ASTNode}. */ public static ASTNode piecewise(ASTNode node, ASTNode... nodes) { - ASTNode piecewise = new ASTNode(Type.FUNCTION_PIECEWISE, node - .getParentSBMLObject()); + return piecewise(node.getParentSBMLObject(), nodes); + } + + /** + * @param parentSBMLObject + * a link to the container in which this {@link ASTNode} will be + * inserted. This can be useful if complex operations on units, + * species, etc. are necessary when creating this formula. + * Can be {@code null}. + * @param nodes + * @return + * @see #piecewise(ASTNode, ASTNode...) + */ + public static ASTNode piecewise(MathContainer parentSBMLObject, + ASTNode[] nodes) { + ASTNode piecewise = new ASTNode(Type.FUNCTION_PIECEWISE, parentSBMLObject); for (ASTNode n : nodes) { piecewise.addChild(n); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-08-03 16:18:24
|
Revision: 2353 http://sourceforge.net/p/jsbml/code/2353 Author: kofiav Date: 2015-08-03 16:18:22 +0000 (Mon, 03 Aug 2015) Log Message: ----------- Fixed bug in the hashcode function that was leading to a stackoverflow error for ASTNode2 nodes. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTFunction.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTHyperbolicNode.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTUnaryFunctionNode.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/AbstractASTNode.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-07-30 15:28:48 UTC (rev 2352) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-08-03 16:18:22 UTC (rev 2353) @@ -24,7 +24,6 @@ import java.io.StringReader; import java.text.MessageFormat; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Set; @@ -74,7 +73,6 @@ import org.sbml.jsbml.text.parser.FormulaParserLL3; import org.sbml.jsbml.text.parser.IFormulaParser; import org.sbml.jsbml.text.parser.ParseException; -import org.sbml.jsbml.util.TreeNodeChangeListener; import org.sbml.jsbml.util.compilers.ASTNodeCompiler; import org.sbml.jsbml.util.compilers.ASTNodeValue; import org.sbml.jsbml.util.compilers.FormulaCompiler; @@ -3013,8 +3011,7 @@ throw new RuntimeException(resourceBundle.getString("ASTNode.getVariable4")); } - /* - * (non-Javadoc) + /* (non-Javadoc) * * @see org.sbml.jsbml.AbstractTreeNode#hashCode() */ @@ -3022,9 +3019,7 @@ public int hashCode() { final int prime = 787; int hashCode = super.hashCode(); - hashCode += prime * astnode2.hashCode(); - return hashCode; } Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTFunction.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTFunction.java 2015-07-30 15:28:48 UTC (rev 2352) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTFunction.java 2015-08-03 16:18:22 UTC (rev 2353) @@ -304,8 +304,6 @@ public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result - + ((listOfNodes == null) ? 0 : listOfNodes.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTHyperbolicNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTHyperbolicNode.java 2015-07-30 15:28:48 UTC (rev 2352) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTHyperbolicNode.java 2015-08-03 16:18:22 UTC (rev 2353) @@ -79,8 +79,7 @@ setType(type); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTUnaryFunctionNode#clone() */ @Override Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTUnaryFunctionNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTUnaryFunctionNode.java 2015-07-30 15:28:48 UTC (rev 2352) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTUnaryFunctionNode.java 2015-08-03 16:18:22 UTC (rev 2353) @@ -81,8 +81,7 @@ setType(type); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#addChild(org.sbml.jsbml.math.ASTNode2) */ @Override @@ -103,8 +102,7 @@ child.fireNodeAddedEvent(); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#clone() */ @Override @@ -150,8 +148,7 @@ return getChildAt(0); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#getChildAt(int) */ @Override @@ -162,8 +159,7 @@ return listOfNodes.get(childIndex); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#insertChild(int, org.sbml.jsbml.math.ASTNode2) */ @Override @@ -211,8 +207,7 @@ return getChildCount() > 0; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#prependChild(org.sbml.jsbml.math.ASTNode2) */ @Override @@ -232,8 +227,7 @@ child.setParent(this); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#removeChild(int) */ @Override @@ -263,8 +257,7 @@ } } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTFunction#swapChildren(org.sbml.jsbml.math.ASTFunction) */ @Override Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/AbstractASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/AbstractASTNode.java 2015-07-30 15:28:48 UTC (rev 2352) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/AbstractASTNode.java 2015-08-03 16:18:22 UTC (rev 2353) @@ -198,8 +198,7 @@ @Override public abstract ASTNode2 getChildAt(int childIndex); - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#getId() */ @Override @@ -232,8 +231,7 @@ return ""; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#getParentSBMLObject() */ @Override @@ -241,8 +239,7 @@ return parentSBMLObject; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#getStyle() */ @Override @@ -279,6 +276,7 @@ */ @Override public int hashCode() { + // TODO: ?? final int prime = 31; int result = super.hashCode(); result = prime * result + ((id == null) ? 0 : id.hashCode()); @@ -290,8 +288,7 @@ return result; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isSetId() */ @Override @@ -299,8 +296,7 @@ return id != null; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isSetMathMLClass() */ @Override @@ -308,8 +304,7 @@ return mathMLClass != null; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isSetParentSBMLObject() */ @Override @@ -317,8 +312,7 @@ return parentSBMLObject != null; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isSetStyle() */ @Override @@ -326,8 +320,7 @@ return style != null; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isSetType() */ @Override @@ -335,8 +328,7 @@ return type != null; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#isStrict() */ @Override @@ -365,8 +357,7 @@ return value; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#setId(java.lang.String) */ @Override @@ -376,8 +367,7 @@ firePropertyChange(TreeNodeChangeEvent.id, oldValue, id); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#setMathMLClass(java.lang.String) */ @Override @@ -420,8 +410,7 @@ this.strict = strict; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#setStyle(java.lang.String) */ @Override @@ -431,8 +420,7 @@ firePropertyChange(TreeNodeChangeEvent.style, oldValue, style); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#setType(java.lang.String) */ @Override @@ -441,8 +429,7 @@ setType(type); } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see org.sbml.jsbml.math.ASTNode2#setType(org.sbml.jsbml.ASTNode.Type) */ @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-07-30 15:28:50
|
Revision: 2352 http://sourceforge.net/p/jsbml/code/2352 Author: niko-rodrigue Date: 2015-07-30 15:28:48 +0000 (Thu, 30 Jul 2015) Log Message: ----------- added the possiblity to parse fbc sbml file that use geneProteinAssociation so that we can read them and convert them using JSBML as the element was used for a very long time Modified Paths: -------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java 2015-07-30 15:10:43 UTC (rev 2351) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java 2015-07-30 15:28:48 UTC (rev 2352) @@ -84,6 +84,12 @@ public static final String geneProduct = "geneProduct"; /** + * Used only in some of the FBC v2 release candidates + */ + @Deprecated + public static final String geneProteinAssociation = "geneProteinAssociation"; + + /** * * @since jsbml 1.1, introduced in FBC version 2 */ Modified: trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2015-07-30 15:10:43 UTC (rev 2351) +++ trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2015-07-30 15:28:48 UTC (rev 2352) @@ -224,6 +224,14 @@ if (elementName.equals(FBCConstants.geneProductAssociation)) { GeneProductAssociation gPA = fbcReaction.createGeneProductAssociation(); return gPA; + } + else if (elementName.equals(FBCConstants.geneProteinAssociation)) { + // FBCConstants.geneProteinAssociation has been used for a very long time in the FBC v2 release candidates + // so we are keeping it here in case some files still use it. + logger.warn("You are using an invalid element name '" + FBCConstants.geneProteinAssociation + + "'. It was only used for few FBC V2 release candidates."); + GeneProductAssociation gPA = fbcReaction.createGeneProductAssociation(); + return gPA; } } else if (contextObject instanceof GeneProductAssociation) { GeneProductAssociation gPA = (GeneProductAssociation) contextObject; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-07-30 15:10:46
|
Revision: 2351 http://sourceforge.net/p/jsbml/code/2351 Author: niko-rodrigue Date: 2015-07-30 15:10:43 +0000 (Thu, 30 Jul 2015) Log Message: ----------- corrected the layout parser to read properly 'graphicalObject'. Modified Paths: -------------- trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java Modified: trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2015-07-14 12:08:34 UTC (rev 2350) +++ trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2015-07-30 15:10:43 UTC (rev 2351) @@ -363,6 +363,9 @@ else if (elementName.equals(generalGlyph)) { newElement = new GeneralGlyph(); } + else if (elementName.equals(LayoutConstants.graphicalObject)) { + newElement = new GraphicalObject(); + } if (newElement != null) { listOf.add(newElement); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-07-14 12:08:36
|
Revision: 2350 http://sourceforge.net/p/jsbml/code/2350 Author: niko-rodrigue Date: 2015-07-14 12:08:34 +0000 (Tue, 14 Jul 2015) Log Message: ----------- commented out test lines in the main method of SBMLWriter to avoid NullPointerException for some models Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-07-14 12:00:30 UTC (rev 2349) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-07-14 12:08:34 UTC (rev 2350) @@ -184,8 +184,8 @@ afterRead = Calendar.getInstance().getTimeInMillis(); // testDocument.checkConsistency(); - System.out.println("Model Notes = " + XMLNode.convertXMLNodeToString(testDocument.getModel().getNotes())); - System.out.println("MathML = " + testDocument.getModel().getReaction(0).getKineticLaw().getMath().toMathML()); +// System.out.println("Model Notes = " + XMLNode.convertXMLNodeToString(testDocument.getModel().getNotes())); +// System.out.println("MathML = " + testDocument.getModel().getReaction(0).getKineticLaw().getMath().toMathML()); System.out.println("Going to check package version and namespace for all elements."); PackageUtil.checkPackages(testDocument); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-07-14 12:00:32
|
Revision: 2349 http://sourceforge.net/p/jsbml/code/2349 Author: niko-rodrigue Date: 2015-07-14 12:00:30 +0000 (Tue, 14 Jul 2015) Log Message: ----------- added some support for relational operators with more than 2 children. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-07-07 15:44:29 UTC (rev 2348) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-07-14 12:00:30 UTC (rev 2349) @@ -4133,7 +4133,7 @@ public String toString() { String formula = ""; try { - formula = compile(new FormulaCompiler()).toString(); + formula = toFormula(); } catch (SBMLException e) { // log the exception e.printStackTrace(); Modified: trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2015-07-07 15:44:29 UTC (rev 2348) +++ trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2015-07-14 12:00:30 UTC (rev 2349) @@ -57,6 +57,12 @@ */ @Override public ASTNodeValue eq(ASTNode left, ASTNode right) throws SBMLException { + if (left != null && left.getParent().getChildCount() > 2 || + left != null && left.getParent().getChildCount() < 2) + { + return function("eq", ((ASTNode) left.getParent()).getListOfNodes()); + } + return new ASTNodeValue(relation(left, " == ", right), this); } @@ -74,6 +80,12 @@ */ @Override public ASTNodeValue geq(ASTNode left, ASTNode right) throws SBMLException { + if (left != null && left.getParent().getChildCount() > 2 || + left != null && left.getParent().getChildCount() < 2) + { + return function("geq", ((ASTNode) left.getParent()).getListOfNodes()); + } + return new ASTNodeValue(relation(left, " >= ", right), this); } @@ -83,6 +95,12 @@ */ @Override public ASTNodeValue gt(ASTNode left, ASTNode right) throws SBMLException { + if (left != null && left.getParent().getChildCount() > 2 || + left != null && left.getParent().getChildCount() < 2) + { + return function("gt", ((ASTNode) left.getParent()).getListOfNodes()); + } + return new ASTNodeValue(relation(left, " > ", right), this); } @@ -92,6 +110,12 @@ */ @Override public ASTNodeValue leq(ASTNode left, ASTNode right) throws SBMLException { + if (left != null && left.getParent().getChildCount() > 2 || + left != null && left.getParent().getChildCount() < 2) + { + return function("leq", ((ASTNode) left.getParent()).getListOfNodes()); + } + return new ASTNodeValue(relation(left, " <= ", right), this); } @@ -101,6 +125,12 @@ */ @Override public ASTNodeValue lt(ASTNode left, ASTNode right) throws SBMLException { + if (left != null && left.getParent().getChildCount() > 2 || + left != null && left.getParent().getChildCount() < 2) + { + return function("lt", ((ASTNode) left.getParent()).getListOfNodes()); + } + return new ASTNodeValue(relation(left, " < ", right), this); } @@ -138,6 +168,7 @@ // TODO return function(" xor ", nodes); } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-07-07 15:44:32
|
Revision: 2348 http://sourceforge.net/p/jsbml/code/2348 Author: andreas-draeger Date: 2015-07-07 15:44:29 +0000 (Tue, 07 Jul 2015) Log Message: ----------- * Updated FBC package to the latest specification by renaming 'GeneProteinAssociation' to 'GeneProductAssociation' and also changed all references to it, incl. all method and variable names. * Matthias K?\195?\182nig pointed out that there is a bug in Species for derived untis because two methods for this purpose have different behavior. I added a TODO tag there for now, but more needs to be done to unify those methods. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/Species.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java Added Paths: ----------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java Removed Paths: ------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java Modified: trunk/core/src/org/sbml/jsbml/Species.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Species.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/core/src/org/sbml/jsbml/Species.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -339,39 +339,52 @@ // According to SBML specification of Level 3 Version 1, page 44, lines 20-22: specUnit = model.getSubstanceUnitsInstance(); } - Compartment compartment = getCompartmentInstance(); - if ((specUnit != null) && !hasOnlySubstanceUnits() && (compartment != null) - && (0d < compartment.getSpatialDimensions())) { - UnitDefinition sizeUnit; // = getSpatialSizeUnitsInstance(); - if ((model != null) && isSetSpatialSizeUnits()) { - sizeUnit = model.getUnitDefinition(getSpatialSizeUnits()); - } else { - sizeUnit = compartment.getDerivedUnitDefinition(); - } - if (sizeUnit != null) { - UnitDefinition derivedUD = specUnit.clone().divideBy(sizeUnit); - derivedUD.setId(derivedUD.getId() + "_per_" + sizeUnit.getId()); - if (derivedUD.isSetName()) { - derivedUD.setName(derivedUD.getName() + " per " - + (sizeUnit.isSetName() ? sizeUnit.getName() : sizeUnit.getId())); + if (isSetHasOnlySubstanceUnits() && !hasOnlySubstanceUnits()) { + Compartment compartment = getCompartmentInstance(); + if ((specUnit != null) && (compartment != null) + && (0d < compartment.getSpatialDimensions())) { + UnitDefinition sizeUnit; // = getSpatialSizeUnitsInstance(); + if ((model != null) && isSetSpatialSizeUnits()) { + sizeUnit = model.getUnitDefinition(getSpatialSizeUnits()); + } else { + sizeUnit = compartment.getDerivedUnitDefinition(); } - /* - * If possible, let's return an equivalent unit that is already part of the model - * rather than returning some newly created UnitDefinition: - */ - if (model != null) { - UnitDefinition ud = model.findIdentical(derivedUD); - if (ud != null) { - return ud; + if (sizeUnit != null) { + UnitDefinition derivedUD = specUnit.clone().divideBy(sizeUnit); + derivedUD.setId(derivedUD.getId() + "_per_" + sizeUnit.getId()); + if (derivedUD.isSetName()) { + derivedUD.setName(derivedUD.getName() + " per " + + (sizeUnit.isSetName() ? sizeUnit.getName() : sizeUnit.getId())); } + /* + * If possible, let's return an equivalent unit that is already part of the model + * rather than returning some newly created UnitDefinition: + */ + if (model != null) { + UnitDefinition ud = model.findIdentical(derivedUD); + if (ud != null) { + return ud; + } + } + return derivedUD; } - return derivedUD; } } return specUnit; } /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBaseWithUnit#getDerivedUnits() + */ + @Override + public String getDerivedUnits() { + if (isSetHasOnlySubstanceUnits() && !hasOnlySubstanceUnits()) { + // TODO!!! Here is something wrong! This method must return the same as getDerivedUnitInstance(), I think! + } + return super.getDerivedUnits(); + } + + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#getElementName() */ @Override Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -101,11 +101,6 @@ public static final String geneProductReference = "geneProductRef"; /** - * Introduced to FBC in version 2. - */ - public static final String geneProteinAssociation = "geneProteinAssociation"; - - /** * */ public static final String label = "label"; Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -48,7 +48,7 @@ /** * */ - private GeneProteinAssociation geneProteinAssociation; + private GeneProductAssociation geneProductAssociation; /** * A reference to a global parameter in the model for the lower bound of @@ -75,8 +75,8 @@ public FBCReactionPlugin(FBCReactionPlugin reactionPlugin) { super(reactionPlugin); - if (reactionPlugin.isSetGeneProteinAssociation()) { - setGeneProteinAssociation(reactionPlugin.getGeneProteinAssociation().clone()); + if (reactionPlugin.isSetGeneProductAssociation()) { + setGeneProductAssociation(reactionPlugin.getGeneProductAssociation().clone()); } if (reactionPlugin.isSetLowerFluxBound()) { setLowerFluxBound(reactionPlugin.getLowerFluxBound()); @@ -105,8 +105,8 @@ * * @return */ - public GeneProteinAssociation createGeneProteinAssociation() { - return createGeneProteinAssociation(null); + public GeneProductAssociation createGeneProductAssociation() { + return createGeneProductAssociation(null); } /** @@ -114,9 +114,9 @@ * @param id * @return */ - public GeneProteinAssociation createGeneProteinAssociation(String id) { - GeneProteinAssociation gpa = new GeneProteinAssociation(id, getLevel(), getVersion()); - setGeneProteinAssociation(gpa); + public GeneProductAssociation createGeneProductAssociation(String id) { + GeneProductAssociation gpa = new GeneProductAssociation(id, getLevel(), getVersion()); + setGeneProductAssociation(gpa); return gpa; } @@ -129,11 +129,11 @@ return false; } FBCReactionPlugin other = (FBCReactionPlugin) obj; - if (geneProteinAssociation == null) { - if (other.geneProteinAssociation != null) { + if (geneProductAssociation == null) { + if (other.geneProductAssociation != null) { return false; } - } else if (!geneProteinAssociation.equals(other.geneProteinAssociation)) { + } else if (!geneProductAssociation.equals(other.geneProductAssociation)) { return false; } if (lowerFluxBound == null) { @@ -172,9 +172,9 @@ } int pos = 0; - if (isSetGeneProteinAssociation()) { + if (isSetGeneProductAssociation()) { if (pos == index) { - return getGeneProteinAssociation(); + return getGeneProductAssociation(); } pos++; } @@ -189,16 +189,16 @@ */ @Override public int getChildCount() { - return isSetGeneProteinAssociation() ? 1 : 0; + return isSetGeneProductAssociation() ? 1 : 0; } /** - * Returns the value of {@link #geneProteinAssociation}. + * Returns the value of {@link #geneProductAssociation}. * - * @return the value of {@link #geneProteinAssociation}. + * @return the value of {@link #geneProductAssociation}. */ - public GeneProteinAssociation getGeneProteinAssociation() { - return geneProteinAssociation; + public GeneProductAssociation getGeneProductAssociation() { + return geneProductAssociation; } /** @@ -265,19 +265,19 @@ public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result + ((geneProteinAssociation == null) ? 0 : geneProteinAssociation.hashCode()); + result = prime * result + ((geneProductAssociation == null) ? 0 : geneProductAssociation.hashCode()); result = prime * result + ((lowerFluxBound == null) ? 0 : lowerFluxBound.hashCode()); result = prime * result + ((upperFluxBound == null) ? 0 : upperFluxBound.hashCode()); return result; } /** - * Returns whether {@link #geneProteinAssociation} is set. + * Returns whether {@link #geneProductAssociation} is set. * - * @return whether {@link #geneProteinAssociation} is set. + * @return whether {@link #geneProductAssociation} is set. */ - public boolean isSetGeneProteinAssociation() { - return geneProteinAssociation != null; + public boolean isSetGeneProductAssociation() { + return geneProductAssociation != null; } /** @@ -332,16 +332,18 @@ } /** - * Sets the value of geneProteinAssociation - * @param geneProteinAssociation the value of geneProteinAssociation to be set. + * Sets the value of {@link #geneProductAssociation} + * + * @param geneProductAssociation + * the value of {@link #geneProductAssociation} to be set. */ - public void setGeneProteinAssociation(GeneProteinAssociation geneProteinAssociation) { - GeneProteinAssociation oldGeneProteinAssociation = this.geneProteinAssociation; - this.geneProteinAssociation = geneProteinAssociation; + public void setGeneProductAssociation(GeneProductAssociation geneProductAssociation) { + GeneProductAssociation oldGeneProductAssociation = geneProductAssociation; + this.geneProductAssociation = geneProductAssociation; if (isSetExtendedSBase()) { - getExtendedSBase().registerChild(geneProteinAssociation); + getExtendedSBase().registerChild(geneProductAssociation); } - firePropertyChange(FBCConstants.geneProteinAssociation, oldGeneProteinAssociation, this.geneProteinAssociation); + firePropertyChange(FBCConstants.geneProductAssociation, oldGeneProductAssociation, geneProductAssociation); } /** @@ -393,8 +395,8 @@ public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getClass().getSimpleName()); - builder.append(" [geneProteinAssociation="); - builder.append(geneProteinAssociation); + builder.append(" [geneProductAssociation="); + builder.append(geneProductAssociation); builder.append(", lowerFluxBound="); builder.append(lowerFluxBound); builder.append(", upperFluxBound="); @@ -404,16 +406,16 @@ } /** - * Unsets the variable geneProteinAssociation. + * Unsets the variable {@link #geneProductAssociation}. * - * @return {@code true} if geneProteinAssociation was set before, + * @return {@code true} if {@link #geneProductAssociation} was set before, * otherwise {@code false}. */ - public boolean unsetGeneProteinAssociation() { - if (isSetGeneProteinAssociation()) { - GeneProteinAssociation oldGeneProteinAssociation = geneProteinAssociation; - geneProteinAssociation = null; - firePropertyChange(FBCConstants.geneProteinAssociation, oldGeneProteinAssociation, geneProteinAssociation); + public boolean unsetGeneProductAssociation() { + if (isSetGeneProductAssociation()) { + GeneProductAssociation oldGeneProductAssociation = geneProductAssociation; + geneProductAssociation = null; + firePropertyChange(FBCConstants.geneProductAssociation, oldGeneProductAssociation, geneProductAssociation); return true; } return false; Copied: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java (from rev 2344, trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java) =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java (rev 0) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -0,0 +1,239 @@ +/* + * $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. + * + * Copyright (C) 2009-2015 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 + * + * 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.ext.fbc; + +import java.text.MessageFormat; +import java.util.Map; + +import javax.swing.tree.TreeNode; + +import org.sbml.jsbml.AbstractNamedSBase; + +/** + * Introduced to FBC in version 2. + * + * @author Andreas Dräger + * @version $Rev$ + * @since 1.1 + * @date 06.03.2015 + */ +public class GeneProductAssociation extends AbstractNamedSBase { + + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = 3080178338645314056L; + + /** + * + */ + private Association association; + + /** + * + */ + public GeneProductAssociation() { + super(); + initDefaults(); + } + + /** + * + */ + private void initDefaults() { + setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = FBCConstants.shortLabel; + } + + /** + * @param gpa + */ + public GeneProductAssociation(GeneProductAssociation gpa) { + super(gpa); + if (gpa.isSetAssociation()) { + setAssociation((Association) gpa.getAssociation().clone()); + } + } + + /** + * @param level + * @param version + */ + public GeneProductAssociation(int level, int version) { + super(level, version); + initDefaults(); + } + + /** + * @param id + */ + public GeneProductAssociation(String id) { + super(id); + initDefaults(); + } + + /** + * @param id + * @param level + * @param version + */ + public GeneProductAssociation(String id, int level, int version) { + super(id, level, version); + initDefaults(); + } + + /** + * @param id + * @param name + * @param level + * @param version + */ + public GeneProductAssociation(String id, String name, int level, int version) { + super(id, name, level, version); + initDefaults(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractSBase#clone() + */ + @Override + public GeneProductAssociation clone() { + return new GeneProductAssociation(this); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractSBase#getAllowsChildren() + */ + @Override + public boolean getAllowsChildren() { + return true; + } + + /** + * Returns the value of {@link #association}. + * + * @return the value of {@link #association}. + */ + public Association getAssociation() { + return association; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractSBase#getChildAt(int) + */ + @Override + public TreeNode getChildAt(int index) { + if (index < 0) { + throw new IndexOutOfBoundsException(MessageFormat.format( + resourceBundle.getString("IndexSurpassesBoundsException"), index, 0)); + } + int count = super.getChildCount(), pos = 0; + if (index < count) { + return super.getChildAt(index); + } else { + index -= count; + } + if (isSetAssociation()) { + if (pos == index) { + return getAssociation(); + } + pos++; + } + throw new IndexOutOfBoundsException( + MessageFormat.format(resourceBundle.getString("IndexExceedsBoundsException"), + index, Math.min(pos, 0))); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractSBase#getChildCount() + */ + @Override + public int getChildCount() { + int count = super.getChildCount(); + if (isSetAssociation()) { + count++; + } + return count; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.NamedSBase#isIdMandatory() + */ + @Override + public boolean isIdMandatory() { + return true; + } + + /** + * Returns whether {@link #association} is set. + * + * @return whether {@link #association} is set. + */ + public boolean isSetAssociation() { + return association != null; + } + + /** + * Sets the value of association + * @param association the value of association to be set. + */ + public void setAssociation(Association association) { + Association oldAssociation = this.association; + this.association = association; + registerChild(association); + firePropertyChange(FBCConstants.association, oldAssociation, this.association); + } + + /** + * Unsets the variable association. + * + * @return {@code true} if association was set before, + * otherwise {@code false}. + */ + public boolean unsetAssociation() { + if (isSetAssociation()) { + Association oldAssociation = association; + association = null; + firePropertyChange(FBCConstants.association, oldAssociation, association); + return true; + } + return false; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() + */ + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetId()) { + attributes.remove("id"); + attributes.put(FBCConstants.shortLabel + ":id", getId()); + } + if (isSetName()) { + attributes.remove("name"); + attributes.put(FBCConstants.shortLabel + ":name", getId()); + } + return attributes; + } + +} Deleted: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -1,239 +0,0 @@ -/* - * $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. - * - * Copyright (C) 2009-2015 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 - * - * 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.ext.fbc; - -import java.text.MessageFormat; -import java.util.Map; - -import javax.swing.tree.TreeNode; - -import org.sbml.jsbml.AbstractNamedSBase; - -/** - * Introduced to FBC in version 2. - * - * @author Andreas Dräger - * @version $Rev$ - * @since 1.1 - * @date 06.03.2015 - */ -public class GeneProteinAssociation extends AbstractNamedSBase { - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 3080178338645314056L; - - /** - * - */ - private Association association; - - /** - * - */ - public GeneProteinAssociation() { - super(); - initDefaults(); - } - - /** - * - */ - private void initDefaults() { - setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace - setPackageVersion(-1); - packageName = FBCConstants.shortLabel; - } - - /** - * @param gpa - */ - public GeneProteinAssociation(GeneProteinAssociation gpa) { - super(gpa); - if (gpa.isSetAssociation()) { - setAssociation((Association) gpa.getAssociation().clone()); - } - } - - /** - * @param level - * @param version - */ - public GeneProteinAssociation(int level, int version) { - super(level, version); - initDefaults(); - } - - /** - * @param id - */ - public GeneProteinAssociation(String id) { - super(id); - initDefaults(); - } - - /** - * @param id - * @param level - * @param version - */ - public GeneProteinAssociation(String id, int level, int version) { - super(id, level, version); - initDefaults(); - } - - /** - * @param id - * @param name - * @param level - * @param version - */ - public GeneProteinAssociation(String id, String name, int level, int version) { - super(id, name, level, version); - initDefaults(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#clone() - */ - @Override - public GeneProteinAssociation clone() { - return new GeneProteinAssociation(this); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#getAllowsChildren() - */ - @Override - public boolean getAllowsChildren() { - return true; - } - - /** - * Returns the value of {@link #association}. - * - * @return the value of {@link #association}. - */ - public Association getAssociation() { - return association; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#getChildAt(int) - */ - @Override - public TreeNode getChildAt(int index) { - if (index < 0) { - throw new IndexOutOfBoundsException(MessageFormat.format( - resourceBundle.getString("IndexSurpassesBoundsException"), index, 0)); - } - int count = super.getChildCount(), pos = 0; - if (index < count) { - return super.getChildAt(index); - } else { - index -= count; - } - if (isSetAssociation()) { - if (pos == index) { - return getAssociation(); - } - pos++; - } - throw new IndexOutOfBoundsException( - MessageFormat.format(resourceBundle.getString("IndexExceedsBoundsException"), - index, Math.min(pos, 0))); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#getChildCount() - */ - @Override - public int getChildCount() { - int count = super.getChildCount(); - if (isSetAssociation()) { - count++; - } - return count; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.NamedSBase#isIdMandatory() - */ - @Override - public boolean isIdMandatory() { - return true; - } - - /** - * Returns whether {@link #association} is set. - * - * @return whether {@link #association} is set. - */ - public boolean isSetAssociation() { - return association != null; - } - - /** - * Sets the value of association - * @param association the value of association to be set. - */ - public void setAssociation(Association association) { - Association oldAssociation = this.association; - this.association = association; - registerChild(association); - firePropertyChange(FBCConstants.association, oldAssociation, this.association); - } - - /** - * Unsets the variable association. - * - * @return {@code true} if association was set before, - * otherwise {@code false}. - */ - public boolean unsetAssociation() { - if (isSetAssociation()) { - Association oldAssociation = association; - association = null; - firePropertyChange(FBCConstants.association, oldAssociation, association); - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - if (isSetId()) { - attributes.remove("id"); - attributes.put(FBCConstants.shortLabel + ":id", getId()); - } - if (isSetName()) { - attributes.remove("name"); - attributes.put(FBCConstants.shortLabel + ":name", getId()); - } - return attributes; - } - -} Modified: trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -52,7 +52,7 @@ import org.sbml.jsbml.ext.fbc.FluxObjective; import org.sbml.jsbml.ext.fbc.GeneProduct; import org.sbml.jsbml.ext.fbc.GeneProductRef; -import org.sbml.jsbml.ext.fbc.GeneProteinAssociation; +import org.sbml.jsbml.ext.fbc.GeneProductAssociation; import org.sbml.jsbml.ext.fbc.LogicalOperator; import org.sbml.jsbml.ext.fbc.Objective; import org.sbml.jsbml.ext.fbc.Or; @@ -145,15 +145,15 @@ } else if (contextObject instanceof Reaction) { Reaction reaction = (Reaction) contextObject; - contextObject = (FBCReactionPlugin) reaction.getPlugin(FBCConstants.shortLabel); - + contextObject = reaction.getPlugin(FBCConstants.shortLabel); + } else if (contextObject instanceof Model) { contextObject = ((Model) contextObject).getPlugin(FBCConstants.shortLabel); // TODO - could be generic in AbstractReaderWriter.processAttribute. If packageName = 'core', just call // getPlugin. The plugin will be created if needed or returned if already present. - + } super.processAttribute(elementName, attributeName, value, uri, prefix, isLastAttribute, contextObject); @@ -221,13 +221,12 @@ Reaction reaction = (Reaction) contextObject; FBCReactionPlugin fbcReaction = (FBCReactionPlugin) reaction.getPlugin(FBCConstants.shortLabel); - // both names are in used at the moment, while the specs are finalized. - if (elementName.equals(FBCConstants.geneProductAssociation) || elementName.equals(FBCConstants.geneProteinAssociation)) { - GeneProteinAssociation gPA = fbcReaction.createGeneProteinAssociation(); + if (elementName.equals(FBCConstants.geneProductAssociation)) { + GeneProductAssociation gPA = fbcReaction.createGeneProductAssociation(); return gPA; } - } else if (contextObject instanceof GeneProteinAssociation) { - GeneProteinAssociation gPA = (GeneProteinAssociation) contextObject; + } else if (contextObject instanceof GeneProductAssociation) { + GeneProductAssociation gPA = (GeneProductAssociation) contextObject; // and + or + geneProductRef if (elementName.equals(FBCConstants.and)) { Modified: trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java =================================================================== --- trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java 2015-07-05 18:42:37 UTC (rev 2347) +++ trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java 2015-07-07 15:44:29 UTC (rev 2348) @@ -52,7 +52,7 @@ import org.sbml.jsbml.ext.fbc.FBCReactionPlugin; import org.sbml.jsbml.ext.fbc.GeneProduct; import org.sbml.jsbml.ext.fbc.GeneProductRef; -import org.sbml.jsbml.ext.fbc.GeneProteinAssociation; +import org.sbml.jsbml.ext.fbc.GeneProductAssociation; import org.sbml.jsbml.ext.fbc.Or; import org.sbml.jsbml.util.ModelBuilder; import org.sbml.jsbml.xml.XMLNode; @@ -124,7 +124,7 @@ } FBCReactionPlugin reactionPlugin = (FBCReactionPlugin) reaction.getPlugin(FBCConstants.shortLabel); - GeneProteinAssociation gpa = reactionPlugin.createGeneProteinAssociation("R_ETF_assoc"); + GeneProductAssociation gpa = reactionPlugin.createGeneProductAssociation("R_ETF_assoc"); Association association = new Or(level, version); And and = new And(level, version); GeneProductRef gpr = new GeneProductRef("gprf1", "R_ETF transcript 2", level, version); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-07-05 18:42:40
|
Revision: 2347 http://sourceforge.net/p/jsbml/code/2347 Author: kofiav Date: 2015-07-05 18:42:37 +0000 (Sun, 05 Jul 2015) Log Message: ----------- Fixed bug in ASTNode.lt() (was creating Type.LOGICAL_GT nodes instead) Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-07-05 18:31:52 UTC (rev 2346) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-07-05 18:42:37 UTC (rev 2347) @@ -963,7 +963,7 @@ * {@link ASTNode}s. */ public static ASTNode lt(ASTNode left, ASTNode right) { - ASTNode lt = new ASTNode(Type.RELATIONAL_GT); + ASTNode lt = new ASTNode(Type.RELATIONAL_LT); lt.addChild(left); lt.addChild(right); return lt; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-07-05 18:31:55
|
Revision: 2346 http://sourceforge.net/p/jsbml/code/2346 Author: kofiav Date: 2015-07-05 18:31:52 +0000 (Sun, 05 Jul 2015) Log Message: ----------- Fixed parenthesis issue. Parenthesis not included by default in logical operator expressions. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.java branches/astnode2-merging-alternate/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/CompilerTest.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2015-07-04 18:22:30 UTC (rev 2345) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2015-07-05 18:31:52 UTC (rev 2346) @@ -977,7 +977,7 @@ protected String relation(ASTNode left, String symbol, ASTNode right) throws SBMLException { - return brackets(new StringBuffer().append(checkRelationalArgumentBrackets(left)) + return (new StringBuffer().append(checkRelationalArgumentBrackets(left)) .append(FORMULA_ARGUMENT_SEPARATOR).append(symbol).append(FORMULA_ARGUMENT_SEPARATOR) .append(checkRelationalArgumentBrackets(right))).toString(); } Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.java 2015-07-04 18:22:30 UTC (rev 2345) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.java 2015-07-05 18:31:52 UTC (rev 2346) @@ -87,8 +87,8 @@ System.out.println(n.toMathML()); System.out.println(n.toFormula()); - // assertTrue(n.toFormula().equals("(V0 > 3) && (V1 > 3)")); // L3Compiler output: (gt(V0, 3)) && (gt(V1, 3)) - assertTrue(n.toFormula().equals("((V0 > 3)) && ((V1 > 3))")); // TODO - correct the compiler + assertTrue(n.toFormula().equals("(V0 > 3) && (V1 > 3)")); // L3Compiler output: (gt(V0, 3)) && (gt(V1, 3)) + //assertTrue(n.toFormula().equals("((V0 > 3)) && ((V1 > 3))")); // TODO - correct the compiler } /** Modified: branches/astnode2-merging-alternate/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/CompilerTest.java =================================================================== --- branches/astnode2-merging-alternate/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/CompilerTest.java 2015-07-04 18:22:30 UTC (rev 2345) +++ branches/astnode2-merging-alternate/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/CompilerTest.java 2015-07-05 18:31:52 UTC (rev 2346) @@ -553,11 +553,12 @@ vector = ASTNode.parseFormula("piecewise({ 1, 2 } , { x > 5, y > 5 }, { 0, 0 })"); vector.compile(compiler); System.out.println("CompilerTest - testPieceWise - formula = " + compiler.getNode().toFormula().replaceAll(" ", "")); - // assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,x>5,0),piecewise(2,y>5,0)}")); - assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,(x>5),0),piecewise(2,(y>5),0)}")); // TODO - might fail again if we correct the formula compiler + assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,x>5,0),piecewise(2,y>5,0)}")); + //assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,(x>5),0),piecewise(2,(y>5),0)}")); // TODO - might fail again if we correct the formula compiler vector = ASTNode.parseFormula("piecewise({ 1, 2 } , { x > 5, y > 5 }, 0)"); vector.compile(compiler); - assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,(x>5),0),piecewise(2,(y>5),0)}")); + //assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,(x>5),0),piecewise(2,(y>5),0)}")); + assertTrue(compiler.getNode().toFormula().replaceAll(" ", "").equals("{piecewise(1,x>5,0),piecewise(2,y>5,0)}")); } catch (ParseException e) { assertTrue(false); e.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-07-04 18:22:33
|
Revision: 2345 http://sourceforge.net/p/jsbml/code/2345 Author: kofiav Date: 2015-07-04 18:22:30 +0000 (Sat, 04 Jul 2015) Log Message: ----------- Fixed xor test case in ASTNodeInfixParsingTest Modified Paths: -------------- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-06-26 21:37:31 UTC (rev 2344) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-07-04 18:22:30 UTC (rev 2345) @@ -2046,20 +2046,12 @@ ASTNode n = ASTNode.parseFormula("xor(x,y)", l3Parser); String formula = ASTNode.formulaToString(n, l3Compiler); System.out.println("formula 'xor(x, y)' = " + formula); - n = ASTNode.parseFormula(formula, l3Parser); - - // x xor y - n = ASTNode.parseFormula("x xor y", parser); // xor(x,y) does not work ==> difference compared to the L1 supported syntax? - formula = ASTNode.formulaToString(n, oldL1Compiler); - System.out.println("formula 'x xor y)' = " + formula); - n = ASTNode.parseFormula(formula, parser); - + n = ASTNode.parseFormula(formula, l3Parser); // xor(x, y) n = ASTNode.parseFormula("xor(x,y)", l3Parser); formula = ASTNode.formulaToString(n, oldL1Compiler); System.out.println("formula 'xor(x, y)' = " + formula); n = ASTNode.parseFormula(formula, l3Parser); - } catch (ParseException e) { // should never happen e.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-06-26 21:37:33
|
Revision: 2344 http://sourceforge.net/p/jsbml/code/2344 Author: kofiav Date: 2015-06-26 21:37:31 +0000 (Fri, 26 Jun 2015) Log Message: ----------- Added delay function to ASTNodeTokens.xml & fixed test for FUNCTION_LN in ASTNodeInfixParsingTest. Modified Paths: -------------- branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java Modified: branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml =================================================================== --- branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml 2015-06-25 17:56:09 UTC (rev 2343) +++ branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml 2015-06-26 21:37:31 UTC (rev 2344) @@ -104,4 +104,5 @@ <entry key="times">TIMES</entry> <entry key="vector">VECTOR</entry> <entry key="lambda">LAMBDA</entry> + <entry key="delay">FUNCTION_DELAY</entry> </properties> Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-06-25 17:56:09 UTC (rev 2343) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-06-26 21:37:31 UTC (rev 2344) @@ -4016,7 +4016,8 @@ break; case FUNCTION_LN : astnode2 = new ASTLogarithmNode(); - ((ASTLogarithmNode)astnode2).addChild(new ASTConstantNumber(Math.E)); + //((ASTLogarithmNode)astnode2).addChild(new ASTConstantNumber(Math.E)); + astnode2.setType(Type.FUNCTION_LN); break; case FUNCTION_LOG : astnode2 = new ASTLogarithmNode(); Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-06-25 17:56:09 UTC (rev 2343) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-06-26 21:37:31 UTC (rev 2344) @@ -1360,18 +1360,13 @@ */ @Test public void testLnCaseInsensitive() { - // TODO: this test case needs to be fixed boolean status = false; try { ASTNode ln = ASTNode.parseFormula("Ln(1000)", caseInsensitiveParser); status = (ln.getType() == ASTNode.Type.FUNCTION_LN) && (ln.getType() != ASTNode.Type.FUNCTION); if (status) { - ASTNode base = ln.getLeftChild(); - status = (base.getType() == ASTNode.Type.CONSTANT_E); - if (status) { - ASTNode n = ln.getRightChild(); - status = (n.getType() == ASTNode.Type.INTEGER) && (n.getInteger() == 1000); - } + ASTNode n = (ASTNode) ln.getChildAt(0); + status = (n.getType() == ASTNode.Type.INTEGER) && (n.getInteger() == 1000); } } catch (Exception e) { e.printStackTrace(); @@ -1408,7 +1403,7 @@ boolean status = false; try { ASTNode log = ASTNode.parseFormula("Log(1000)", caseInsensitiveParser); - status = (log.getType() == ASTNode.Type.FUNCTION_LOG) && (log.getType() != ASTNode.Type.FUNCTION); + status = (log.getType() == ASTNode.Type.FUNCTION_LN) && (log.getType() != ASTNode.Type.FUNCTION); if (status) { ASTNode n = log.getChild(0); status = (n.getType() == ASTNode.Type.INTEGER) && (n.getInteger() == 1000); @@ -2055,7 +2050,7 @@ // x xor y n = ASTNode.parseFormula("x xor y", parser); // xor(x,y) does not work ==> difference compared to the L1 supported syntax? - formula = ASTNode.formulaToString(n); + formula = ASTNode.formulaToString(n, oldL1Compiler); System.out.println("formula 'x xor y)' = " + formula); n = ASTNode.parseFormula(formula, parser); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2015-06-25 17:56:11
|
Revision: 2343 http://sourceforge.net/p/jsbml/code/2343 Author: alex-thomas Date: 2015-06-25 17:56:09 +0000 (Thu, 25 Jun 2015) Log Message: ----------- Changed to not throw IllegalArgumentException if there is an invalid email address. Error is now logged. Also, added a note to SyntaxChecker about non-printable unicode characters. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/Creator.java trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java Modified: trunk/core/src/org/sbml/jsbml/Creator.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Creator.java 2015-06-25 14:48:49 UTC (rev 2342) +++ trunk/core/src/org/sbml/jsbml/Creator.java 2015-06-25 17:56:09 UTC (rev 2343) @@ -11,7 +11,7 @@ * 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 - * + * * 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 @@ -34,7 +34,7 @@ /** * Contains all the information about a creator of a {@link Model} (or other * {@link SBase} in level 3). - * + * * @author Marine Dumousseau * @author Andreas Dräger * @since 0.8 @@ -80,9 +80,9 @@ * Holding any additional vCard elements. * This is a quick and dirty solution as the vCard can contain * many elements that have sub-elements. - * + * * TODO: use an XMLNode to hold all the additional informations - * + * */ private Map<String, String> otherAttributes; @@ -101,7 +101,7 @@ /** * Creates a {@link Creator} instance from a given {@link Creator}. - * + * * @param creator */ public Creator(Creator creator) { @@ -124,7 +124,7 @@ /** * Creates a {@link Creator} instance. - * + * * @param givenName * @param familyName * @param organization @@ -206,7 +206,7 @@ /** * Returns the email from the {@link Creator}. Returns an empty String if it is * not set. - * + * * @return the email from the {@link Creator}. Returns an empty String if it is * not set. */ @@ -217,7 +217,7 @@ /** * Returns the familyName from the {@link Creator}. Returns an empty String if * it is not set. - * + * * @return the familyName from the {@link Creator}. Returns an empty String if * it is not set. */ @@ -228,7 +228,7 @@ /** * Returns the givenName from the {@link Creator}. Returns an empty String if * it is not set. - * + * * @return the givenName from the {@link Creator}. Returns an empty String if * it is not set. */ @@ -239,7 +239,7 @@ /** * Returns the organisation from the {@link Creator}. Returns an empty String * if it is not set. - * + * * @return the organisation from the {@link Creator}. Returns an empty String * if it is not set. */ @@ -252,7 +252,7 @@ * if it is not set. * <p> * Equal to {@link #getOrganisation()} - * + * * @return the organisation from the {@link Creator}. Returns an empty String * if it is not set. */ @@ -288,7 +288,7 @@ /** * Returns {@code true} or false depending on whether this * {@link Creator}'s email has been set. - * + * * @return {@code true} if the email of this {@link Creator} is not {@code null}. */ public boolean isSetEmail() { @@ -298,7 +298,7 @@ /** * Returns {@code true} or false depending on whether this * {@link Creator}'s familyName has been set. - * + * * @return {@code true} if the familyName of this {@link Creator} is not {@code null}. */ public boolean isSetFamilyName() { @@ -308,7 +308,7 @@ /** * Returns {@code true} or false depending on whether this * {@link Creator}'s givenName has been set. - * + * * @return {@code true} if the givenName of this {@link Creator} is not {@code null}. */ public boolean isSetGivenName() { @@ -318,7 +318,7 @@ /** * Returns {@code true} or false depending on whether this * {@link Creator}'s organisation has been set. - * + * * @return {@code true} if the organisation of this {@link Creator} is not {@code null}. */ public boolean isSetOrganisation() { @@ -329,7 +329,7 @@ * Returns {@code true} or false depending on whether this * {@link Creator}'s organisation has been set. * <p>Equal to {@link #isSetOrganisation()} - * + * * @return {@code true} or false depending on whether this * {@link Creator}'s organisation has been set. */ @@ -343,7 +343,7 @@ * @param attributeName * @param prefix * @param value - * + * * @return {@code true} if the XML attribute is known by this {@link Creator}. */ public boolean readAttribute(String elementName, String attributeName, @@ -361,15 +361,14 @@ * Sets the email if it follows the syntax rules of valid e-mail addresses * according to * <a href="http://en.wikipedia.org/wiki/E-mail_address">http://en.wikipedia.org/wiki/E-mail_address</a>. - * + * * @param email * @return {@link JSBML#OPERATION_SUCCESS} */ public int setEmail(String email) { if ((email != null) && !SyntaxChecker.isValidEmailAddress(email.trim())) { String errorMessage = MessageFormat.format(resourceBundle.getString("Creator.setEmail"), email); - logger.warn(errorMessage); // TODO: Do we really need both: exception and error? - throw new IllegalArgumentException(errorMessage); + logger.warn(errorMessage); } String oldValue = this.email; this.email = email.trim(); @@ -379,7 +378,7 @@ /** * Sets the family name - * + * * @param familyName * @return {@link JSBML#OPERATION_SUCCESS} */ @@ -392,7 +391,7 @@ /** * Sets the given name - * + * * @param givenName * @return {@link JSBML#OPERATION_SUCCESS} */ @@ -405,7 +404,7 @@ /** * Sets the organisation - * + * * @param organisation */ public void setOrganisation(String organisation) { @@ -417,7 +416,7 @@ /** * Sets the organisation * <p>Equal to {@link #setOrganisation(String)}. - * + * * @param organization */ public void setOrganization(String organization) { @@ -425,7 +424,7 @@ } /** - * + * * @param attributeName * @param attributeValue * @deprecated those other attributes are not saved when writing the model @@ -439,7 +438,7 @@ } /** - * + * * @return * @deprecated those other attributes are not saved when writing the model */ @@ -453,7 +452,7 @@ } /** - * + * * @return * @deprecated those other attributes are not saved when writing the model */ @@ -463,7 +462,7 @@ } /** - * + * * @param attributeName * @return * @deprecated those other attributes are not saved when writing the model @@ -478,7 +477,7 @@ /** * Returns the information about the {@link Creator} as a {@link String}. - * + * * @return the information about the {@link Creator} as a {@link String}. */ @Override @@ -511,7 +510,7 @@ /** * Unsets the email of this {@link Creator}. - * + * * @return {@link JSBML#OPERATION_SUCCESS} */ public int unsetEmail() { @@ -523,7 +522,7 @@ /** * Unsets the familyName of this {@link Creator}. - * + * * @return {@link JSBML#OPERATION_SUCCESS} */ public int unsetFamilyName() { @@ -535,7 +534,7 @@ /** * Unsets the givenName of this {@link Creator}. - * + * * @return {@link JSBML#OPERATION_SUCCESS} */ public int unsetGivenName() { @@ -547,7 +546,7 @@ /** * Unsets the organisation of this {@link Creator}. - * + * */ public void unsetOrganization() { String oldValue = organisation; Modified: trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java =================================================================== --- trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java 2015-06-25 14:48:49 UTC (rev 2342) +++ trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java 2015-06-25 17:56:09 UTC (rev 2343) @@ -4,13 +4,13 @@ * ---------------------------------------------------------------------------- * 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-2015 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 - * + * * 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 @@ -35,7 +35,7 @@ * <p> * In order to save memory, all patterns in this class are only initialized * upon their first use. - * + * * @author Andreas Dräger * @version $Rev$ * @since 1.0 @@ -89,6 +89,8 @@ */ public static boolean isValidEmailAddress(String email) { if (syntaxChecker.emailPattern == null) { + //Does not handle non-printable unicode characters, and will return an error. The log error message will return a "?" + //for any non-printable unicode. Also the regex pattern to capture this is \\p{C}. syntaxChecker.emailPattern = Pattern.compile("^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$"); } return syntaxChecker.emailPattern.matcher(email).matches(); @@ -97,7 +99,7 @@ /** * Checks whether the given idCandidate is a valid identifier according to * the SBML specifications. - * + * * @param idCandidate * The {@link String} to be tested. * @param level @@ -151,7 +153,7 @@ /** * Checks if the given identifier candidate satisfies the requirements for a * valid meta identifier (see SBML L2V4 p. 12 for details). - * + * * @param idCandidate * @return {@code true} if the given argument is a valid meta identifier * {@link String}, {@code false} otherwise. @@ -224,7 +226,7 @@ } /** - * + * * @return */ private Set<String> getReservedNamesL1V1() { @@ -292,7 +294,7 @@ } /** - * + * */ private void initReservedNamesL1V2() { reservedNamesL1V2 = new TreeSet<String>(getReservedNamesL1V1()); @@ -300,7 +302,7 @@ } /** - * + * */ private void initSIdL2Pattern() { String underscore = "_"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-06-25 14:48:51
|
Revision: 2342 http://sourceforge.net/p/jsbml/code/2342 Author: niko-rodrigue Date: 2015-06-25 14:48:49 +0000 (Thu, 25 Jun 2015) Log Message: ----------- updated the ant build files so that two set of jars are generated, one using the old ASTNode and one using the new ASTNode facade Modified Paths: -------------- branches/astnode2-merging-alternate/build.xml branches/astnode2-merging-alternate/core/build.xml branches/astnode2-merging-alternate/pom.xml Added Paths: ----------- branches/astnode2-merging-alternate/jsbml-build.properties Modified: branches/astnode2-merging-alternate/build.xml =================================================================== --- branches/astnode2-merging-alternate/build.xml 2015-06-25 14:29:55 UTC (rev 2341) +++ branches/astnode2-merging-alternate/build.xml 2015-06-25 14:48:49 UTC (rev 2342) @@ -456,6 +456,23 @@ <fileset dir="${build.javadocs}/" includes="**/*"/> </copy> + <!-- generate the jars using the old ASTNode class --> + <property name="use.old.astnodes" value="true"/> + <!-- backup the jars using the new ASTNode class --> + <copy tofile="${dist.dir}/${name}-${version}-newASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" /> + <copy tofile="${dist.dir}/${name}-${version}-newASTNode.jar" file="${dist.dir}/${name}-${version}.jar" /> + <antcall target="jar" inheritrefs="true" inheritall="true"/> + <antcall target="bigjar" inheritrefs="true" inheritall="true"/> + <!-- rename and copy all jars, restore the jars using the new ASTNode class as the default --> + <copy tofile="${dist.root}/${name}-${version}-oldASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" /> + <copy tofile="${dist.root}/${name}-${version}-oldASTNode.jar" file="${dist.dir}/${name}-${version}.jar" /> + <copy tofile="${dist.dir}/${name}-${version}-oldASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" /> + <copy tofile="${dist.dir}/${name}-${version}-oldASTNode.jar" file="${dist.dir}/${name}-${version}.jar" /> + <copy file="${dist.dir}/${name}-${version}-newASTNode-with-dependencies.jar" tofile="${dist.dir}/${name}-${version}-with-dependencies.jar" overwrite="true"/> + <copy file="${dist.dir}/${name}-${version}-newASTNode.jar" tofile="${dist.dir}/${name}-${version}.jar" overwrite="true"/> + <delete file="${dist.dir}/${name}-${version}-newASTNode.jar" verbose="true"/> + <delete file="${dist.dir}/${name}-${version}-newASTNode-with-dependencies.jar" verbose="true"/> + <!-- Copy the source files --> <copy todir="${dist.dir}/src"> <fileset dir="${build.src}/" includes="**/*"/> Modified: branches/astnode2-merging-alternate/core/build.xml =================================================================== --- branches/astnode2-merging-alternate/core/build.xml 2015-06-25 14:29:55 UTC (rev 2341) +++ branches/astnode2-merging-alternate/core/build.xml 2015-06-25 14:48:49 UTC (rev 2342) @@ -201,8 +201,8 @@ if="${use.old.astnodes}" > <echo message="Building JSBML core using the old ASTNode class!"/> - <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java.newASTNode" overwrite="yes"/> - <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> + <copy file="${src.dir}/org/sbml/jsbml/ASTNode.java" tofile="${build.src}/org/sbml/jsbml/ASTNode.java.newASTNode" overwrite="yes"/> + <copy file="${src.dir}/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> <property name="version" value="${version}-oldASTNode"/> @@ -382,7 +382,7 @@ if="${use.old.astnodes}" > <echo message="Reverting JSBML core using the new ASTNode class!"/> - <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.newASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> + <copy file="${src.dir}/org/sbml/jsbml/ASTNode.java" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> <property name="version" value="${version}-oldASTNode"/> Added: branches/astnode2-merging-alternate/jsbml-build.properties =================================================================== --- branches/astnode2-merging-alternate/jsbml-build.properties (rev 0) +++ branches/astnode2-merging-alternate/jsbml-build.properties 2015-06-25 14:48:49 UTC (rev 2342) @@ -0,0 +1,7 @@ + +jsbml.Name=JSBML +jsbml.name=jsbml +jsbml.version=1.1-SNAPSHOT +jsbml.api.version=1.1 +jsbml.groupId=org.sbml.jsbml +jsbml.artifactId=jsbml-parent Modified: branches/astnode2-merging-alternate/pom.xml =================================================================== --- branches/astnode2-merging-alternate/pom.xml 2015-06-25 14:29:55 UTC (rev 2341) +++ branches/astnode2-merging-alternate/pom.xml 2015-06-25 14:48:49 UTC (rev 2342) @@ -31,6 +31,30 @@ <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <version>1.0-alpha-2</version> + <executions> + <execution> + <id>jsbml</id> + <phase>initialize</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>jsbml-build.properties</file> + </files> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <modules> <module>core</module> <module>extensions</module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-06-25 14:29:57
|
Revision: 2341 http://sourceforge.net/p/jsbml/code/2341 Author: niko-rodrigue Date: 2015-06-25 14:29:55 +0000 (Thu, 25 Jun 2015) Log Message: ----------- updated svn:ignore properties and small modifications of the pom.xml files while I was trying to set the version from a properties file Modified Paths: -------------- branches/astnode2-merging-alternate/modules/pom.xml branches/astnode2-merging-alternate/modules/tidy/pom.xml branches/astnode2-merging-alternate/modules/tidy/tidy-build.properties Property Changed: ---------------- branches/astnode2-merging-alternate/modules/celldesigner/ branches/astnode2-merging-alternate/modules/celldesigner/doc/ branches/astnode2-merging-alternate/modules/celldesigner/doc/api/ branches/astnode2-merging-alternate/modules/libSBMLio/ branches/astnode2-merging-alternate/modules/libSBMLio/doc/api/ branches/astnode2-merging-alternate/modules/tidy/ branches/astnode2-merging-alternate/modules/tidy/doc/ Index: branches/astnode2-merging-alternate/modules/celldesigner =================================================================== --- branches/astnode2-merging-alternate/modules/celldesigner 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/celldesigner 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/celldesigner ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,9 ## +dist +build +.classpath +.project +bin +jsbml.log +.apt_generated +.factorypath +.settings Index: branches/astnode2-merging-alternate/modules/celldesigner/doc =================================================================== --- branches/astnode2-merging-alternate/modules/celldesigner/doc 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/celldesigner/doc 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/celldesigner/doc ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +api Index: branches/astnode2-merging-alternate/modules/celldesigner/doc/api =================================================================== --- branches/astnode2-merging-alternate/modules/celldesigner/doc/api 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/celldesigner/doc/api 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/celldesigner/doc/api ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Index: branches/astnode2-merging-alternate/modules/libSBMLio =================================================================== --- branches/astnode2-merging-alternate/modules/libSBMLio 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/libSBMLio 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/libSBMLio ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,9 ## +dist +build +.classpath +.project +bin +jsbml.log +.apt_generated +.factorypath +.settings Index: branches/astnode2-merging-alternate/modules/libSBMLio/doc/api =================================================================== --- branches/astnode2-merging-alternate/modules/libSBMLio/doc/api 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/libSBMLio/doc/api 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/libSBMLio/doc/api ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Modified: branches/astnode2-merging-alternate/modules/pom.xml =================================================================== --- branches/astnode2-merging-alternate/modules/pom.xml 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/pom.xml 2015-06-25 14:29:55 UTC (rev 2341) @@ -28,7 +28,6 @@ <groupId>org.sbml.jsbml.modules</groupId> <artifactId>modules</artifactId> - <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <parent> @@ -62,7 +61,7 @@ </plugin> </plugins> </build> - + <repositories> <repository> <id>arbitrary</id> Index: branches/astnode2-merging-alternate/modules/tidy =================================================================== --- branches/astnode2-merging-alternate/modules/tidy 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/tidy 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/tidy ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,9 ## +dist +build +.classpath +.project +bin +jsbml.log +.apt_generated +.factorypath +.settings Index: branches/astnode2-merging-alternate/modules/tidy/doc =================================================================== --- branches/astnode2-merging-alternate/modules/tidy/doc 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/tidy/doc 2015-06-25 14:29:55 UTC (rev 2341) Property changes on: branches/astnode2-merging-alternate/modules/tidy/doc ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +api Modified: branches/astnode2-merging-alternate/modules/tidy/pom.xml =================================================================== --- branches/astnode2-merging-alternate/modules/tidy/pom.xml 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/tidy/pom.xml 2015-06-25 14:29:55 UTC (rev 2341) @@ -24,6 +24,7 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.sbml.jsbml.modules</groupId> <artifactId>modules</artifactId> @@ -31,11 +32,34 @@ <relativePath>../pom.xml</relativePath> </parent> - <groupId>org.sbml.jsbml.modules.tidy</groupId> + <groupId>org.sbml.jsbml.modules</groupId> <artifactId>jsbml_modules_tidy</artifactId> - <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <version>1.0-alpha-2</version> + <executions> + <execution> + <id>tidy</id> + <phase>initialize</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>tidy-build.properties</file> + </files> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> <dependency> <groupId>net.sf.jtidy</groupId> Modified: branches/astnode2-merging-alternate/modules/tidy/tidy-build.properties =================================================================== --- branches/astnode2-merging-alternate/modules/tidy/tidy-build.properties 2015-06-25 10:31:33 UTC (rev 2340) +++ branches/astnode2-merging-alternate/modules/tidy/tidy-build.properties 2015-06-25 14:29:55 UTC (rev 2341) @@ -1,4 +1,6 @@ tidy.Name=Tidy SBMLWriter tidy.name=jsbml-tidy -tidy.version=1.0 +tidy.version=1.1 +tidy.groupId=org.sbml.jsbml.modules +tidy.artifactId=jsbml_modules_tidy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-06-25 10:31:36
|
Revision: 2340 http://sourceforge.net/p/jsbml/code/2340 Author: niko-rodrigue Date: 2015-06-25 10:31:33 +0000 (Thu, 25 Jun 2015) Log Message: ----------- merged rev 2320 2321 2325 2326 2332 2333 into the astnode2 branch Revision Links: -------------- http://sourceforge.net/p/jsbml/code/2320 Modified Paths: -------------- branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractSBase.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CVTerm.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/SBase.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/parsers/XMLNodeWriter.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/test/PerformanceTestPureStax.java branches/astnode2-merging-alternate/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java Property Changed: ---------------- branches/astnode2-merging-alternate/ Index: branches/astnode2-merging-alternate =================================================================== --- branches/astnode2-merging-alternate 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate 2015-06-25 10:31:33 UTC (rev 2340) Property changes on: branches/astnode2-merging-alternate ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:2191,2194-2195,2197-2200,2202-2206,2209-2213,2216-2220,2222,2224-2244,2246-2248,2251-2262,2280,2293,2296-2297,2301-2305,2307-2310,2313,2318 +/trunk:2191,2194-2195,2197-2200,2202-2206,2209-2213,2216-2220,2222,2224-2244,2246-2248,2251-2262,2280,2293,2296-2297,2301-2305,2307-2310,2313,2318,2320-2321,2325-2326,2332-2333 \ No newline at end of property Modified: branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo =================================================================== --- branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2015-06-25 10:31:33 UTC (rev 2340) @@ -1,5 +1,5 @@ format-version: 1.2 -date: 14:05:2015 07:00 +date: 14:06:2015 07:00 data-version: 13:05:2015 13:49 saved-by: SBO community auto-generated-by: SBO Browser (http://www.ebi.ac.uk/sbo/) @@ -1066,19 +1066,6 @@ is_a: SBO:0000041 ! mass action rate law for irreversible reactions [Term] -id: SBO:0000231 -name: occurring entity representation -def: "Representation of an entity that manifests, unfolds or develops through time, such as a discrete event, or a mutual or reciprocal action or influence that happens between participating physical entities, and/or other occurring entities. " [src_code:NR] -comment: modified as part of ontology 'refactoring' process \[SF bug #3172586\]\nName changed to \"interaction\" on November 18 2008 by Nicolas Le Novere.\nDefinition changed to mention interaction with other interactions, in order to cover \"process\" and \"relationship\". -is_a: SBO:0000000 ! systems biology representation - -[Term] -id: SBO:0000232 -name: obsolete event -def: "A phenomenon that takes place and which may be observable, or may be determined to have occurred as the result of an action or process." [src_code:NR] -is_obsolete: true - -[Term] id: SBO:0000167 name: biochemical or transport reaction def: "An event involving one or more physical entities that modifies the structure, location or free energy of at least one of the participants." [src_code:NR] @@ -1517,6 +1504,19 @@ is_a: SBO:0000227 ! mass density of an entity [Term] +id: SBO:0000231 +name: occurring entity representation +def: "Representation of an entity that manifests, unfolds or develops through time, such as a discrete event, or a mutual or reciprocal action or influence that happens between participating physical entities, and/or other occurring entities. " [src_code:NR] +comment: modified as part of ontology 'refactoring' process \[SF bug #3172586\]\nName changed to \"interaction\" on November 18 2008 by Nicolas Le Novere.\nDefinition changed to mention interaction with other interactions, in order to cover \"process\" and \"relationship\". +is_a: SBO:0000000 ! systems biology representation + +[Term] +id: SBO:0000232 +name: obsolete event +def: "A phenomenon that takes place and which may be observable, or may be determined to have occurred as the result of an action or process." [src_code:NR] +is_obsolete: true + +[Term] id: SBO:0000233 name: hydroxylation def: "Addition of an hydroxyl group (-OH) to a chemical entity. " [src_code:NR] Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractSBase.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractSBase.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -1906,7 +1906,7 @@ * @see org.sbml.jsbml.SBase#setMetaId(java.lang.String) */ @Override - public void setMetaId(String metaId) { + public void setMetaId(String metaId) throws IllegalArgumentException { if (metaId != null) { if (isSetMetaId() && getMetaId().equals(metaId)) { /* Do nothing if the identical metaId has already been assigned to this Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CVTerm.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CVTerm.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/CVTerm.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -209,36 +209,7 @@ * @return */ public static Qualifier getBiologicalQualifierFor(String elementNameEquivalent) { - - if (elementNameEquivalent.equals(BQB_ENCODES)) { - return BQB_ENCODES; - } else if (elementNameEquivalent.equals(BQB_HAS_PART.nameEquivalent)) { - return BQB_HAS_PART; - } else if (elementNameEquivalent.equals(BQB_HAS_VERSION.nameEquivalent)) { - return BQB_HAS_VERSION; - } else if (elementNameEquivalent.equals(BQB_HAS_PROPERTY.nameEquivalent)) { - return BQB_HAS_PROPERTY; - } else if (elementNameEquivalent.equals(BQB_HAS_TAXON.nameEquivalent)) { - return BQB_HAS_TAXON; - } else if (elementNameEquivalent.equals(BQB_IS_PROPERTY_OF.nameEquivalent)) { - return BQB_IS_PROPERTY_OF; - } else if (elementNameEquivalent.equals(BQB_IS.nameEquivalent)) { - return BQB_IS; - } else if (elementNameEquivalent.equals(BQB_IS_DESCRIBED_BY.nameEquivalent)) { - return BQB_IS_DESCRIBED_BY; - } else if (elementNameEquivalent.equals(BQB_IS_ENCODED_BY.nameEquivalent)) { - return BQB_IS_ENCODED_BY; - } else if (elementNameEquivalent.equals(BQB_IS_HOMOLOG_TO.nameEquivalent)) { - return BQB_IS_HOMOLOG_TO; - } else if (elementNameEquivalent.equals(BQB_IS_PART_OF.nameEquivalent)) { - return BQB_IS_PART_OF; - } else if (elementNameEquivalent.equals(BQB_IS_VERSION_OF.nameEquivalent)) { - return BQB_IS_VERSION_OF; - } else if (elementNameEquivalent.equals(BQB_OCCURS_IN.nameEquivalent)) { - return BQB_OCCURS_IN; - } - - return BQB_UNKNOWN; + return getQualifierFor(elementNameEquivalent, "BQB_", BQB_UNKNOWN); } /** @@ -247,20 +218,23 @@ * @return */ public static Qualifier getModelQualifierFor(String elementNameEquivalent) { + return getQualifierFor(elementNameEquivalent, "BQM_", BQM_UNKNOWN); + } - if (elementNameEquivalent.equals(BQM_IS.nameEquivalent)) { - return BQM_IS; - } else if (elementNameEquivalent.equals(BQM_IS_DESCRIBED_BY.nameEquivalent)) { - return BQM_IS_DESCRIBED_BY; - } else if (elementNameEquivalent.equals(BQM_IS_DERIVED_FROM.nameEquivalent)) { - return BQM_IS_DERIVED_FROM; - } else if (elementNameEquivalent.equals(BQM_IS_INSTANCE_OF.nameEquivalent)) { - return BQM_IS_INSTANCE_OF; - } else if (elementNameEquivalent.equals(BQM_HAS_INSTANCE.nameEquivalent)) { - return BQM_HAS_INSTANCE; + /** + * @param elementNameEquivalent + * @param prefix + * @param unknownQualifier + * @return + */ + private static Qualifier getQualifierFor(String elementNameEquivalent, + String prefix, Qualifier unknownQualifier) { + for (Qualifier q : values()) { + if (q.name().startsWith(prefix) && q.getElementNameEquivalent().equals(elementNameEquivalent)) { + return q; + } } - - return BQM_UNKNOWN; + return unknownQualifier; } @@ -305,7 +279,9 @@ public boolean isModelQualifier() { return toString().startsWith("BQM_"); } + } + /** * This enum list all the possible MIRIAM qualifiers type. * Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/SBase.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/SBase.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/SBase.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -940,11 +940,14 @@ * * @param metaid * the meatId to be set. + * @throws IllegalArgumentException + * if the given metaid does not follow the pattern for valid metaids + * ore if it is already used in the {@link SBMLDocument} * @throws PropertyNotAvailableException * in SBML level 1, as this attribute was introduced only from SBML * level 2. */ - public void setMetaId(String metaid); + public void setMetaId(String metaid) throws IllegalArgumentException; /** * Sets the notes with 'notes'. Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -34,7 +34,6 @@ import org.sbml.jsbml.CallableSBase; import org.sbml.jsbml.Compartment; import org.sbml.jsbml.FunctionDefinition; -import org.sbml.jsbml.JSBML; import org.sbml.jsbml.SBMLException; import org.sbml.jsbml.SpeciesReference; import org.sbml.jsbml.util.StringTools; @@ -69,6 +68,11 @@ public class FormulaCompiler extends StringTools implements ASTNodeCompiler { /** + * + */ + public static final String FORMULA_ARGUMENT_SEPARATOR = ""; + + /** * Basic method which links several elements with a mathematical operator. * All empty StringBuffer object are excluded. * @@ -459,23 +463,42 @@ /** * Creates brackets if needed. * - * @param nodes + * @param node * @return * @throws SBMLException */ - protected String checkDenominatorBrackets(ASTNode nodes) throws SBMLException { - if ((nodes.getType() == Type.POWER) && (nodes.getChildCount() > 1) - && nodes.getRightChild().toString().equals("1")) { - return checkDenominatorBrackets(nodes.getLeftChild()); + protected String checkDenominatorBrackets(ASTNode node) throws SBMLException { + if ((node.getType() == Type.POWER) && (node.getChildCount() > 1) + && node.getRightChild().toString().equals("1")) { + return checkDenominatorBrackets(node.getLeftChild()); } - String term = nodes.compile(this).toString(); - if (nodes.isSum() || nodes.isDifference() || nodes.isUMinus() - || (nodes.getType() == Type.TIMES)) { + String term = node.compile(this).toString(); + if (node.isSum() || node.isDifference() || node.isUMinus() + || (node.getType() == Type.TIMES)) { term = brackets(term).toString(); } return term; } + /** + * Creates brackets if needed. + * + * @param node + * @return + * @throws SBMLException + */ + protected String checkRelationalArgumentBrackets(ASTNode node) throws SBMLException { + + String term = node.compile(this).toString(); + + if (node.isRelational() || node.isNumber() || node.isString() + || node.isFunction()) { + return term; + } + + return term = brackets(term).toString(); + } + /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#compile(org.sbml.jsbml.Compartment) */ @@ -954,8 +977,9 @@ protected String relation(ASTNode left, String symbol, ASTNode right) throws SBMLException { - return brackets(concat((left.isRelational()) ? brackets(left) : left, symbol, - (right.isRelational()) ? brackets(right) : right)).toString(); + return brackets(new StringBuffer().append(checkRelationalArgumentBrackets(left)) + .append(FORMULA_ARGUMENT_SEPARATOR).append(symbol).append(FORMULA_ARGUMENT_SEPARATOR) + .append(checkRelationalArgumentBrackets(right))).toString(); } /* (non-Javadoc) Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -28,7 +28,6 @@ import java.util.List; import java.util.Locale; -import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; @@ -41,6 +40,10 @@ import org.sbml.jsbml.SBase; import org.sbml.jsbml.util.StringTools; +import com.ctc.wstx.stax.WstxOutputFactory; + +//TODO: Let this implement the regular ASTNodeCompiler interface? + /** * Writes an {@link ASTNode} the mathML. * @@ -48,25 +51,6 @@ * @since 0.8 * @version $Rev$ */ -// TODO: Let this implement the regular ASTNodeCompiler interface. -/** - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ -/** - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ -/** - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ public class MathMLXMLStreamCompiler { /** @@ -119,7 +103,10 @@ * @throws XMLStreamException */ public MathMLXMLStreamCompiler(String indent) throws XMLStreamException { - SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory.newInstance()); + // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for + // OSGi to find the needed dependencies + WstxOutputFactory outputFactory = new WstxOutputFactory(); + SMOutputFactory smFactory = new SMOutputFactory(outputFactory); writer = smFactory.createStax2Writer(new StringWriter()); this.indent = indent; } @@ -143,8 +130,10 @@ String mathML = ""; StringWriter stream = new StringWriter(); - SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory - .newInstance()); + // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for + // OSGi to find the needed dependencies + WstxOutputFactory outputFactory = new WstxOutputFactory(); + SMOutputFactory smFactory = new SMOutputFactory(outputFactory); try { XMLStreamWriter writer = smFactory.createStax2Writer(stream); Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/parsers/XMLNodeWriter.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/parsers/XMLNodeWriter.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/parsers/XMLNodeWriter.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -23,15 +23,17 @@ import java.io.StringWriter; -import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.apache.log4j.Logger; +import org.codehaus.stax2.XMLStreamWriter2; import org.codehaus.staxmate.SMOutputFactory; import org.sbml.jsbml.util.StringTools; import org.sbml.jsbml.xml.XMLNode; +import com.ctc.wstx.stax.WstxOutputFactory; + /** * * @author Nicolas Rodriguez @@ -90,9 +92,12 @@ String xml = ""; StringWriter stream = new StringWriter(); - SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory.newInstance()); + // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for + // OSGi to find the needed dependencies + WstxOutputFactory outputFactory = new WstxOutputFactory(); + SMOutputFactory smFactory = new SMOutputFactory(outputFactory); + XMLStreamWriter2 writer = smFactory.createStax2Writer(stream); - XMLStreamWriter writer = smFactory.createStax2Writer(stream); // writer.writeCharacters("\n"); XMLNodeWriter xmlNodewriter = new XMLNodeWriter(writer, 0, 2, ' '); xmlNodewriter.write(xmlNode); Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -70,6 +70,7 @@ import com.ctc.wstx.stax.WstxInputFactory; + /** * Provides all the methods to read a SBML file. * @@ -82,7 +83,13 @@ */ public class SBMLReader { - + static { + // Making sure that we use the good XML library + System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); + System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); + System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); + } + /** * Contains all the initialized parsers. */ @@ -533,11 +540,6 @@ */ private Object readXMLFromXMLEventReader(XMLEventReader xmlEventReader, TreeNodeChangeListener listener) throws XMLStreamException { - // Making sure that we use the good XML library - System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); - System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); - System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); - initializePackageParsers(); XMLEvent event; Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -41,12 +41,10 @@ import java.util.TreeSet; import javax.swing.tree.TreeNode; -import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.apache.log4j.Logger; -import org.codehaus.stax2.XMLOutputFactory2; import org.codehaus.stax2.XMLStreamWriter2; import org.codehaus.staxmate.SMOutputFactory; import org.codehaus.staxmate.out.SMNamespace; @@ -74,6 +72,8 @@ import org.sbml.jsbml.xml.parsers.WritingParser; import org.sbml.jsbml.xml.parsers.XMLNodeWriter; +import com.ctc.wstx.stax.WstxOutputFactory; + /** * A SBMLWriter provides the methods to write a SBML file. * @@ -85,6 +85,13 @@ */ public class SBMLWriter { + static { + // Making sure that we use the good XML library + System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); + System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); + System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); + } + /** * Returns the default symbol to be used to indent new elements in the XML * representation of SBML data structures. @@ -177,7 +184,9 @@ afterRead = Calendar.getInstance().getTimeInMillis(); // testDocument.checkConsistency(); - // System.out.println(XMLNode.convertXMLNodeToString(testDocument.getModel().getAnnotation().getNonRDFannotation())); + + System.out.println("Model Notes = " + XMLNode.convertXMLNodeToString(testDocument.getModel().getNotes())); + System.out.println("MathML = " + testDocument.getModel().getReaction(0).getKineticLaw().getMath().toMathML()); System.out.println("Going to check package version and namespace for all elements."); PackageUtil.checkPackages(testDocument); @@ -538,26 +547,19 @@ // check package version and namespace in general and register packages if needed. PackageUtil.checkPackages(sbmlDocument, true, true); - // Making sure that we use the good XML library - System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); - System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); - System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); - initializePackageParsers(); - SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory.newInstance()); + // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for + // OSGi to find the needed dependencies + WstxOutputFactory factory = new WstxOutputFactory(); + SMOutputFactory smFactory = new SMOutputFactory(factory); XMLStreamWriter2 streamWriter = smFactory.createStax2Writer(stream); - // For this to work, the elements need to be completely empty (no whitespace or line return) - streamWriter.setProperty(XMLOutputFactory2.P_AUTOMATIC_EMPTY_ELEMENTS, Boolean.TRUE); - SMOutputDocument outputDocument = SMOutputFactory.createOutputDocument( streamWriter, "1.0", "UTF-8", false); // to have the automatic indentation working, we should probably only be using StaxMate classes and not directly StAX // outputDocument.setIndentation("\n ", 1, 1); - // TODO - check if we need to enable some packages - String SBMLNamespace = JSBML.getNamespaceFrom(sbmlDocument.getLevel(), sbmlDocument.getVersion()); SMOutputContext context = outputDocument.getContext(); @@ -687,13 +689,10 @@ } StringWriter stream = new StringWriter(); - SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory.newInstance()); - + WstxOutputFactory outputFactory = new WstxOutputFactory(); + SMOutputFactory smFactory = new SMOutputFactory(outputFactory); XMLStreamWriter2 writer = smFactory.createStax2Writer(stream); - - // For this to work, the elements need to be completely empty (no whitespace or line return) - writer.setProperty(XMLOutputFactory2.P_AUTOMATIC_EMPTY_ELEMENTS, Boolean.TRUE); - + // Create an xml fragment to avoid having the xml declaration SMRootFragment outputDocument = SMOutputFactory.createOutputFragment(writer); Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/test/PerformanceTestPureStax.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/test/PerformanceTestPureStax.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/test/PerformanceTestPureStax.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -31,6 +31,7 @@ import javax.xml.namespace.QName; import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.Attribute; import javax.xml.stream.events.Characters; @@ -43,8 +44,6 @@ import org.sbml.jsbml.SBMLException; import org.sbml.jsbml.util.TreeNodeChangeListener; -import com.ctc.wstx.stax.WstxInputFactory; - /** * * @author Nicolas Rodriguez @@ -143,11 +142,6 @@ */ public static void main(String[] args) throws SBMLException { - // Making sure that we use the good XML library - System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); - System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); - System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory"); - if (args.length < 1) { System.out.println("Usage: java org.sbml.jsbml.test.PerformanceTest sbmlFileName|folder"); System.exit(0); @@ -189,7 +183,9 @@ double globalInit = Calendar.getInstance().getTimeInMillis(); double globalEnd = 0; - WstxInputFactory inputFactory = new WstxInputFactory(); + XMLInputFactory inputFactory = XMLInputFactory.newFactory(); + + System.out.println("XMLInputFactory class = " + inputFactory.getClass().getName()); for (File file : files) { Modified: branches/astnode2-merging-alternate/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java =================================================================== --- branches/astnode2-merging-alternate/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2015-06-23 01:43:54 UTC (rev 2339) +++ branches/astnode2-merging-alternate/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2015-06-25 10:31:33 UTC (rev 2340) @@ -59,25 +59,24 @@ /** * */ - private static Tidy tidy = new Tidy(); // obtain a new Tidy instance + private static final transient Tidy tidy = new Tidy(); // obtain a new Tidy instance static { - // set desired configuration options using tidy setters - tidy.setXmlTags(true); + tidy.setDropEmptyParas(false); + tidy.setHideComments(false); tidy.setIndentContent(true); - tidy.setXmlOut(true); tidy.setInputEncoding("UTF-8"); tidy.setOutputEncoding("UTF-8"); - - tidy.setDropEmptyParas(false); - + tidy.setQuiet(true); tidy.setSmartIndent(true); + tidy.setTrimEmptyElements(true); + tidy.setWraplen(200); + tidy.setWrapAttVals(false); tidy.setWrapScriptlets(true); - tidy.setWraplen(200); - tidy.setSpaces(2); + tidy.setXmlOut(true); tidy.setXmlSpace(true); - tidy.setQuiet(true); + tidy.setXmlTags(true); } /** @@ -111,10 +110,23 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream } /** + * @param indentChar + * @param indentCount + */ + public static void setIndentation(char indentChar, short indentCount) { + if (indentChar == ' ') { + tidy.setSpaces(indentCount); + } else { + tidy.setTabsize(indentCount); + } + } + + /** * Writes the given SBML document to a {@link File}. * <p> * @@ -146,6 +158,7 @@ SBMLWriter sbmlWriter = new SBMLWriter(); String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream } @@ -189,6 +202,7 @@ sbmlWriter.setIndentationCount(indentCount); String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream } @@ -213,6 +227,7 @@ sbmlWriter.setIndentationCount(indentCount); String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream } @@ -244,6 +259,7 @@ SBMLWriter sbmlWriter = new SBMLWriter(); String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream } @@ -283,6 +299,7 @@ sbmlWriter.setIndentationCount(indentCount); String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream } @@ -318,6 +335,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); try { + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream } catch (IOException e) { throw new SBMLException(e); @@ -357,6 +375,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); try { + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream } catch (IOException e) { throw new SBMLException(e); @@ -405,6 +424,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); try { + setIndentation(indentChar, indentCount); tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream } catch (IOException e) { throw new SBMLException(e); @@ -518,6 +538,7 @@ { String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream } @@ -546,6 +567,7 @@ { String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream } @@ -579,6 +601,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); try { + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream } catch (IOException e) { throw new SBMLException(e); @@ -613,6 +636,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); try { + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream } catch (IOException e) { throw new SBMLException(e); @@ -672,6 +696,7 @@ String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); StringWriter stringWriter = new StringWriter(); + setIndentation(' ', (short) 2); tidy.parse(new StringReader(sbmlDocString), stringWriter); // run tidy, providing an input and output stream return stringWriter.toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-06-23 01:43:56
|
Revision: 2339 http://sourceforge.net/p/jsbml/code/2339 Author: kofiav Date: 2015-06-23 01:43:54 +0000 (Tue, 23 Jun 2015) Log Message: ----------- ASTLogarithmNode now automatically sets type to FUNCTION_LN when a child of type CONSTANT_E is added. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTLogarithmNode.java branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTLogarithmNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTLogarithmNode.java 2015-06-23 00:38:46 UTC (rev 2338) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/ASTLogarithmNode.java 2015-06-23 01:43:54 UTC (rev 2339) @@ -122,7 +122,7 @@ ASTFactory.setParentSBMLObject(child, parentSBMLObject); child.setParent(this); child.fireNodeAddedEvent(); - if (child.getType() == Type.CONSTANT_E && getChildCount() == 0) { + if (child.getType() == Type.CONSTANT_E && getChildCount() == 1) { setType(Type.FUNCTION_LN); } } Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-06-23 00:38:46 UTC (rev 2338) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2015-06-23 01:43:54 UTC (rev 2339) @@ -1273,7 +1273,7 @@ public void testFloorCaseInsensitive() { boolean status = false; try { - ASTNode floor = ASTNode.parseFormula("Floor(-x)", caseSensitiveParser); + ASTNode floor = ASTNode.parseFormula("Floor(-x)", caseInsensitiveParser); status = (floor.getType() == ASTNode.Type.FUNCTION_FLOOR) && (floor.getType() != ASTNode.Type.FUNCTION); System.out.println(status + "" + floor.getType()); if (status) { @@ -1360,17 +1360,18 @@ */ @Test public void testLnCaseInsensitive() { + // TODO: this test case needs to be fixed boolean status = false; try { ASTNode ln = ASTNode.parseFormula("Ln(1000)", caseInsensitiveParser); status = (ln.getType() == ASTNode.Type.FUNCTION_LN) && (ln.getType() != ASTNode.Type.FUNCTION); if (status) { -// ASTNode base = ln.getChild(0); -// status = (base.getType() == ASTNode.Type.CONSTANT_E); -// if (status) { - ASTNode n = ln.getChild(0); - status = (n.getType() == ASTNode.Type.INTEGER) && (n.getInteger() == 1000); -// } + ASTNode base = ln.getLeftChild(); + status = (base.getType() == ASTNode.Type.CONSTANT_E); + if (status) { + ASTNode n = ln.getRightChild(); + status = (n.getType() == ASTNode.Type.INTEGER) && (n.getInteger() == 1000); + } } } catch (Exception e) { e.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |