addSpeciesType() 공개 메소드

public addSpeciesType ( SpeciesType st ) : int
st SpeciesType
리턴 int
예제 #1
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;
 }
예제 #2
0
 public void test_Model_addSpeciesType3()
 {
     Model m = new  Model(2,2);
       SpeciesType st = null;
       int i = m.addSpeciesType(st);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumSpeciesTypes() == 0 );
       m = null;
 }
예제 #3
0
 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() );
 }
예제 #4
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;
 }
예제 #5
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 );
 }