Examples of MathContainer


Examples of org.sbml.jsbml.MathContainer

    {
      isFunctionDefinition = false;
    }
    lastElementWasApply = false;
   
    MathContainer mathContainer = null;
    ASTNode parentASTNode = null;
    boolean setMath = false;
   
    if (contextObject instanceof MathContainer) {
      mathContainer = (MathContainer) contextObject;
      if (mathContainer.getMath() == null) {
        setMath = true;
      } else {
        // because normal operator are written <operator/> in mathML and so the parent ASTNode is not any more the contextObject
        parentASTNode = mathContainer.getMath();
        // System.out.println("MathMLStaxParser: processStartElement parent type: " + parentASTNode.getType());
      }
    } else if (contextObject instanceof ASTNode) {
     
      parentASTNode = ((ASTNode) contextObject);
      mathContainer = parentASTNode.getParentSBMLObject();
      // System.out.println("MathMLStaxParser: processStartElement parent type: " + parentASTNode.getType());
    } else {
      // Should never happen
      logger.debug("processStartElement: !!!!!!!!!!! Should not have been here !!!!!!!!!!!");
      logger.debug("processStartElement: contextObject.classname = " + contextObject.getClass().getName());
      return null;
    }
   
    ASTNode astNode = new ASTNode(mathContainer);
    astNode.setType(elementName);
   
    if (setMath) {
      mathContainer.setMath(astNode);
    } else {
      parentASTNode.addChild(astNode);
    }
   
    /*else if (astNode.isNumber() || astNode.isConstant() || astNode.getType().equals(ASTNode.Type.NAME)
View Full Code Here

Examples of org.sbml.jsbml.MathContainer

            // make sure that we'll have line breaks if an element has any sub elements.
            elementIsNested = true;
          }
        }
        if (nextObjectToWrite instanceof MathContainer) {
          MathContainer mathContainer = (MathContainer) nextObjectToWrite;
          if (mathContainer.getLevel() > 1) {
            writeMathML(mathContainer, newOutPutElement,
                streamWriter, indent + indentCount);
            elementIsNested = true;
          }
          isClosedMathContainer = true;
View Full Code Here

Examples of org.sbml.jsbml.MathContainer

        || elementName.equals("bvar") || elementName.equals("degree") || elementName.equals("logbase")) {
      // we do nothing
      return null;
    }
   
    MathContainer mathContainer = null;
    ASTNode parentASTNode = null;
    boolean setMath = false;
   
    if (contextObject instanceof MathContainer) {
      mathContainer = (MathContainer) contextObject;
      if (mathContainer.getMath() == null) {
        setMath = true;
      } else {
        // because normal operator are written <operator/> in mathML and so the parent ASTNode is not any more the contextObject
        parentASTNode = mathContainer.getMath();
        // System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
      }
    } else if (contextObject instanceof ASTNode) {
     
      parentASTNode = ((ASTNode) contextObject);
      mathContainer = parentASTNode.getParentSBMLObject();
      // System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
    } else {
      // Should never happen
      logger.debug("processStartElement : !!!!!!!!!!! Should not have been here !!!!!!!!!!!");
      logger.debug("processStartElement : contextObject.classname = " + contextObject.getClass().getName());
      return null;
    }
   
    ASTNode astNode = new ASTNode(mathContainer);
    astNode.setType(elementName);
   
    if (setMath) {
      mathContainer.setMath(astNode);
    } else {
      parentASTNode.addChild(astNode);
    }
   
    /*else if (astNode.isNumber() || astNode.isConstant() || astNode.getType().equals(ASTNode.Type.NAME)
View Full Code Here

Examples of org.sbml.jsbml.MathContainer

    {
      isFunctionDefinition = false;
    }
    lastElementWasApply = false;
   
    MathContainer mathContainer = null;
    ASTNode parentASTNode = null;
    boolean setMath = false;
   
    if (contextObject instanceof MathContainer) {
      mathContainer = (MathContainer) contextObject;
      if (mathContainer.getMath() == null) {
        setMath = true;
      } else {
        // because normal operator are written <operator/> in mathML and so the parent ASTNode is not any more the contextObject
        parentASTNode = mathContainer.getMath();
        // System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
      }
    } else if (contextObject instanceof ASTNode) {
     
      parentASTNode = ((ASTNode) contextObject);
      mathContainer = parentASTNode.getParentSBMLObject();
      // System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
    } else {
      // Should never happen
      logger.debug("processStartElement : !!!!!!!!!!! Should not have been here !!!!!!!!!!!");
      logger.debug("processStartElement : contextObject.classname = " + contextObject.getClass().getName());
      return null;
    }
   
    ASTNode astNode = new ASTNode(mathContainer);
    astNode.setType(elementName);
   
    if (setMath) {
      mathContainer.setMath(astNode);
    } else {
      parentASTNode.addChild(astNode);
    }
   
    /*else if (astNode.isNumber() || astNode.isConstant() || astNode.getType().equals(ASTNode.Type.NAME)
View Full Code Here

Examples of org.sbml.jsbml.MathContainer

                    indent + indentCount);
                elementIsNested = true;
              }
            }
            if (nextObjectToWrite instanceof MathContainer) {
              MathContainer mathContainer = (MathContainer) nextObjectToWrite;
              if (mathContainer.getLevel() > 1) {
                writeMathML(mathContainer, newOutPutElement,
                    streamWriter, indent + indentCount);
                elementIsNested = true;
              } else {
                elementIsNested = false;
View Full Code Here

Examples of org.sbml.jsbml.MathContainer

                    indent + indentCount);
                elementIsNested = true;
              }
            }
            if (nextObjectToWrite instanceof MathContainer) {
              MathContainer mathContainer = (MathContainer) nextObjectToWrite;
              if (mathContainer.getLevel() > 1) {
                writeMathML(mathContainer, newOutPutElement,
                    streamWriter, indent + indentCount);
                elementIsNested = true;
              } else {
                elementIsNested = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.