public void setUp() { SR = new SpeciesReference(2,4); if (SR == null); { } }
public void setUp() { sr = new SpeciesReference(2,4); if (sr == null); { } }
SpeciesReference clone() { SpeciesReference ret = (SpeciesReference)libsbml.DowncastSBase(libsbmlPINVOKE.SpeciesReference_clone(swigCPtr), true); return(ret); }
SpeciesReference(SpeciesReference orig) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_2(SpeciesReference.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } }
SpeciesReference clone() { IntPtr cPtr = libsbmlPINVOKE.SpeciesReference_clone(swigCPtr); SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, true); return(ret); }
public void test_SpeciesReference_setDenominator2() { SpeciesReference c = new SpeciesReference(2,2); int i = c.setDenominator(4); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( c.getDenominator() == 4 ); c = null; }
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; }
internal static HandleRef getCPtrAndDisown(SpeciesReference obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return(ptr); }
public void test_SpeciesReference_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,1); sbmlns.addNamespaces(xmlns); SpeciesReference object1 = new SpeciesReference(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_SPECIES_REFERENCE ); assertTrue( object1.getMetaId() == "" ); assertTrue( object1.getNotes() == null ); assertTrue( object1.getAnnotation() == null ); assertTrue( object1.getLevel() == 2 ); assertTrue( object1.getVersion() == 1 ); assertTrue( object1.getNamespaces() != null ); assertTrue( object1.getNamespaces().getLength() == 2 ); object1 = null; }
public void test_Reaction_addProduct1() { Reaction m = new Reaction(2,2); SpeciesReference p = new SpeciesReference(2,2); SpeciesReference p1 = new SpeciesReference(2,2); p1.setSpecies( "k"); p1.setId( "k1"); int i = m.addProduct(p); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); p.setSpecies( "k"); p.setId( "k1"); i = m.addProduct(p); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumProducts() == 1 ); i = m.addProduct(p1); assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID ); assertTrue( m.getNumProducts() == 1 ); p = null; p1 = null; m = null; }
public void tearDown() { SR = null; }
public void test_SpeciesReference_setId3() { SpeciesReference c = new SpeciesReference(2,1); int i = c.setId( "cell"); c = null; }
public void test_L3_SpeciesReference_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); SpeciesReference sr = new SpeciesReference(sbmlns); assertTrue( sr.getTypeCode() == libsbml.SBML_SPECIES_REFERENCE ); assertTrue( sr.getMetaId() == "" ); assertTrue( sr.getNotes() == null ); assertTrue( sr.getAnnotation() == null ); assertTrue( sr.getLevel() == 3 ); assertTrue( sr.getVersion() == 1 ); assertTrue( sr.getNamespaces() != null ); assertTrue( sr.getNamespaces().getLength() == 2 ); assertTrue( sr.getId() == "" ); assertTrue( sr.getName() == "" ); assertTrue( sr.getSpecies() == "" ); assertEquals( true, isnan(sr.getStoichiometry()) ); assertTrue( sr.getConstant() == false ); assertEquals( false, sr.isSetId() ); assertEquals( false, sr.isSetName() ); assertEquals( false, sr.isSetSpecies() ); assertEquals( false, sr.isSetStoichiometry() ); assertEquals( false, sr.isSetConstant() ); sr = null; }
internal static HandleRef getCPtr(SpeciesReference obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
/** * Adds a given SpeciesReference object as a reactant in this Reaction. * * The SpeciesReference instance in @p sr is copied. * * @param sr a SpeciesReference object referring to a Species in the * enclosing Model * * * @return integer value indicating success/failure of the * function. @if clike The value is drawn from the * enumeration #OperationReturnValues_t. @endif The possible values * returned by this function are: * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink * * * @note This method should be used with some caution. The fact that this * method @em copies the object passed to it means that the caller will be * left holding a physically different object instance than the one contained * inside this object. Changes made to the original object instance (such as * resetting attribute values) will <em>not affect the instance in this * object</em>. In addition, the caller should make sure to free the * original object if it is no longer being used, or else a memory leak will * result. Please see other methods on this class (particularly a * corresponding method whose name begins with the word <code>create</code>) * for alternatives that do not lead to these issues. * * * * @see createReactant() */ public int addReactant(SpeciesReference sr) { int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_0(swigCPtr, SpeciesReference.getCPtr(sr)); return ret; }
internal static HandleRef getCPtrAndDisown(SpeciesReference obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
/** * Copy constructor; creates a copy of this SpeciesReference. * * @param orig the SpeciesReference instance to copy. * * @throws SBMLConstructorException * Thrown if the argument @p orig is @c null. */ public SpeciesReference(SpeciesReference orig) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_2(SpeciesReference.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
public void test_Reaction_addProduct3() { Reaction m = new Reaction(2,2); SpeciesReference p = new SpeciesReference(1,2); p.setSpecies( "k"); int i = m.addProduct(p); assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH ); assertTrue( m.getNumProducts() == 0 ); p = null; m = null; }
public void test_Reaction_addReactant2() { Reaction m = new Reaction(2,2); SpeciesReference p = new SpeciesReference(2,1); p.setSpecies( "k"); int i = m.addReactant(p); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( m.getNumReactants() == 0 ); p = null; m = null; }
public void test_SpeciesReference() { SpeciesReference sr = new SpeciesReference(2,4); assertEquals( true, sr.hasRequiredElements() ); sr = null; }
public void test_SpeciesReference_constructor() { SBase s; try { s = new SpeciesReference(1,1); s = new SpeciesReference(1,2); s = new SpeciesReference(2,1); s = new SpeciesReference(2,2); s = new SpeciesReference(2,3); s = new SpeciesReference(2,4); s = new SpeciesReference(SN11); s = new SpeciesReference(SN12); s = new SpeciesReference(SN21); s = new SpeciesReference(SN22); s = new SpeciesReference(SN23); s = new SpeciesReference(SN24); } catch (SBMLConstructorException e) { s = null; } assertTrue(s != null); string msg = ""; try { s = new SpeciesReference(99,99); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); }
/// <summary> /// /// </summary> /// <param name="aSpeciesReference"></param> /// <returns></returns> public static string GetStoichiometryMath(SpeciesReference aSpeciesReference) { string aString_R = null; if (aSpeciesReference.isSetStoichiometryMath()) { ASTNode anASTNode_R = aSpeciesReference.getStoichiometryMath().getMath(); aString_R = libsbml.libsbml.formulaToString(anASTNode_R); } return aString_R; }
public void test_StoichiometryMath_parent_add() { StoichiometryMath m = new StoichiometryMath(2,4); SpeciesReference sr = new SpeciesReference(2,4); sr.setStoichiometryMath(m); m = null; assertTrue( sr == sr.getStoichiometryMath().getParentSBMLObject() ); sr = null; }
public void test_internal_consistency_check_99921() { SBMLDocument d = new SBMLDocument(2,4); long errors; SpeciesReference sr = new SpeciesReference(2,4); d.setLevelAndVersion(2,1,false); Model m = d.createModel(); Compartment c = m.createCompartment(); c.setId("c"); Species s = m.createSpecies(); s.setId("s"); Reaction r = m.createReaction(); r.setId("r"); s.setCompartment("c"); sr.setSpecies("s"); sr.setName("mmm"); r.addReactant(sr); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_SpeciesReference_Reactant_parent_add() { SpeciesReference sr = new SpeciesReference(2,4); Reaction r = new Reaction(2,4); sr.setSpecies("s"); r.addReactant(sr); sr = null; ListOf lo = r.getListOfReactants(); assertTrue( lo == r.getReactant(0).getParentSBMLObject() ); assertTrue( r == lo.getParentSBMLObject() ); }
internal static HandleRef getCPtr(SpeciesReference obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public void test_SpeciesReference() { SpeciesReference sr = new SpeciesReference(2,4); assertEquals( false, (sr.hasRequiredAttributes()) ); sr.setSpecies("sr"); assertEquals( true, sr.hasRequiredAttributes() ); sr = null; }
public int addProduct(SpeciesReference sr) { int ret = libsbmlPINVOKE.Reaction_addProduct(swigCPtr, SpeciesReference.getCPtr(sr)); return ret; }
public void test_SpeciesReference_assignmentOperator() { SpeciesReference o1 = new SpeciesReference(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); SpeciesReference o2 = new SpeciesReference(2,4); o2 = o1; assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void tearDown() { sr = null; }
public void test_SpeciesReference_copyConstructor() { SpeciesReference o1 = new SpeciesReference(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); SpeciesReference o2 = new SpeciesReference(o1); assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
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(( "R1" == sr1.getSpecies() )); assertTrue(( "R2" == sr2.getSpecies() )); }
public void test_L3_SpeciesReference_hasRequiredAttributes() { SpeciesReference sr = new SpeciesReference(3,1); assertEquals( false, sr.hasRequiredAttributes() ); sr.setSpecies( "id"); assertEquals( false, sr.hasRequiredAttributes() ); sr.setConstant(false); assertEquals( true, sr.hasRequiredAttributes() ); sr = null; }
public void test_Reaction_getReactantById() { SpeciesReference sr1 = new SpeciesReference(2,4); sr1.setSpecies( "R1"); SpeciesReference sr2 = new SpeciesReference(2,4); sr2.setSpecies( "R2"); R.addReactant(sr1); R.addReactant(sr2); assertTrue( R.getNumReactants() == 2 ); assertTrue( R.getNumProducts() == 0 ); assertTrue( R.getNumModifiers() == 0 ); assertNotEquals(R.getReactant( "R1"),sr1); assertNotEquals(R.getReactant( "R2"),sr2); assertEquals(R.getReactant( "R3"),null); sr1 = null; sr2 = null; }
public void test_SpeciesReference_setStoichiometryMath5() { SpeciesReference sr1 = new SpeciesReference(1,2); StoichiometryMath sm = new StoichiometryMath(2,4); ASTNode math = new ASTNode(libsbml.AST_TIMES); ASTNode a = new ASTNode(); ASTNode b = new ASTNode(); a.setName( "a"); b.setName( "b"); math.addChild(a); math.addChild(b); sm.setMath(math); int i = sr1.setStoichiometryMath(sm); assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE ); assertEquals( false, sr1.isSetStoichiometryMath() ); sm = null; sr1 = null; }