public void setUp()
 {
     C = new  CompartmentType(2,2);
       if (C == null);
       {
       }
 }
Пример #2
0
        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);
       {
       }
 }
Пример #4
0
        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);
        }
Пример #5
0
 CompartmentType(CompartmentType orig) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_2(CompartmentType.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #6
0
        CompartmentType clone()
        {
            IntPtr          cPtr = libsbmlPINVOKE.CompartmentType_clone(swigCPtr);
            CompartmentType ret  = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true);

            return(ret);
        }
Пример #7
0
 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);
        }
Пример #10
0
        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);
        }
Пример #11
0
 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;
 }
Пример #12
0
        internal static HandleRef getCPtrAndDisown(CompartmentType obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
                ptr             = obj.swigCPtr;
                obj.swigCMemOwn = false;
            }

            return(ptr);
        }
Пример #13
0
 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 );
 }
Пример #14
0
 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;
 }
Пример #17
0
 /**
    * 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&nbsp;2 Versions&nbsp;2&ndash;4.  It is not available in
    * Level&nbsp;1 nor Level&nbsp;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;
 }
Пример #20
0
 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;
 }
Пример #22
0
 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;
 }
Пример #23
0
 internal static HandleRef getCPtr(CompartmentType obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Пример #24
0
 /**
    * 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();
 }
Пример #25
0
 internal static HandleRef getCPtr(CompartmentType obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #26
0
        internal static HandleRef getCPtrAndDisown(CompartmentType obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }