Package org.sbml.jsbml

Examples of org.sbml.jsbml.SpeciesReference


    if (initialAssignment.isSetVariable()) {
      String variableID = initialAssignment.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);

        if (species == null) {
          parameter = model.getParameter(variableID);

          if (parameter == null) {
            if (model.isSetListOfReactions()) {

              int i = 0;
              SpeciesReference sr = null;

              while (i <= model.getReactionCount() - 1
                  && sr == null) {
                Reaction reaction = model.getReaction(i);
View Full Code Here


    if (rule.isSetVariable()) {
      String variableID = rule.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);

        if (species == null) {
          parameter = model.getParameter(variableID);

          if (parameter == null) {
            if (model.isSetListOfReactions()) {

              int i = 0;
              SpeciesReference sr = null;

              while (i <= model.getReactionCount() - 1
                  && sr == null) {
                Reaction reaction = model.getReaction(i);
View Full Code Here

          setReactionCompartment(reaction, model);

          if (reaction.isSetListOfReactants()) {
            for (int j = 0; j < reaction.getReactantCount(); j++) {
              SpeciesReference speciesReference = reaction
                  .getReactant(j);

              setSpeciesReferenceSpecies(speciesReference, model);
            }
          }
          if (reaction.isSetListOfProducts()) {
            for (int j = 0; j < reaction.getProductCount(); j++) {
              SpeciesReference speciesReference = reaction
                  .getProduct(j);

              setSpeciesReferenceSpecies(speciesReference, model);
            }
          }
View Full Code Here

          } else if (list.getParentSBMLObject() instanceof Reaction) {
            Reaction reaction = (Reaction) list
                .getParentSBMLObject();

            if (elementName.equals("specieReference")) {
              SpeciesReference speciesReference = (SpeciesReference) newContextObject;

              if (list.getSBaseListType().equals(
                  ListOf.Type.listOfReactants)) {
                reaction.addReactant(speciesReference);
View Full Code Here

    if (rule.isSetVariable()) {
      String variableID = rule.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);

        if (species == null) {
          parameter = model.getParameter(variableID);

          if (parameter == null) {
            if (model.isSetListOfReactions()) {

              int i = 0;
              SpeciesReference sr = null;

              while (i <= model.getReactionCount() - 1
                  && sr == null) {
                Reaction reaction = model.getReaction(i);
View Full Code Here

    assertTrue( R.getNumModifiers() == 1 );
  }

  @Test public void test_Reaction_addProduct()
  {
    SpeciesReference sr = new  SpeciesReference(2,4);
    sr.setSpecies( "s");
    R.addProduct(sr);
    assertTrue( R.getNumReactants() == 0 );
    assertTrue( R.getNumProducts() == 1 );
    assertTrue( R.getNumModifiers() == 0 );
    sr = null;
View Full Code Here

    sr = null;
  }

  @Test public void test_Reaction_addReactant()
  {
    SpeciesReference sr = new  SpeciesReference(2,4);
    sr.setSpecies( "s");
    R.addReactant(sr);
    assertTrue( R.getNumReactants() == 1 );
    assertTrue( R.getNumProducts() == 0 );
    assertTrue( R.getNumModifiers() == 0 );
    sr = null;
View Full Code Here

    msr2 = null;
  }

  @Test public void test_Reaction_getProduct()
  {
    SpeciesReference sr1 = new  SpeciesReference(2,4);
    SpeciesReference sr2 = new  SpeciesReference(2,4);
    sr1.setSpecies( "P1");
    sr2.setSpecies( "P2");
    R.addProduct(sr1);
    R.addProduct(sr2);
    sr1 = null;
    sr2 = null;
    assertTrue( R.getNumReactants() == 0 );
    assertTrue( R.getNumProducts() == 2 );
    assertTrue( R.getNumModifiers() == 0 );
    sr1 = R.getProduct(0);
    sr2 = R.getProduct(1);
    assertTrue(sr1.getSpecies().equals( "P1"));
    assertTrue(sr2.getSpecies().equals( "P2"));
  }
View Full Code Here

    assertTrue(sr2.getSpecies().equals( "P2"));
  }

  @Test public void test_Reaction_getProductById()
  {
    SpeciesReference sr1 = new  SpeciesReference(2,4);
    sr1.setSpecies( "P1");
    SpeciesReference sr2 = new  SpeciesReference(2,4);
    sr2.setSpecies( "P1");
    R.addProduct(sr1);
    R.addProduct(sr2);
    assertTrue( R.getNumReactants() == 0 );
    assertTrue( R.getNumProducts() == 2 );
    assertTrue( R.getNumModifiers() == 0 );
View Full Code Here

    sr2 = null;
  }

  @Test public void test_Reaction_getReactant()
  {
    SpeciesReference sr1 = new  SpeciesReference(2,4);
    SpeciesReference sr2 = new  SpeciesReference(2,4);
    sr1.setSpecies( "R1");
    sr2.setSpecies( "R2");
    R.addReactant(sr1);
    R.addReactant(sr2);
    sr1 = null;
    sr2 = null;
    assertTrue( R.getNumReactants() == 2 );
    assertTrue( R.getNumProducts() == 0 );
    assertTrue( R.getNumModifiers() == 0 );
    sr1 = R.getReactant(0);
    sr2 = R.getReactant(1);
    assertTrue(sr1.getSpecies().equals( "R1"));
    assertTrue(sr2.getSpecies().equals( "R2"));
  }
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.SpeciesReference

Copyright © 2018 www.massapicom. 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.