001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * <span class="pkg-marker pkg-color-qual"><a href="group__qual.html">qual</a></span> 013 014 The default result of a {@link Transition}. 015 <p> 016 * The {@link DefaultTerm} defines the default result of a {@link Transition}, held in the 017 * (required) 'resultLevel' attribute. This term is 018 * used when there are no other {@link FunctionTerm} elements or when none of the Math 019 * elements of the {@link FunctionTerm} elements evaluate to <code>true.</code> 020 */ 021 022public class DefaultTerm extends SBase { 023 private long swigCPtr; 024 025 protected DefaultTerm(long cPtr, boolean cMemoryOwn) 026 { 027 super(libsbmlJNI.DefaultTerm_SWIGUpcast(cPtr), cMemoryOwn); 028 swigCPtr = cPtr; 029 } 030 031 protected static long getCPtr(DefaultTerm obj) 032 { 033 return (obj == null) ? 0 : obj.swigCPtr; 034 } 035 036 protected static long getCPtrAndDisown (DefaultTerm obj) 037 { 038 long ptr = 0; 039 040 if (obj != null) 041 { 042 ptr = obj.swigCPtr; 043 obj.swigCMemOwn = false; 044 } 045 046 return ptr; 047 } 048 049 protected void finalize() { 050 delete(); 051 } 052 053 public synchronized void delete() { 054 if (swigCPtr != 0) { 055 if (swigCMemOwn) { 056 swigCMemOwn = false; 057 libsbmlJNI.delete_DefaultTerm(swigCPtr); 058 } 059 swigCPtr = 0; 060 } 061 super.delete(); 062 } 063 064 065/** 066 * Creates a new {@link DefaultTerm} with the given level, version, and package version. 067 <p> 068 * @param level a long integer, the SBML Level to assign to this {@link DefaultTerm}. 069 <p> 070 * @param version a long integer, the SBML Version to assign to this {@link DefaultTerm}. 071 <p> 072 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link DefaultTerm}. 073 <p> 074 * <p> 075 * @note Attempting to add an object to an {@link SBMLDocument} having a different 076 * combination of SBML Level, Version and XML namespaces than the object 077 * itself will result in an error at the time a caller attempts to make the 078 * addition. A parent object must have compatible Level, Version and XML 079 * namespaces. (Strictly speaking, a parent may also have more XML 080 * namespaces than a child, but the reverse is not permitted.) The 081 * restriction is necessary to ensure that an SBML model has a consistent 082 * overall structure. This requires callers to manage their objects 083 * carefully, but the benefit is increased flexibility in how models can be 084 * created by permitting callers to create objects bottom-up if desired. In 085 * situations where objects are not yet attached to parents (e.g., 086 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 087 * libSBML determine such things as whether it is valid to assign a 088 * particular value to an attribute. For packages, this means that the 089 * parent object to which this package element is being added must have 090 * been created with the package namespace, or that the package namespace 091 * was added to it, even if that parent is not a package object itself. 092 */ public 093 DefaultTerm(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 094 this(libsbmlJNI.new_DefaultTerm__SWIG_0(level, version, pkgVersion), true); 095 } 096 097 098/** 099 * Creates a new {@link DefaultTerm} with the given level, version, and package version. 100 <p> 101 * @param level a long integer, the SBML Level to assign to this {@link DefaultTerm}. 102 <p> 103 * @param version a long integer, the SBML Version to assign to this {@link DefaultTerm}. 104 <p> 105 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link DefaultTerm}. 106 <p> 107 * <p> 108 * @note Attempting to add an object to an {@link SBMLDocument} having a different 109 * combination of SBML Level, Version and XML namespaces than the object 110 * itself will result in an error at the time a caller attempts to make the 111 * addition. A parent object must have compatible Level, Version and XML 112 * namespaces. (Strictly speaking, a parent may also have more XML 113 * namespaces than a child, but the reverse is not permitted.) The 114 * restriction is necessary to ensure that an SBML model has a consistent 115 * overall structure. This requires callers to manage their objects 116 * carefully, but the benefit is increased flexibility in how models can be 117 * created by permitting callers to create objects bottom-up if desired. In 118 * situations where objects are not yet attached to parents (e.g., 119 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 120 * libSBML determine such things as whether it is valid to assign a 121 * particular value to an attribute. For packages, this means that the 122 * parent object to which this package element is being added must have 123 * been created with the package namespace, or that the package namespace 124 * was added to it, even if that parent is not a package object itself. 125 */ public 126 DefaultTerm(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 127 this(libsbmlJNI.new_DefaultTerm__SWIG_1(level, version), true); 128 } 129 130 131/** 132 * Creates a new {@link DefaultTerm} with the given level, version, and package version. 133 <p> 134 * @param level a long integer, the SBML Level to assign to this {@link DefaultTerm}. 135 <p> 136 * @param version a long integer, the SBML Version to assign to this {@link DefaultTerm}. 137 <p> 138 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link DefaultTerm}. 139 <p> 140 * <p> 141 * @note Attempting to add an object to an {@link SBMLDocument} having a different 142 * combination of SBML Level, Version and XML namespaces than the object 143 * itself will result in an error at the time a caller attempts to make the 144 * addition. A parent object must have compatible Level, Version and XML 145 * namespaces. (Strictly speaking, a parent may also have more XML 146 * namespaces than a child, but the reverse is not permitted.) The 147 * restriction is necessary to ensure that an SBML model has a consistent 148 * overall structure. This requires callers to manage their objects 149 * carefully, but the benefit is increased flexibility in how models can be 150 * created by permitting callers to create objects bottom-up if desired. In 151 * situations where objects are not yet attached to parents (e.g., 152 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 153 * libSBML determine such things as whether it is valid to assign a 154 * particular value to an attribute. For packages, this means that the 155 * parent object to which this package element is being added must have 156 * been created with the package namespace, or that the package namespace 157 * was added to it, even if that parent is not a package object itself. 158 */ public 159 DefaultTerm(long level) throws org.sbml.libsbml.SBMLConstructorException { 160 this(libsbmlJNI.new_DefaultTerm__SWIG_2(level), true); 161 } 162 163 164/** 165 * Creates a new {@link DefaultTerm} with the given level, version, and package version. 166 <p> 167 * @param level a long integer, the SBML Level to assign to this {@link DefaultTerm}. 168 <p> 169 * @param version a long integer, the SBML Version to assign to this {@link DefaultTerm}. 170 <p> 171 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link DefaultTerm}. 172 <p> 173 * <p> 174 * @note Attempting to add an object to an {@link SBMLDocument} having a different 175 * combination of SBML Level, Version and XML namespaces than the object 176 * itself will result in an error at the time a caller attempts to make the 177 * addition. A parent object must have compatible Level, Version and XML 178 * namespaces. (Strictly speaking, a parent may also have more XML 179 * namespaces than a child, but the reverse is not permitted.) The 180 * restriction is necessary to ensure that an SBML model has a consistent 181 * overall structure. This requires callers to manage their objects 182 * carefully, but the benefit is increased flexibility in how models can be 183 * created by permitting callers to create objects bottom-up if desired. In 184 * situations where objects are not yet attached to parents (e.g., 185 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 186 * libSBML determine such things as whether it is valid to assign a 187 * particular value to an attribute. For packages, this means that the 188 * parent object to which this package element is being added must have 189 * been created with the package namespace, or that the package namespace 190 * was added to it, even if that parent is not a package object itself. 191 */ public 192 DefaultTerm() throws org.sbml.libsbml.SBMLConstructorException { 193 this(libsbmlJNI.new_DefaultTerm__SWIG_3(), true); 194 } 195 196 197/** 198 * Creates a new {@link DefaultTerm} with the given {@link QualPkgNamespaces} object. 199 <p> 200 * <p> 201 * The package namespaces object used in this constructor is derived from a 202 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 203 * information. It is used to communicate the SBML Level, Version, and 204 * package version and name information used in addition to SBML Level 3 Core. A 205 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 206 * package namespace object somewhere in a program once, then hand that object 207 * as needed to object constructors of that package that accept it as and 208 * argument, such as this one. 209 <p> 210 * @param qualns the {@link QualPkgNamespaces} object. 211 <p> 212 * <p> 213 * @note Attempting to add an object to an {@link SBMLDocument} having a different 214 * combination of SBML Level, Version and XML namespaces than the object 215 * itself will result in an error at the time a caller attempts to make the 216 * addition. A parent object must have compatible Level, Version and XML 217 * namespaces. (Strictly speaking, a parent may also have more XML 218 * namespaces than a child, but the reverse is not permitted.) The 219 * restriction is necessary to ensure that an SBML model has a consistent 220 * overall structure. This requires callers to manage their objects 221 * carefully, but the benefit is increased flexibility in how models can be 222 * created by permitting callers to create objects bottom-up if desired. In 223 * situations where objects are not yet attached to parents (e.g., 224 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 225 * libSBML determine such things as whether it is valid to assign a 226 * particular value to an attribute. For packages, this means that the 227 * parent object to which this package element is being added must have 228 * been created with the package namespace, or that the package namespace 229 * was added to it, even if that parent is not a package object itself. 230 */ public 231 DefaultTerm(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 232 this(libsbmlJNI.new_DefaultTerm__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 233 } 234 235 236/** 237 * Copy constructor for {@link DefaultTerm}. 238 <p> 239 * @param orig the {@link DefaultTerm} instance to copy. 240 */ public 241 DefaultTerm(DefaultTerm orig) throws org.sbml.libsbml.SBMLConstructorException { 242 this(libsbmlJNI.new_DefaultTerm__SWIG_5(DefaultTerm.getCPtr(orig), orig), true); 243 } 244 245 246/** 247 * Creates and returns a deep copy of this {@link DefaultTerm} object. 248 <p> 249 * @return a (deep) copy of this {@link DefaultTerm} object. 250 */ public 251 DefaultTerm cloneObject() { 252 long cPtr = libsbmlJNI.DefaultTerm_cloneObject(swigCPtr, this); 253 return (cPtr == 0) ? null : new DefaultTerm(cPtr, true); 254 } 255 256 257/** 258 * Returns the value of the 'resultLevel' attribute of this {@link DefaultTerm}. 259 <p> 260 * @return the value of the 'resultLevel' attribute of this {@link DefaultTerm} as a integer. 261 */ public 262 int getResultLevel() { 263 return libsbmlJNI.DefaultTerm_getResultLevel(swigCPtr, this); 264 } 265 266 267/** 268 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 269 * {@link DefaultTerm}'s 'resultLevel' attribute has been set. 270 <p> 271 * @return <code>true</code> if this {@link DefaultTerm}'s 'resultLevel' attribute has been set, 272 * otherwise <code>false</code> is returned. 273 */ public 274 boolean isSetResultLevel() { 275 return libsbmlJNI.DefaultTerm_isSetResultLevel(swigCPtr, this); 276 } 277 278 279/** 280 * Sets the value of the 'resultLevel' attribute of this {@link DefaultTerm}. 281 <p> 282 * @param resultLevel int value of the 'resultLevel' attribute to be set. 283 <p> 284 * <p> 285 * @return integer value indicating success/failure of the 286 * function. The possible values 287 * returned by this function are: 288 * <ul> 289 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 290 * </ul> 291 */ public 292 int setResultLevel(int resultLevel) { 293 return libsbmlJNI.DefaultTerm_setResultLevel(swigCPtr, this, resultLevel); 294 } 295 296 297/** 298 * Unsets the value of the 'resultLevel' attribute of this {@link DefaultTerm}. 299 <p> 300 * <p> 301 * @return integer value indicating success/failure of the 302 * function. The possible values 303 * returned by this function are: 304 * <ul> 305 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 306 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 307 * </ul> 308 */ public 309 int unsetResultLevel() { 310 return libsbmlJNI.DefaultTerm_unsetResultLevel(swigCPtr, this); 311 } 312 313 314/** 315 * Returns the XML name of this object. 316 <p> 317 * @return the name of this element. 318 */ public 319 String getElementName() { 320 return libsbmlJNI.DefaultTerm_getElementName(swigCPtr, this); 321 } 322 323 324/** 325 * Returns the libSBML type code of this object instance. 326 <p> 327 * <p> 328 * LibSBML attaches an identifying code to every kind of SBML object. These 329 * are integer constants known as <em>SBML type codes</em>. The names of all 330 * the codes begin with the characters <code>SBML_</code>. 331 * In the Java language interface for libSBML, the 332 * type codes are defined as static integer constants in the interface class 333 * {@link libsbmlConstants}. Note that different Level 3 334 * package plug-ins may use overlapping type codes; to identify the package 335 * to which a given object belongs, call the <code>getPackageName()</code> 336 * method on the object. 337 <p> 338 * @return the SBML type code for this object: 339 * {@link libsbmlConstants#SBML_QUAL_DEFAULT_TERM SBML_QUAL_DEFAULT_TERM}. 340 <p> 341 * <p> 342 * @warning <span class='warning'>The specific integer values of the possible 343 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 344 * packages, To fully identify the correct code, <strong>it is necessary to 345 * invoke both getTypeCode() and getPackageName()</strong>.</span> 346 <p> 347 * @see #getElementName() 348 * @see #getPackageName() 349 */ public 350 int getTypeCode() { 351 return libsbmlJNI.DefaultTerm_getTypeCode(swigCPtr, this); 352 } 353 354 355/** 356 * Predicate returning <code>true</code> if all the required attributes 357 * for this {@link DefaultTerm} object have been set. 358 <p> 359 * @note The required attribute for a {@link DefaultTerm} object is: 360 * <ul> 361 * <li> 'resultLevel' 362 * 363 * </ul> <p> 364 * @return a boolean value indicating whether the required 365 * attribute for this object has been defined. 366 */ public 367 boolean hasRequiredAttributes() { 368 return libsbmlJNI.DefaultTerm_hasRequiredAttributes(swigCPtr, this); 369 } 370 371 372/** * @internal */ public 373 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 374 libsbmlJNI.DefaultTerm_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 375 } 376 377}