setMultiplier() public method

public setMultiplier ( double value ) : int
value double
return int
Exemplo n.º 1
0
 public void test_L3_Unit_hasRequiredAttributes()
 {
     Unit u = new  Unit(3,1);
       assertEquals( false, u.hasRequiredAttributes() );
       u.setKind(libsbml.UNIT_KIND_MOLE);
       assertEquals( false, u.hasRequiredAttributes() );
       u.setExponent(0);
       assertEquals( false, u.hasRequiredAttributes() );
       u.setMultiplier(0.45);
       assertEquals( false, u.hasRequiredAttributes() );
       u.setScale(2);
       assertEquals( true, u.hasRequiredAttributes() );
       u = null;
 }
Exemplo n.º 2
0
 public void test_Unit_setMultiplier2()
 {
     Unit c = new  Unit(2,2);
       int i = c.setMultiplier(4);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( c.getMultiplier() == 4 );
       c = null;
 }
 public void test_internal_consistency_check_99924()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Unit u = new Unit(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("cc");
       UnitDefinition ud = m.createUnitDefinition();
       ud.setId("ud");
       u.setKind(libsbml.UNIT_KIND_MOLE);
       u.setMultiplier(9);
       ud.addUnit(u);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Exemplo n.º 4
0
 public void test_Unit_set_get()
 {
     Unit u = new  Unit(2,4);
       assertTrue( u.getKind() == libsbml.UNIT_KIND_INVALID );
       assertTrue( u.getExponent() == 1 );
       assertTrue( u.getScale() == 0 );
       assertTrue( u.getMultiplier() == 1.0 );
       assertEquals( false, u.isSetKind() );
       u.setKind(libsbml.UNIT_KIND_WATT);
       assertTrue( u.getKind() == libsbml.UNIT_KIND_WATT );
       u.setExponent(3);
       assertTrue( u.getExponent() == 3 );
       u.setScale(4);
       assertTrue( u.getScale() == 4 );
       u.setMultiplier(3.2);
       assertTrue( u.getMultiplier() == 3.2 );
       u = null;
 }