LocalParameter(LocalParameter orig) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_2(LocalParameter.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } }
public void test_L3_LocalParameter_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); LocalParameter p = new LocalParameter(sbmlns); assertTrue( p.getTypeCode() == libsbml.SBML_LOCAL_PARAMETER ); assertTrue( p.getMetaId() == "" ); assertTrue( p.getNotes() == null ); assertTrue( p.getAnnotation() == null ); assertTrue( p.getLevel() == 3 ); assertTrue( p.getVersion() == 1 ); assertTrue( p.getNamespaces() != null ); assertTrue( p.getNamespaces().getLength() == 2 ); assertTrue( p.getId() == "" ); assertTrue( p.getName() == "" ); assertTrue( p.getUnits() == "" ); assertEquals( true, double.IsNaN(p.getValue()) ); assertEquals( false, p.isSetId() ); assertEquals( false, p.isSetName() ); assertEquals( false, p.isSetValue() ); assertEquals( false, p.isSetUnits() ); p = null; }
LocalParameter clone() { IntPtr cPtr = libsbmlPINVOKE.LocalParameter_clone(swigCPtr); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, true); return(ret); }
public void setUp() { P = new LocalParameter(3,1); if (P == null); { } }
Parameter remove(long n) { IntPtr cPtr = libsbmlPINVOKE.ListOfLocalParameters_remove__SWIG_0(swigCPtr, n); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, true); return(ret); }
Parameter get(long n) { IntPtr cPtr = libsbmlPINVOKE.ListOfLocalParameters_get__SWIG_0(swigCPtr, n); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, false); return(ret); }
LocalParameter removeLocalParameter(long n) { IntPtr cPtr = libsbmlPINVOKE.KineticLaw_removeLocalParameter__SWIG_0(swigCPtr, n); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, true); return(ret); }
LocalParameter createLocalParameter() { IntPtr cPtr = libsbmlPINVOKE.KineticLaw_createLocalParameter(swigCPtr); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, false); return(ret); }
Parameter remove(string sid) { IntPtr cPtr = libsbmlPINVOKE.ListOfLocalParameters_remove__SWIG_1(swigCPtr, sid); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, true); if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
LocalParameter getLocalParameter(string sid) { IntPtr cPtr = libsbmlPINVOKE.KineticLaw_getLocalParameter__SWIG_2(swigCPtr, sid); LocalParameter ret = (cPtr == IntPtr.Zero) ? null : new LocalParameter(cPtr, false); if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
Parameter get(string sid) { global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfLocalParameters_get__SWIG_2(swigCPtr, sid); LocalParameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new LocalParameter(cPtr, false); if (libsbmlPINVOKE.SWIGPendingException.Pending) { throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal static HandleRef getCPtrAndDisown(LocalParameter obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return(ptr); }
/** * Copy constructor; creates a copy of a given LocalParameter object. * * @param orig the LocalParameter instance to copy. * * @throws SBMLConstructorException * Thrown if the argument @p orig is @c null. */ public LocalParameter(LocalParameter orig) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_2(LocalParameter.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(LocalParameter obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
public void test_L3_LocalParameter_hasRequiredAttributes() { LocalParameter p = new LocalParameter(3,1); assertEquals( false, p.hasRequiredAttributes() ); p.setId( "id"); assertEquals( true, p.hasRequiredAttributes() ); p = null; }
public void tearDown() { P = null; }
public void test_LocalParameter_constructor() { SBase s; try { s = new LocalParameter(3,1); s = new LocalParameter(SN31); } catch (SBMLConstructorException e) { s = null; } assertTrue(s != null); string msg = ""; try { s = new LocalParameter(9,9); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new LocalParameter(SN21); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new LocalParameter(SN99); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); }
/** * Adds a copy of the given LocalParameter object to the list of local * parameters in this KineticLaw. * * @param p the LocalParameter 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. * * * * @see createLocalParameter() */ public int addLocalParameter(LocalParameter p) { int ret = libsbmlPINVOKE.KineticLaw_addLocalParameter(swigCPtr, LocalParameter.getCPtr(p)); return ret; }
int addLocalParameter(LocalParameter p) { int ret = libsbmlPINVOKE.KineticLaw_addLocalParameter(swigCPtr, LocalParameter.getCPtr(p)); return(ret); }
internal static HandleRef getCPtr(LocalParameter obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static HandleRef getCPtrAndDisown(LocalParameter obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
public void test_L3_KineticLaw_addParameter2() { KineticLaw kl = new KineticLaw(3,1); LocalParameter lp = new LocalParameter(3,1); LocalParameter lp1 = new LocalParameter(3,1); int i = kl.addLocalParameter(lp); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); lp.setId( "p"); lp1.setId( "p1"); i = kl.addLocalParameter(lp); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( kl.getNumParameters() == 1 ); assertTrue( kl.getNumLocalParameters() == 1 ); i = kl.addParameter(lp1); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( kl.getNumParameters() == 2 ); assertTrue( kl.getNumLocalParameters() == 2 ); lp = null; kl = null; }