public void setUp() { C = new CompartmentType(2,2); if (C == null); { } }
CompartmentType get(long n) { IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_get__SWIG_0(swigCPtr, n); CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, false); return(ret); }
public void setUp() { CT = new CompartmentType(2,4); if (CT == null); { } }
CompartmentType remove(long n) { IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_remove__SWIG_0(swigCPtr, n); CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true); return(ret); }
CompartmentType(CompartmentType orig) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_2(CompartmentType.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } }
CompartmentType clone() { IntPtr cPtr = libsbmlPINVOKE.CompartmentType_clone(swigCPtr); CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true); return(ret); }
public void test_CompartmentType_copyConstructor() { CompartmentType o1 = new CompartmentType(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); CompartmentType o2 = new CompartmentType(o1); assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_CompartmentType_parent_add() { CompartmentType ct = new CompartmentType(2,4); Model m = new Model(2,4); ct.setId("ct"); m.addCompartmentType(ct); ct = null; ListOf lo = m.getListOfCompartmentTypes(); assertTrue( lo == m.getCompartmentType(0).getParentSBMLObject() ); assertTrue( m == lo.getParentSBMLObject() ); }
CompartmentType get(string sid) { global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_get__SWIG_2(swigCPtr, sid); CompartmentType ret = (cPtr == global::System.IntPtr.Zero) ? null : new CompartmentType(cPtr, false); if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
CompartmentType remove(string sid) { IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_remove__SWIG_1(swigCPtr, sid); CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true); if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public void test_CompartmentType_assignmentOperator() { CompartmentType o1 = new CompartmentType(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); CompartmentType o2 = new CompartmentType(2,4); o2 = o1; assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
internal static HandleRef getCPtrAndDisown(CompartmentType obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return(ptr); }
public void test_CompartmentType_ancestor_add() { CompartmentType ct = new CompartmentType(2,4); Model m = new Model(2,4); ct.setId("ct"); m.addCompartmentType(ct); ct = null; ListOf lo = m.getListOfCompartmentTypes(); CompartmentType obj = m.getCompartmentType(0); assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m ); assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo ); assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null ); assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null ); }
public void test_CompartmentType_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,2); sbmlns.addNamespaces(xmlns); CompartmentType object1 = new CompartmentType(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_COMPARTMENT_TYPE ); assertTrue( object1.getMetaId() == "" ); assertTrue( object1.getNotes() == null ); assertTrue( object1.getAnnotation() == null ); assertTrue( object1.getLevel() == 2 ); assertTrue( object1.getVersion() == 2 ); assertTrue( object1.getNamespaces() != null ); assertTrue( object1.getNamespaces().getLength() == 2 ); object1 = null; }
public void test_CompartmentType_constructor() { SBase s; try { s = new CompartmentType(2,2); s = new CompartmentType(2,3); s = new CompartmentType(2,4); s = new CompartmentType(SN22); s = new CompartmentType(SN23); s = new CompartmentType(SN24); } catch (SBMLConstructorException e) { s = null; } assertTrue(s != null); string msg = ""; try { s = new CompartmentType(1,1); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(1,2); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(2,1); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(9,9); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(SN11); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(SN12); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(SN21); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new CompartmentType(SN99); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); }
public void test_CompartmentType() { CompartmentType ct = new CompartmentType(2,4); assertEquals( true, ct.hasRequiredElements() ); ct = null; }
/** * Adds a copy of the given CompartmentType object to this Model. * * @param ct the CompartmentType object to add * * * @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. * * * * @note The CompartmentType object class is only available in SBML * Level 2 Versions 2–4. It is not available in * Level 1 nor Level 3. * * @see createCompartmentType() */ public int addCompartmentType(CompartmentType ct) { int ret = libsbmlPINVOKE.Model_addCompartmentType(swigCPtr, CompartmentType.getCPtr(ct)); return ret; }
public void test_CompartmentType() { CompartmentType ct = new CompartmentType(2,4); assertEquals( false, (ct.hasRequiredAttributes()) ); ct.setId("c"); assertEquals( true, ct.hasRequiredAttributes() ); ct = null; }
public void test_internal_consistency_check_99908() { SBMLDocument d = new SBMLDocument(2,4); long errors; CompartmentType ct = new CompartmentType(2,4); Model m = d.createModel(); d.setLevelAndVersion(2,1,false); ct.setId("ct"); m.addCompartmentType(ct); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_Model_addCompartmentType2() { Model m = new Model(2,2); CompartmentType ct = new CompartmentType(2,3); ct.setId( "ct"); int i = m.addCompartmentType(ct); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( m.getNumCompartmentTypes() == 0 ); ct = null; m = null; }
public void tearDown() { C = null; }
public void test_Model_addCompartmentType4() { Model m = new Model(2,2); CompartmentType ct = new CompartmentType(2,2); ct.setId( "ct"); CompartmentType ct1 = new CompartmentType(2,2); ct1.setId( "ct"); int i = m.addCompartmentType(ct); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumCompartmentTypes() == 1 ); i = m.addCompartmentType(ct1); assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID ); assertTrue( m.getNumCompartmentTypes() == 1 ); ct = null; ct1 = null; m = null; }
internal static HandleRef getCPtr(CompartmentType obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
/** * Copy constructor; creates a copy of this CompartmentType. * * @param orig the object to copy. * * @throws @if python ValueError @else SBMLConstructorException @endif * Thrown if the argument @p orig is @c null. */ public CompartmentType(CompartmentType orig) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_2(CompartmentType.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(CompartmentType obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static HandleRef getCPtrAndDisown(CompartmentType obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }