public void setUp()
 {
     ST = new  SpeciesType(2,2);
       if (ST == null);
       {
       }
 }
Exemplo n.º 2
0
 SpeciesType(SpeciesType orig) : this(libsbmlPINVOKE.new_SpeciesType__SWIG_2(SpeciesType.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 3
0
        SpeciesType clone()
        {
            IntPtr      cPtr = libsbmlPINVOKE.SpeciesType_clone(swigCPtr);
            SpeciesType ret  = (cPtr == IntPtr.Zero) ? null : new SpeciesType(cPtr, true);

            return(ret);
        }
 public void setUp()
 {
     CT = new  SpeciesType(2,4);
       if (CT == null);
       {
       }
 }
        SpeciesType remove(long n)
        {
            IntPtr      cPtr = libsbmlPINVOKE.ListOfSpeciesTypes_remove__SWIG_0(swigCPtr, n);
            SpeciesType ret  = (cPtr == IntPtr.Zero) ? null : new SpeciesType(cPtr, true);

            return(ret);
        }
        SpeciesType get(long n)
        {
            IntPtr      cPtr = libsbmlPINVOKE.ListOfSpeciesTypes_get__SWIG_0(swigCPtr, n);
            SpeciesType ret  = (cPtr == IntPtr.Zero) ? null : new SpeciesType(cPtr, false);

            return(ret);
        }
        SpeciesType remove(string sid)
        {
            IntPtr      cPtr = libsbmlPINVOKE.ListOfSpeciesTypes_remove__SWIG_1(swigCPtr, sid);
            SpeciesType ret  = (cPtr == IntPtr.Zero) ? null : new SpeciesType(cPtr, true);

            if (libsbmlPINVOKE.SWIGPendingException.Pending)
            {
                throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        SpeciesType get(string sid)
        {
            global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfSpeciesTypes_get__SWIG_2(swigCPtr, sid);
            SpeciesType           ret  = (cPtr == global::System.IntPtr.Zero) ? null : new SpeciesType(cPtr, false);

            if (libsbmlPINVOKE.SWIGPendingException.Pending)
            {
                throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 9
0
        internal static HandleRef getCPtrAndDisown(SpeciesType obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

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

            return(ptr);
        }
Exemplo n.º 10
0
 public void test_SpeciesType_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,2);
       sbmlns.addNamespaces(xmlns);
       SpeciesType object1 = new  SpeciesType(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_SPECIES_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_SpeciesType()
 {
     SpeciesType st = new SpeciesType(2,4);
       assertEquals( true, st.hasRequiredElements() );
       st = null;
 }
Exemplo n.º 12
0
        internal static HandleRef getCPtrAndDisown(SpeciesType obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

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

            return ptr;
        }
Exemplo n.º 13
0
 internal static HandleRef getCPtr(SpeciesType obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Exemplo n.º 14
0
 /**
    * Copy constructor; creates a copy of this SpeciesType.
    *
    * @param orig the object to copy.
    */
 public SpeciesType(SpeciesType orig)
     : this(libsbmlPINVOKE.new_SpeciesType__SWIG_2(SpeciesType.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
Exemplo n.º 15
0
 /**
    * Adds a copy of the given SpeciesType object to this Model.
    *
    * @param st the SpeciesType 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 SpeciesType 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 createSpeciesType()
    */
 public int addSpeciesType(SpeciesType st)
 {
     int ret = libsbmlPINVOKE.Model_addSpeciesType(swigCPtr, SpeciesType.getCPtr(st));
     return ret;
 }
Exemplo n.º 16
0
 internal static HandleRef getCPtr(SpeciesType obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
 public void test_internal_consistency_check_99922()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       SpeciesType ct = new SpeciesType(2,4);
       Model m = d.createModel();
       ct.setId("st");
       d.setLevelAndVersion(2,1,false);
       m.addSpeciesType(ct);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Exemplo n.º 18
0
 public void test_Model_addSpeciesType2()
 {
     Model m = new  Model(2,2);
       SpeciesType st = new  SpeciesType(2,3);
       st.setId( "st");
       int i = m.addSpeciesType(st);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumSpeciesTypes() == 0 );
       st = null;
       m = null;
 }
 public void test_SpeciesType_parent_add()
 {
     SpeciesType ia = new SpeciesType(2,4);
       ia.setId("s");
       Model m = new Model(2,4);
       m.addSpeciesType(ia);
       ia = null;
       ListOf lo = m.getListOfSpeciesTypes();
       assertTrue( lo == m.getSpeciesType(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
Exemplo n.º 20
0
 public void test_SpeciesType_ancestor_add()
 {
     SpeciesType ia = new SpeciesType(2,4);
       Model m = new Model(2,4);
       ia.setId("s");
       m.addSpeciesType(ia);
       ia = null;
       ListOf lo = m.getListOfSpeciesTypes();
       SpeciesType obj = m.getSpeciesType(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 );
 }
Exemplo n.º 21
0
 public void tearDown()
 {
     CT = null;
 }
Exemplo n.º 22
0
 public void test_Model_addSpeciesType4()
 {
     Model m = new  Model(2,2);
       SpeciesType st = new  SpeciesType(2,2);
       st.setId( "st");
       SpeciesType st1 = new  SpeciesType(2,2);
       st1.setId( "st");
       int i = m.addSpeciesType(st);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumSpeciesTypes() == 1 );
       i = m.addSpeciesType(st1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumSpeciesTypes() == 1 );
       st = null;
       st1 = null;
       m = null;
 }
Exemplo n.º 23
0
 public void test_SpeciesType_copyConstructor()
 {
     SpeciesType o1 = new SpeciesType(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesType o2 = new SpeciesType(o1);
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
 public void test_SpeciesType()
 {
     SpeciesType st = new SpeciesType(2,4);
       assertEquals( false, (st.hasRequiredAttributes()) );
       st.setId("st");
       assertEquals( true, st.hasRequiredAttributes() );
       st = null;
 }
        public void test_SpeciesType_constructor()
        {
            SBase s;

              try
              {
            s = new SpeciesType(2,2);
            s = new SpeciesType(2,3);
            s = new SpeciesType(2,4);
            s = new SpeciesType(SN22);
            s = new SpeciesType(SN23);
            s = new SpeciesType(SN24);
              }
              catch (SBMLConstructorException e)
              {
             s = null;
              }
              assertTrue(s != null);

              string msg = "";

              try
              {
            s = new SpeciesType(1,1);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(1,2);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(2,1);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(9,9);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(SN11);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(SN12);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(SN21);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new SpeciesType(SN99);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);
        }
Exemplo n.º 26
0
 public void test_SpeciesType_assignmentOperator()
 {
     SpeciesType o1 = new SpeciesType(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesType o2 = new SpeciesType(2,4);
       o2 = o1;
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }