Examples of SBase


Examples of org.sbml.jsbml.SBase

      List<SBase> variables, int level) {
    // found node with species 
    if ((node.getChildCount() == 0) && (node.isString()) && (node.getType() != Type.NAME_TIME) && (node.getType() != Type.NAME_AVOGADRO)) {
      if (!node.isConstant()) {       
        if (param == null) {
          SBase variable=node.getVariable();
          if (level==1) {
            int insertingPosition=0;
            for(SBase element:variables) {
              if (!(element instanceof Parameter) || (!((Parameter)element).isSetValue())) {
                insertingPosition++;
              }
            }
            variables.add(insertingPosition, variable);
          }
          else {
            variables.add(variable);
          }
        } else {
          if (!param.contains(node.getVariable())) {
            SBase variable=node.getVariable();
            if (level==1) {
              int insertingPosition=0;
              for(SBase element:variables) {
                if (!(element instanceof Parameter) || (!((Parameter)element).isSetValue())) {
                  insertingPosition++;
View Full Code Here

Examples of org.sbml.jsbml.SBase

          annotationDeepness++;
        }
        else if (currentNode.getLocalPart().equals("notes"))
        {
          // get the sbml namespace as some element can have similar names in different namespaces
          SBase firstElement = (SBase) sbmlElements.firstElement();
         
          if (firstElement instanceof SBMLDocument) {
            SBMLDocument sbmlDoc = (SBMLDocument) firstElement;
            String sbmlNamespace = sbmlDoc.getSBMLDocumentNamespaces().get("xmlns");
View Full Code Here

Examples of org.sbml.jsbml.SBase

    // A SBMLCoreParser can modify a contextObject which is an instance of
    // SBase.
    // Try to read the attributes.
    if (contextObject instanceof SBase) {
      SBase sbase = (SBase) contextObject;
      try {
        isAttributeRead = sbase.readAttribute(attributeName, prefix,
            value);
      } catch (Throwable exc) {
        log4jLogger.error(exc.getMessage());
        log4jLogger.info("Attribute = " + attributeName + ", element = " + elementName);
      }
View Full Code Here

Examples of org.sbml.jsbml.SBase

      sbmlDocument.addNamespace(localName, prefix, URI);
     
      log4jLogger.debug("processNamespace: " + prefix + " = " + URI);
    }
    else if (contextObject instanceof SBase) {
      SBase sbase = (SBase) contextObject;
     
      if (prefix != null && prefix.length() > 0) {
        sbase.addDeclaredNamespace(prefix + ":" + localName, URI);
      } else {
        sbase.addDeclaredNamespace(localName, URI);
      }

      log4jLogger.debug("processNamespace: " + prefix + " = " + URI);
    }
    else if (contextObject instanceof Annotation) {
      Annotation sbase = (Annotation) contextObject;
      sbase.addAnnotationNamespace(localName, prefix, URI);
     
      log4jLogger.debug("processNamespace: " + prefix + " = " + URI);
    }
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

              (SBase) contextObject);
        }

        if (elementName.equals("notes")
            && (contextObject instanceof SBase)) {
          SBase sbase = (SBase) contextObject;
          sbase.setNotes(new XMLNode(new XMLTriple("notes", null, null), new XMLAttributes()));
        } else if (elementName.equals("annotation")
            && (contextObject instanceof SBase)) {
          SBase sbase = (SBase) contextObject;
          Annotation annotation = (Annotation) newContextObject;
          sbase.setAnnotation(annotation);

          return annotation;
        } else if (contextObject instanceof SBMLDocument) {
          SBMLDocument sbmlDocument = (SBMLDocument) contextObject;
          if (elementName.equals("model")) {
View Full Code Here

Examples of org.sbml.jsbml.SBase

   * @param newContextObject
   * @param parent
   */
  private void setLevelAndVersionFor(Object newContextObject, SBase parent) {
    if (newContextObject instanceof SBase) {
      SBase sb = (SBase) newContextObject;
      // Level and version will be -1 if not set, so we don't
      // have to check.
      sb.setLevel(parent.getLevel());
      sb.setVersion(parent.getVersion());
    }
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

   * @see org.sbml.jsbml.xml.WritingParser#writeAttributes(SBMLObjectForXML xmlObject, Object sbmlElementToWrite)
   */
  public void writeAttributes(SBMLObjectForXML xmlObject,
      Object sbmlElementToWrite) {
    if (sbmlElementToWrite instanceof SBase) {
      SBase sbase = (SBase) sbmlElementToWrite;
      xmlObject.addAttributes(sbase.writeXMLAttributes());
    }
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

   */
  public void writeElement(SBMLObjectForXML xmlObject, Object sbmlElementToWrite)
  {
   
    if (sbmlElementToWrite instanceof SBase) {
      SBase sbase = (SBase) sbmlElementToWrite;
     
      log4jLogger.debug("writeElement: " + sbase.getElementName());

      if (!xmlObject.isSetName()) {
        xmlObject.setName(sbase.getElementName());
      }
    }
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

   */
  public void writeNamespaces(SBMLObjectForXML xmlObject,
      Object sbmlElementToWrite)
  {
    if (sbmlElementToWrite instanceof SBase) {
      SBase sbase = (SBase) sbmlElementToWrite;

      if (sbase.getDeclaredNamespaces().size() > 0)
      {
        xmlObject.addAttributes(sbase.getDeclaredNamespaces());
      }
     
      if (sbase instanceof SBMLDocument) {
       
        SBMLDocument sbmlDocument = (SBMLDocument) sbmlElementToWrite;

        xmlObject.addAttributes(sbmlDocument
            .getSBMLDocumentNamespaces());
      }

      xmlObject.setPrefix("");
      xmlObject.setNamespace(JSBML.getNamespaceFrom(sbase.getLevel(), sbase.getVersion()));
    }
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

  /* (non-Javadoc)
   * @see org.sbml.jsbml.util.Filter#accepts(java.lang.Object)
   */
  public boolean accepts(Object o) {
    if ((terms != null) && (terms.length > 0) && (o instanceof SBase)) {
      SBase sbase = (SBase) o;
      for (int i = 0; sbase.isSetSBOTerm() && (i < terms.length); i++) {
        if (SBO.isChildOf(sbase.getSBOTerm(), terms[i])) {
          return true;
        }
      }
    }
    return 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.