001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.12 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 * Implementation of SBML's Unit construct. 013 <p> 014 * The SBML unit definition facility uses two classes of objects, 015 * {@link UnitDefinition} and {@link Unit}. The approach to defining units in SBML is 016 * compositional; for example, <em>meter second<sup> –2</sup></em> is 017 * constructed by combining a {@link Unit} object representing <em>meter</em> with 018 * another {@link Unit} object representing <em>second<sup> –2</sup></em>. 019 * The combination is wrapped inside a {@link UnitDefinition}, which provides for 020 * assigning an identifier and optional name to the combination. The 021 * identifier can then be referenced from elsewhere in a model. Thus, the 022 * {@link UnitDefinition} class is the container, and {@link Unit} instances are placed 023 * inside {@link UnitDefinition} instances. 024 <p> 025 * A {@link Unit} has four attributes named 'kind', 'exponent', 'scale' 026 * and 'multiplier'. It represents a (possibly transformed) reference to a 027 * base unit. The attribute 'kind' on {@link Unit} indicates the chosen base unit. 028 * Its value must be one of the text strings listed below; this list 029 * corresponds to SBML Level 3 Version 1 Core: 030 <p> 031 * <p> 032<table border='0' class='centered text-table width80 normal-font code' 033 style='border: none !important'> 034<tr> 035<td>ampere</td><td>farad</td><td>joule</td><td>lux</td><td>radian</td><td>volt</td> 036</tr> 037<tr> 038<td>avogadro</td><td>gram</td><td>katal</td><td>metre</td><td>second</td><td>watt</td> 039</tr> 040<tr> 041<td>becquerel</td><td>gray</td><td>kelvin</td><td>mole</td><td>siemens</td><td>weber</td> 042</tr> 043<tr> 044<td>candela</td><td>henry</td><td>kilogram</td><td>newton</td><td>sievert</td> 045</tr> 046<tr> 047<td>coulomb</td><td>hertz</td><td>litre</td><td>ohm</td><td>steradian</td> 048</tr> 049<tr> 050<td>dimensionless</td><td>item</td><td>lumen</td><td>pascal</td><td>tesla</td> 051</tr> 052</table> 053 <p> 054 * A few small differences exist between the Level 3 list of base 055 * units and the list defined in other Level/Version combinations of SBML. 056 * Specifically, Levels of SBML before Level 3 do not define 057 * <code>avogadro</code>; conversely, Level 2 Version 1 defines <code>Celsius</code>, 058 * and Level 1 defines <code>celsius</code>, <code>meter</code>, and <code>liter</code>, none of 059 * which are available in Level 3. In libSBML, each of the predefined 060 * base unit names is represented by an enumeration value whose name begins with the characters 061 * <code>UNIT_KIND_</code>, discussed in a separate section below. 062 <p> 063 * The attribute named 'exponent' on {@link Unit} represents an exponent on the 064 * unit. In SBML Level 2, the attribute is optional and has a default 065 * value of <code>1</code> (one); in SBML Level 3, the attribute is mandatory 066 * and there is no default value. A {@link Unit} also has an attribute 067 * called 'scale'; its value must be an integer exponent for a power-of-ten 068 * multiplier used to set the scale of the unit. For example, a unit 069 * having a 'kind' value of <code>gram</code> and a 'scale' value of <code>-3</code> signifies 070 * 10<sup> –3</sup> × gram, or milligrams. In SBML 071 * Level 2, the attribute is optional and has a default value of <code>0</code> 072 * (zero), because 10<sup> 0</sup> = 1; in SBML Level 3, the attribute 073 * is mandatory and has no default value. Lastly, the attribute named 074 * 'multiplier' can be used to multiply the unit by a real-numbered factor; 075 * this enables the definition of units that are not power-of-ten multiples 076 * of SI units. For instance, a multiplier of 0.3048 could be used to 077 * define <code>foot</code> as a measure of length in terms of a <code>metre.</code> The 078 * 'multiplier' attribute is optional in SBML Level 2, where it has a 079 * default value of <code>1</code> (one); in SBML Level 3, the attribute is 080 * mandatory and has not default value. 081 <p> 082 * * <h3><a class='anchor' name='UnitKind_t'>%Unit identification codes</a></h3> 083 <p> 084 <p> 085 * As discussed above, SBML defines a set of base units which serves as the 086 * starting point for new unit definitions. This set of base units 087 * consists of the SI units and a small number of additional convenience 088 * units. 089 <p> 090 * In SBML Level 2 Versions before 091 * Version 3, there existed an enumeration of units called 092 * <code>UnitKind.</code> In Version 3, this enumeration was removed and the 093 * identifier class <code>UnitSId</code> redefined to include the previous 094 * <code>UnitKind</code> values as reserved symbols. This change has no net effect on 095 * permissible models, their representation or their syntax. The purpose 096 * of the change in the SBML specification was simply to clean up an 097 * inconsistency about the contexts in which these values were usable. 098 * However, libSBML maintains UnitKind in the form of of a set of static 099 * integer constants whose names begin with the characters 100 * <code>UNIT_KIND_</code>. These constants are defined in the class 101 * <code><a href='libsbmlConstants.html'>libsbmlConstants</a></code>. 102 <p> 103 <p> 104 * As a consequence of the fact that libSBML supports models in all Levels 105 * and Versions of SBML, libSBML's set of <code>UNIT_KIND_</code> values is a union 106 * of all the possible base unit names defined in the different SBML 107 * specifications. However, not every base unit is allowed in every 108 * Level+Version combination of SBML. Note in particular the following 109 * exceptions: 110 * <ul> 111 * <li> The alternate spelling <code>'meter'</code> is included in 112 * addition to the official SI spelling <code>'metre'.</code> This spelling is only 113 * permitted in SBML Level 1 models. 114 <p> 115 * <li> The alternate spelling <code>'liter'</code> is included in addition to the 116 * official SI spelling <code>'litre'.</code> This spelling is only permitted in 117 * SBML Level 1 models. 118 <p> 119 * <li> The unit <code>'Celsius'</code> is included because of its presence in 120 * specifications of SBML prior to SBML Level 2 Version 3. 121 <p> 122 * <li> The unit <code>avogadro</code> was introduced in SBML Level 3, and 123 * is only permitted for use in SBML Level 3 models. 124 * </ul> 125 <p> 126 * The table below lists the unit 127 * constants defined in libSBML, and their meanings. 128 <p> 129 * <table border="0" class="centered text-table width80 normal-font alt-row-colors"> 130 <tr> 131 <th align="left" width="200">Enumerator</th> 132 <th align="left">Meaning</th> 133 </tr> 134<tr><td><code>UNIT_KIND_AMPERE</code></td><td>The ampere unit.</td></tr> 135<tr><td><code>UNIT_KIND_AVOGADRO</code></td><td>The unit 136<code>dimensionless</code> multiplied by the numerical value of Avogadro's 137constant. (<span class="warning">Only usable in SBML Level 3 models.</span>)</td></tr> 138<tr><td><code>UNIT_KIND_BECQUEREL</code></td><td>The becquerel unit.</td></tr> 139<tr><td><code>UNIT_KIND_CANDELA</code></td><td>The candela unit.</td></tr> 140<tr><td><code>UNIT_KIND_CELSIUS</code></td><td>The Celsius unit. (<span 141class="warning">Only usable in SBML Level 1 and SBML Level 2 142Version 1 models.</span>)</td></tr> 143<tr><td><code>UNIT_KIND_COULOMB</code></td><td>The coulomb unit.</td></tr> 144<tr><td><code>UNIT_KIND_DIMENSIONLESS</code></td><td>A pseudo-unit 145indicating a dimensionless quantity.</td></tr> 146<tr><td><code>UNIT_KIND_FARAD</code></td><td>The farad unit.</td></tr> 147<tr><td><code>UNIT_KIND_GRAM</code></td><td>The gram unit.</td></tr> 148<tr><td><code>UNIT_KIND_GRAY</code></td><td>The gray unit.</td></tr> 149<tr><td><code>UNIT_KIND_HENRY</code></td><td>The henry unit.</td></tr> 150<tr><td><code>UNIT_KIND_HERTZ</code></td><td>The hertz unit.</td></tr> 151<tr><td><code>UNIT_KIND_ITEM</code></td><td>A pseudo-unit representing a 152single "thing".</td></tr> 153<tr><td><code>UNIT_KIND_JOULE</code></td><td>The joule unit.</td></tr> 154<tr><td><code>UNIT_KIND_KATAL</code></td><td>The katal unit.</td></tr> 155<tr><td><code>UNIT_KIND_KELVIN</code></td><td>The kelvin unit.</td></tr> 156<tr><td><code>UNIT_KIND_KILOGRAM</code></td><td>The kilogram unit.</td></tr> 157<tr><td><code>UNIT_KIND_LITER</code></td><td>Alternate spelling of litre.</td></tr> 158<tr><td><code>UNIT_KIND_LITRE</code></td><td>The litre unit.</td></tr> 159<tr><td><code>UNIT_KIND_LUMEN</code></td><td>The lumen unit.</td></tr> 160<tr><td><code>UNIT_KIND_LUX</code></td><td>The lux unit.</td></tr> 161<tr><td><code>UNIT_KIND_METER</code></td><td>Alternate spelling of metre.</td></tr> 162<tr><td><code>UNIT_KIND_METRE</code></td><td>The metre unit.</td></tr> 163<tr><td><code>UNIT_KIND_MOLE</code></td><td>The mole unit.</td></tr> 164<tr><td><code>UNIT_KIND_NEWTON</code></td><td>The newton unit.</td></tr> 165<tr><td><code>UNIT_KIND_OHM</code></td><td>The ohm unit.</td></tr> 166<tr><td><code>UNIT_KIND_PASCAL</code></td><td>The pascal unit.</td></tr> 167<tr><td><code>UNIT_KIND_RADIAN</code></td><td>The radian unit.</td></tr> 168<tr><td><code>UNIT_KIND_SECOND</code></td><td>The second unit.</td></tr> 169<tr><td><code>UNIT_KIND_SIEMENS</code></td><td>The siemens unit.</td></tr> 170<tr><td><code>UNIT_KIND_SIEVERT</code></td><td>The sievert unit.</td></tr> 171<tr><td><code>UNIT_KIND_STERADIAN</code></td><td>The steradian unit.</td></tr> 172<tr><td><code>UNIT_KIND_TESLA</code></td><td>The tesla unit.</td></tr> 173<tr><td><code>UNIT_KIND_VOLT</code></td><td>The volt unit.</td></tr> 174<tr><td><code>UNIT_KIND_WATT</code></td><td>The watt unit.</td></tr> 175<tr><td><code>UNIT_KIND_WEBER</code></td><td>The weber unit.</td></tr> 176<tr><td><code>UNIT_KIND_INVALID</code></td><td>Marker used by libSBML 177to indicate an invalid or unset unit.</td></tr> 178</table> 179 180 181 */ 182 183public class Unit extends SBase { 184 private long swigCPtr; 185 186 protected Unit(long cPtr, boolean cMemoryOwn) 187 { 188 super(libsbmlJNI.Unit_SWIGUpcast(cPtr), cMemoryOwn); 189 swigCPtr = cPtr; 190 } 191 192 protected static long getCPtr(Unit obj) 193 { 194 return (obj == null) ? 0 : obj.swigCPtr; 195 } 196 197 protected static long getCPtrAndDisown (Unit obj) 198 { 199 long ptr = 0; 200 201 if (obj != null) 202 { 203 ptr = obj.swigCPtr; 204 obj.swigCMemOwn = false; 205 } 206 207 return ptr; 208 } 209 210 protected void finalize() { 211 delete(); 212 } 213 214 public synchronized void delete() { 215 if (swigCPtr != 0) { 216 if (swigCMemOwn) { 217 swigCMemOwn = false; 218 libsbmlJNI.delete_Unit(swigCPtr); 219 } 220 swigCPtr = 0; 221 } 222 super.delete(); 223 } 224 225 226/** 227 * Creates a new {@link Unit} using the given SBML <code>level</code> and <code>version</code> 228 * values. 229 <p> 230 * @param level a long integer, the SBML Level to assign to this {@link Unit} 231 <p> 232 * @param version a long integer, the SBML Version to assign to this 233 * {@link Unit} 234 <p> 235 * @throws SBMLConstructorException 236 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 237 * of SBML object, are either invalid or mismatched with respect to the 238 * parent {@link SBMLDocument} object. 239 <p> 240 * <p> 241 * @note Upon the addition of a {@link Unit} object to an {@link SBMLDocument}, the SBML 242 * Level, SBML Version and XML namespace of the document 243 * <em>override</em> the values used when creating the {@link Unit} object via this 244 * constructor. This is necessary to ensure that an SBML document is a 245 * consistent structure. Nevertheless, the ability to supply the values 246 * at the time of creation of a {@link Unit} is an important aid to producing 247 * valid SBML. Knowledge of the intented SBML Level and Version 248 * determine whether it is valid to assign a particular value to an 249 * attribute, or whether it is valid to add an object to an existing 250 * {@link SBMLDocument}. 251 */ public 252 Unit(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 253 this(libsbmlJNI.new_Unit__SWIG_0(level, version), true); 254 } 255 256 257/** 258 * Creates a new {@link Unit} using the given {@link SBMLNamespaces} object 259 * <code>sbmlns</code>. 260 <p> 261 * <p> 262 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 263 * information. It is used to communicate the SBML Level, Version, and (in 264 * Level 3) packages used in addition to SBML Level 3 Core. A 265 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 266 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 267 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 268 <p> 269 * @param sbmlns an {@link SBMLNamespaces} object. 270 <p> 271 * @throws SBMLConstructorException 272 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 273 * of SBML object, are either invalid or mismatched with respect to the 274 * parent {@link SBMLDocument} object. 275 <p> 276 * <p> 277 * @note Upon the addition of a {@link Unit} object to an {@link SBMLDocument}, the SBML 278 * Level, SBML Version and XML namespace of the document 279 * <em>override</em> the values used when creating the {@link Unit} object via this 280 * constructor. This is necessary to ensure that an SBML document is a 281 * consistent structure. Nevertheless, the ability to supply the values 282 * at the time of creation of a {@link Unit} is an important aid to producing 283 * valid SBML. Knowledge of the intented SBML Level and Version 284 * determine whether it is valid to assign a particular value to an 285 * attribute, or whether it is valid to add an object to an existing 286 * {@link SBMLDocument}. 287 */ public 288 Unit(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 289 this(libsbmlJNI.new_Unit__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 290 } 291 292 293/** 294 * Copy constructor; creates a copy of this {@link Unit}. 295 <p> 296 * @param orig the object to copy. 297 <p> 298 * @throws SBMLConstructorException 299 * Thrown if the argument <code>orig</code> is <code>null.</code> 300 */ public 301 Unit(Unit orig) throws org.sbml.libsbml.SBMLConstructorException { 302 this(libsbmlJNI.new_Unit__SWIG_2(Unit.getCPtr(orig), orig), true); 303 } 304 305 306/** 307 * Creates and returns a deep copy of this {@link Unit}. 308 <p> 309 * @return a (deep) copy of this {@link Unit}. 310 */ public 311 Unit cloneObject() { 312 long cPtr = libsbmlJNI.Unit_cloneObject(swigCPtr, this); 313 return (cPtr == 0) ? null : new Unit(cPtr, true); 314 } 315 316 317/** 318 * Initializes the fields of this {@link Unit} object to 'typical' default 319 * values. 320 <p> 321 * The SBML {@link Unit} component has slightly different aspects and default 322 * attribute values in different SBML Levels and Versions. This method 323 * sets the values to certain common defaults, based mostly on what they 324 * are in SBML Level 2. Specifically: 325 * <ul> 326 * <li> Sets attribute 'exponent' to <code>1</code> 327 * <li> Sets attribute 'scale' to <code>0</code> 328 * <li> Sets attribute 'multiplier' to <code>1.0</code> 329 * </ul> 330 <p> 331 * The 'kind' attribute is left unchanged. 332 */ public 333 void initDefaults() { 334 libsbmlJNI.Unit_initDefaults(swigCPtr, this); 335 } 336 337 338/** 339 * Returns the 'kind' of {@link Unit} this is. 340 <p> 341 * @return the value of the 'kind' attribute of this {@link Unit} as a 342 * value from the set of constants whose names begin 343 * with <code>UNIT_KIND_</code> defined in the class 344 * <code><a href='libsbmlConstants.html'>libsbmlConstants</a></code>. 345 */ public 346 int getKind() { 347 return libsbmlJNI.Unit_getKind(swigCPtr, this); 348 } 349 350 351/** 352 * Returns the value of the 'exponent' attribute of this unit. 353 <p> 354 * @return the 'exponent' value of this {@link Unit}, as an integer. 355 */ public 356 int getExponent() { 357 return libsbmlJNI.Unit_getExponent(swigCPtr, this); 358 } 359 360 361/** 362 * Returns the value of the 'exponent' attribute of this unit. 363 <p> 364 * @return the 'exponent' value of this {@link Unit}, as a double. 365 */ public 366 double getExponentAsDouble() { 367 return libsbmlJNI.Unit_getExponentAsDouble(swigCPtr, this); 368 } 369 370 371/** 372 * Returns the value of the 'scale' attribute of this unit. 373 <p> 374 * @return the 'scale' value of this {@link Unit}, as an integer. 375 */ public 376 int getScale() { 377 return libsbmlJNI.Unit_getScale(swigCPtr, this); 378 } 379 380 381/** 382 * Returns the value of the 'multiplier' attribute of this {@link Unit}. 383 <p> 384 * @return the 'multiplier' value of this {@link Unit}, as a double. 385 */ public 386 double getMultiplier() { 387 return libsbmlJNI.Unit_getMultiplier(swigCPtr, this); 388 } 389 390 391/** 392 * Returns the value of the 'offset' attribute of this {@link Unit}. 393 <p> 394 * @return the 'offset' value of this {@link Unit}, as a double. 395 <p> 396 * <p> 397 * @warning <span class='warning'>The 'offset' attribute is only available in 398 * SBML Level 2 Version 1. This attribute is not present in SBML 399 * Level 2 Version 2 or above. When producing SBML models using 400 * these later specifications, modelers and software tools need to account 401 * for units with offsets explicitly. The SBML specification document 402 * offers a number of suggestions for how to achieve this. LibSBML methods 403 * such as this one related to 'offset' are retained for compatibility with 404 * earlier versions of SBML Level 2, but their use is strongly 405 * discouraged.</span> 406 */ public 407 double getOffset() { 408 return libsbmlJNI.Unit_getOffset(swigCPtr, this); 409 } 410 411 412/** 413 * Predicate for testing whether this {@link Unit} is of the kind <code>ampere.</code> 414 <p> 415 * @return <code>true</code> if the kind of this {@link Unit} is <code>ampere</code>, <code>false</code> 416 * otherwise. 417 */ public 418 boolean isAmpere() { 419 return libsbmlJNI.Unit_isAmpere(swigCPtr, this); 420 } 421 422 423/** 424 * Predicate for testing whether this {@link Unit} is of the kind <code>avogadro.</code> 425 <p> 426 * @return <code>true</code> if the kind of this {@link Unit} is <code>avogadro</code>, <code>false</code> 427 * otherwise. 428 <p> 429 * @note The unit <code>avogadro</code> was introduced in SBML Level 3, and 430 * is only permitted for use in SBML Level 3 models. 431 */ public 432 boolean isAvogadro() { 433 return libsbmlJNI.Unit_isAvogadro(swigCPtr, this); 434 } 435 436 437/** 438 * Predicate for testing whether this {@link Unit} is of the kind <code>becquerel</code> 439 <p> 440 * @return <code>true</code> if the kind of this {@link Unit} is <code>becquerel</code>, <code>false</code> 441 * otherwise. 442 */ public 443 boolean isBecquerel() { 444 return libsbmlJNI.Unit_isBecquerel(swigCPtr, this); 445 } 446 447 448/** 449 * Predicate for testing whether this {@link Unit} is of the kind <code>candela</code> 450 <p> 451 * @return <code>true</code> if the kind of this {@link Unit} is <code>candela</code>, <code>false</code> 452 * otherwise. 453 */ public 454 boolean isCandela() { 455 return libsbmlJNI.Unit_isCandela(swigCPtr, this); 456 } 457 458 459/** 460 * Predicate for testing whether this {@link Unit} is of the kind <code>Celsius</code> 461 <p> 462 * @return <code>true</code> if the kind of this {@link Unit} is <code>Celsius</code>, <code>false</code> 463 * otherwise. 464 <p> 465 * @warning <span class='warning'>The predefined unit <code>Celsius</code> was 466 * removed from the list of predefined units in SBML Level 2 467 * Version 2 at the same time that the 'offset' attribute was removed 468 * from {@link Unit} definitions. LibSBML methods such as this one related to 469 * <code>Celsius</code> are retained in order to support SBML Level 2 470 * Version 1, but their use is strongly discouraged.</span> 471 */ public 472 boolean isCelsius() { 473 return libsbmlJNI.Unit_isCelsius(swigCPtr, this); 474 } 475 476 477/** 478 * Predicate for testing whether this {@link Unit} is of the kind <code>coulomb</code> 479 <p> 480 * @return <code>true</code> if the kind of this {@link Unit} is <code>coulomb</code>, <code>false</code> 481 * otherwise. 482 */ public 483 boolean isCoulomb() { 484 return libsbmlJNI.Unit_isCoulomb(swigCPtr, this); 485 } 486 487 488/** 489 * Predicate for testing whether this {@link Unit} is of the kind 490 * <code>dimensionless.</code> 491 <p> 492 * @return <code>true</code> if the kind of this {@link Unit} is <code>dimensionless</code>, <code>false</code> 493 <p> 494 * otherwise. 495 */ public 496 boolean isDimensionless() { 497 return libsbmlJNI.Unit_isDimensionless(swigCPtr, this); 498 } 499 500 501/** 502 * Predicate for testing whether this {@link Unit} is of the kind <code>farad</code> 503 <p> 504 * @return <code>true</code> if the kind of this {@link Unit} is <code>farad</code>, <code>false</code> 505 * otherwise. 506 */ public 507 boolean isFarad() { 508 return libsbmlJNI.Unit_isFarad(swigCPtr, this); 509 } 510 511 512/** 513 * Predicate for testing whether this {@link Unit} is of the kind <code>gram</code> 514 <p> 515 * @return <code>true</code> if the kind of this {@link Unit} is <code>gram</code>, <code>false</code> 516 * otherwise. 517 */ public 518 boolean isGram() { 519 return libsbmlJNI.Unit_isGram(swigCPtr, this); 520 } 521 522 523/** 524 * Predicate for testing whether this {@link Unit} is of the kind <code>gray</code> 525 <p> 526 * @return <code>true</code> if the kind of this {@link Unit} is <code>gray</code>, <code>false</code> 527 * otherwise. 528 */ public 529 boolean isGray() { 530 return libsbmlJNI.Unit_isGray(swigCPtr, this); 531 } 532 533 534/** 535 * Predicate for testing whether this {@link Unit} is of the kind <code>henry</code> 536 <p> 537 * @return <code>true</code> if the kind of this {@link Unit} is <code>henry</code>, <code>false</code> 538 * otherwise. 539 */ public 540 boolean isHenry() { 541 return libsbmlJNI.Unit_isHenry(swigCPtr, this); 542 } 543 544 545/** 546 * Predicate for testing whether this {@link Unit} is of the kind <code>hertz</code> 547 <p> 548 * @return <code>true</code> if the kind of this {@link Unit} is <code>hertz</code>, <code>false</code> 549 * otherwise. 550 */ public 551 boolean isHertz() { 552 return libsbmlJNI.Unit_isHertz(swigCPtr, this); 553 } 554 555 556/** 557 * Predicate for testing whether this {@link Unit} is of the kind <code>item</code> 558 <p> 559 * @return <code>true</code> if the kind of this {@link Unit} is <code>item</code>, <code>false</code> 560 * otherwise. 561 */ public 562 boolean isItem() { 563 return libsbmlJNI.Unit_isItem(swigCPtr, this); 564 } 565 566 567/** 568 * Predicate for testing whether this {@link Unit} is of the kind <code>joule</code> 569 <p> 570 * @return <code>true</code> if the kind of this {@link Unit} is <code>joule</code>, <code>false</code> 571 * otherwise. 572 */ public 573 boolean isJoule() { 574 return libsbmlJNI.Unit_isJoule(swigCPtr, this); 575 } 576 577 578/** 579 * Predicate for testing whether this {@link Unit} is of the kind <code>katal</code> 580 <p> 581 * @return <code>true</code> if the kind of this {@link Unit} is <code>katal</code>, <code>false</code> 582 * otherwise. 583 */ public 584 boolean isKatal() { 585 return libsbmlJNI.Unit_isKatal(swigCPtr, this); 586 } 587 588 589/** 590 * Predicate for testing whether this {@link Unit} is of the kind <code>kelvin</code> 591 <p> 592 * @return <code>true</code> if the kind of this {@link Unit} is <code>kelvin</code>, <code>false</code> 593 * otherwise. 594 */ public 595 boolean isKelvin() { 596 return libsbmlJNI.Unit_isKelvin(swigCPtr, this); 597 } 598 599 600/** 601 * Predicate for testing whether this {@link Unit} is of the kind <code>kilogram</code> 602 <p> 603 * @return <code>true</code> if the kind of this {@link Unit} is <code>kilogram</code>, <code>false</code> 604 * otherwise. 605 */ public 606 boolean isKilogram() { 607 return libsbmlJNI.Unit_isKilogram(swigCPtr, this); 608 } 609 610 611/** 612 * Predicate for testing whether this {@link Unit} is of the kind <code>litre</code> 613 <p> 614 * @return <code>true</code> if the kind of this {@link Unit} is <code>litre</code> or 'liter', 615 * <code>false</code> 616 * otherwise. 617 */ public 618 boolean isLitre() { 619 return libsbmlJNI.Unit_isLitre(swigCPtr, this); 620 } 621 622 623/** 624 * Predicate for testing whether this {@link Unit} is of the kind <code>lumen</code> 625 <p> 626 * @return <code>true</code> if the kind of this {@link Unit} is <code>lumen</code>, <code>false</code> 627 * otherwise. 628 */ public 629 boolean isLumen() { 630 return libsbmlJNI.Unit_isLumen(swigCPtr, this); 631 } 632 633 634/** 635 * Predicate for testing whether this {@link Unit} is of the kind <code>lux</code> 636 <p> 637 * @return <code>true</code> if the kind of this {@link Unit} is <code>lux</code>, <code>false</code> 638 * otherwise. 639 */ public 640 boolean isLux() { 641 return libsbmlJNI.Unit_isLux(swigCPtr, this); 642 } 643 644 645/** 646 * Predicate for testing whether this {@link Unit} is of the kind <code>metre</code> 647 <p> 648 * @return <code>true</code> if the kind of this {@link Unit} is <code>metre</code> or 'meter', 649 * <code>false</code> 650 * otherwise. 651 */ public 652 boolean isMetre() { 653 return libsbmlJNI.Unit_isMetre(swigCPtr, this); 654 } 655 656 657/** 658 * Predicate for testing whether this {@link Unit} is of the kind <code>mole</code> 659 <p> 660 * @return <code>true</code> if the kind of this {@link Unit} is <code>mole</code>, <code>false</code> 661 * otherwise. 662 */ public 663 boolean isMole() { 664 return libsbmlJNI.Unit_isMole(swigCPtr, this); 665 } 666 667 668/** 669 * Predicate for testing whether this {@link Unit} is of the kind <code>newton</code> 670 <p> 671 * @return <code>true</code> if the kind of this {@link Unit} is <code>newton</code>, <code>false</code> 672 * otherwise. 673 */ public 674 boolean isNewton() { 675 return libsbmlJNI.Unit_isNewton(swigCPtr, this); 676 } 677 678 679/** 680 * Predicate for testing whether this {@link Unit} is of the kind <code>ohm</code> 681 <p> 682 * @return <code>true</code> if the kind of this {@link Unit} is <code>ohm</code>, <code>false</code> 683 * otherwise. 684 */ public 685 boolean isOhm() { 686 return libsbmlJNI.Unit_isOhm(swigCPtr, this); 687 } 688 689 690/** 691 * Predicate for testing whether this {@link Unit} is of the kind <code>pascal</code> 692 <p> 693 * @return <code>true</code> if the kind of this {@link Unit} is <code>pascal</code>, <code>false</code> 694 * otherwise. 695 */ public 696 boolean isPascal() { 697 return libsbmlJNI.Unit_isPascal(swigCPtr, this); 698 } 699 700 701/** 702 * Predicate for testing whether this {@link Unit} is of the kind <code>radian</code> 703 <p> 704 * @return <code>true</code> if the kind of this {@link Unit} is <code>radian</code>, <code>false</code> 705 * otherwise. 706 */ public 707 boolean isRadian() { 708 return libsbmlJNI.Unit_isRadian(swigCPtr, this); 709 } 710 711 712/** 713 * Predicate for testing whether this {@link Unit} is of the kind <code>second</code> 714 <p> 715 * @return <code>true</code> if the kind of this {@link Unit} is <code>second</code>, <code>false</code> 716 * otherwise. 717 */ public 718 boolean isSecond() { 719 return libsbmlJNI.Unit_isSecond(swigCPtr, this); 720 } 721 722 723/** 724 * Predicate for testing whether this {@link Unit} is of the kind <code>siemens</code> 725 <p> 726 * @return <code>true</code> if the kind of this {@link Unit} is <code>siemens</code>, <code>false</code> 727 * otherwise. 728 */ public 729 boolean isSiemens() { 730 return libsbmlJNI.Unit_isSiemens(swigCPtr, this); 731 } 732 733 734/** 735 * Predicate for testing whether this {@link Unit} is of the kind <code>sievert</code> 736 <p> 737 * @return <code>true</code> if the kind of this {@link Unit} is <code>sievert</code>, <code>false</code> 738 * otherwise. 739 */ public 740 boolean isSievert() { 741 return libsbmlJNI.Unit_isSievert(swigCPtr, this); 742 } 743 744 745/** 746 * Predicate for testing whether this {@link Unit} is of the kind <code>steradian</code> 747 <p> 748 * @return <code>true</code> if the kind of this {@link Unit} is <code>steradian</code>, <code>false</code> 749 * otherwise. 750 */ public 751 boolean isSteradian() { 752 return libsbmlJNI.Unit_isSteradian(swigCPtr, this); 753 } 754 755 756/** 757 * Predicate for testing whether this {@link Unit} is of the kind <code>tesla</code> 758 <p> 759 * @return <code>true</code> if the kind of this {@link Unit} is <code>tesla</code>, <code>false</code> 760 * otherwise. 761 */ public 762 boolean isTesla() { 763 return libsbmlJNI.Unit_isTesla(swigCPtr, this); 764 } 765 766 767/** 768 * Predicate for testing whether this {@link Unit} is of the kind <code>volt</code> 769 <p> 770 * @return <code>true</code> if the kind of this {@link Unit} is <code>volt</code>, <code>false</code> 771 * otherwise. 772 */ public 773 boolean isVolt() { 774 return libsbmlJNI.Unit_isVolt(swigCPtr, this); 775 } 776 777 778/** 779 * Predicate for testing whether this {@link Unit} is of the kind <code>watt</code> 780 <p> 781 * @return <code>true</code> if the kind of this {@link Unit} is <code>watt</code>, <code>false</code> 782 * otherwise. 783 */ public 784 boolean isWatt() { 785 return libsbmlJNI.Unit_isWatt(swigCPtr, this); 786 } 787 788 789/** 790 * Predicate for testing whether this {@link Unit} is of the kind <code>weber</code> 791 <p> 792 * @return <code>true</code> if the kind of this {@link Unit} is <code>weber</code>, <code>false</code> 793 * otherwise. 794 */ public 795 boolean isWeber() { 796 return libsbmlJNI.Unit_isWeber(swigCPtr, this); 797 } 798 799 800/** 801 * Predicate to test whether the 'kind' attribute of this {@link Unit} is set. 802 <p> 803 * @return <code>true</code> if the 'kind' attribute of this {@link Unit} is set, 804 * <code>false</code> otherwise. 805 */ public 806 boolean isSetKind() { 807 return libsbmlJNI.Unit_isSetKind(swigCPtr, this); 808 } 809 810 811/** 812 * Predicate to test whether the 'exponent' attribute of this {@link Unit} 813 * is set. 814 <p> 815 * @return <code>true</code> if the 'exponent' attribute of this {@link Unit} is set, 816 * <code>false</code> otherwise. 817 */ public 818 boolean isSetExponent() { 819 return libsbmlJNI.Unit_isSetExponent(swigCPtr, this); 820 } 821 822 823/** 824 * Predicate to test whether the 'scale' attribute of this {@link Unit} 825 * is set. 826 <p> 827 * @return <code>true</code> if the 'scale' attribute of this {@link Unit} is set, 828 * <code>false</code> otherwise. 829 */ public 830 boolean isSetScale() { 831 return libsbmlJNI.Unit_isSetScale(swigCPtr, this); 832 } 833 834 835/** 836 * Predicate to test whether the 'multiplier' attribute of this {@link Unit} 837 * is set. 838 <p> 839 * @return <code>true</code> if the 'multiplier' attribute of this {@link Unit} is set, 840 * <code>false</code> otherwise. 841 */ public 842 boolean isSetMultiplier() { 843 return libsbmlJNI.Unit_isSetMultiplier(swigCPtr, this); 844 } 845 846 847/** 848 * Sets the 'kind' attribute value of this {@link Unit}. 849 <p> 850 * @param kind a unit identifier chosen from the set of constants whose 851 * names begin with <code>UNIT_KIND_</code> in <code><a 852 * href='libsbmlConstants.html'>libsbmlConstants</a></code>. 853 <p> 854 <p> 855 * @return integer value indicating success/failure of the 856 * function. The possible values 857 * returned by this function are: 858 * <ul> 859 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 860 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 861 * </ul> 862 */ public 863 int setKind(int kind) { 864 return libsbmlJNI.Unit_setKind(swigCPtr, this, kind); 865 } 866 867 868/** 869 * Sets the 'exponent' attribute value of this {@link Unit}. 870 <p> 871 * @param value the integer to which the attribute 'exponent' should be set 872 <p> 873 * @return integer value indicating success/failure of the 874 * function. The possible values 875 * returned by this function are: 876 * <ul> 877 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 878 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 879 * </ul> 880 */ public 881 int setExponent(int value) { 882 return libsbmlJNI.Unit_setExponent__SWIG_0(swigCPtr, this, value); 883 } 884 885 886/** 887 * Sets the 'exponent' attribute value of this {@link Unit}. 888 <p> 889 * @param value the double to which the attribute 'exponent' should be set 890 <p> 891 * @return integer value indicating success/failure of the 892 * function. The possible values 893 * returned by this function are: 894 * <ul> 895 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 896 * </ul> 897 */ public 898 int setExponent(double value) { 899 return libsbmlJNI.Unit_setExponent__SWIG_1(swigCPtr, this, value); 900 } 901 902 903/** 904 * Sets the 'scale' attribute value of this {@link Unit}. 905 <p> 906 * @param value the integer to which the attribute 'scale' should be set 907 <p> 908 * @return integer value indicating success/failure of the 909 * function. The possible values 910 * returned by this function are: 911 * <ul> 912 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 913 * </ul> 914 */ public 915 int setScale(int value) { 916 return libsbmlJNI.Unit_setScale(swigCPtr, this, value); 917 } 918 919 920/** 921 * Sets the 'multipler' attribute value of this {@link Unit}. 922 <p> 923 * @param value the floating-point value to which the attribute 924 * 'multiplier' should be set 925 <p> 926 * @return integer value indicating success/failure of the 927 * function. The possible values 928 * returned by this function are: 929 * <ul> 930 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 931 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 932 * </ul> 933 */ public 934 int setMultiplier(double value) { 935 return libsbmlJNI.Unit_setMultiplier(swigCPtr, this, value); 936 } 937 938 939/** 940 * Sets the 'offset' attribute value of this {@link Unit}. 941 <p> 942 * @param value the float-point value to which the attribute 'offset' 943 * should set 944 <p> 945 * @return integer value indicating success/failure of the 946 * function. The possible values 947 * returned by this function are: 948 * <ul> 949 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 950 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 951 * 952 * </ul> <p> 953 * <p> 954 * @warning <span class='warning'>The 'offset' attribute is only available in 955 * SBML Level 2 Version 1. This attribute is not present in SBML 956 * Level 2 Version 2 or above. When producing SBML models using 957 * these later specifications, modelers and software tools need to account 958 * for units with offsets explicitly. The SBML specification document 959 * offers a number of suggestions for how to achieve this. LibSBML methods 960 * such as this one related to 'offset' are retained for compatibility with 961 * earlier versions of SBML Level 2, but their use is strongly 962 * discouraged.</span> 963 */ public 964 int setOffset(double value) { 965 return libsbmlJNI.Unit_setOffset(swigCPtr, this, value); 966 } 967 968 969/** 970 * Returns the libSBML type code of this object instance. 971 <p> 972 * <p> 973 * LibSBML attaches an identifying code to every kind of SBML object. These 974 * are integer constants known as <em>SBML type codes</em>. The names of all 975 * the codes begin with the characters “<code>SBML_</code>”. 976 * In the Java language interface for libSBML, the 977 * type codes are defined as static integer constants in the interface class 978 * {@link libsbmlConstants}. Note that different Level 3 979 * package plug-ins may use overlapping type codes; to identify the package 980 * to which a given object belongs, call the <code>getPackageName()</code> 981 * method on the object. 982 <p> 983 * @return the SBML type code for this object: 984 * {@link libsbmlConstants#SBML_UNIT SBML_UNIT} (default). 985 <p> 986 * <p> 987 * @warning <span class='warning'>The specific integer values of the possible 988 * type codes may be reused by different Level 3 package plug-ins. 989 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 990 * both getTypeCode() and getPackageName()</strong>.</span> 991 <p> 992 * @see #getPackageName() 993 * @see #getElementName() 994 */ public 995 int getTypeCode() { 996 return libsbmlJNI.Unit_getTypeCode(swigCPtr, this); 997 } 998 999 1000/** 1001 * Returns the XML element name of this object, which for {@link Unit}, is 1002 * always <code>'unit'.</code> 1003 <p> 1004 * @return the name of this element, i.e., <code>'unit'.</code> 1005 */ public 1006 String getElementName() { 1007 return libsbmlJNI.Unit_getElementName(swigCPtr, this); 1008 } 1009 1010 1011/** 1012 * Predicate to test whether a given string is the name of a 1013 * predefined SBML unit. 1014 <p> 1015 * @param name a string to be tested against the predefined unit names 1016 <p> 1017 * @param level the Level of SBML for which the determination should be 1018 * made. This is necessary because there are a few small differences 1019 * in allowed units between SBML Level 1 and Level 2. 1020 <p> 1021 * @return <code>true</code> if <code>name</code> is one of the five SBML predefined unit 1022 * identifiers (<code>'substance'</code>, <code>'volume'</code>, <code>'area'</code>, <code>'length'</code> or 1023 * <code>'time'</code>), <code>false</code> otherwise. 1024 <p> 1025 * @note The predefined unit identifiers <code>'length'</code> and <code>'area'</code> were 1026 * added in Level 2 Version 1. 1027 <p> 1028 * 1029 */ public 1030 static boolean isBuiltIn(String name, long level) { 1031 return libsbmlJNI.Unit_isBuiltIn(name, level); 1032 } 1033 1034 1035/** 1036 * Predicate to test whether a given string is the name of a valid 1037 * base unit in SBML (such as <code>'gram'</code> or <code>'mole'</code>). 1038 <p> 1039 * This method exists because prior to SBML Level 2 Version 3, 1040 * an enumeration called <code>UnitKind</code> was defined by SBML. This enumeration 1041 * was removed in SBML Level 2 Version 3 and its values were 1042 * folded into the space of values of a type called <code>UnitSId.</code> This method 1043 * therefore has less significance in SBML Level 2 Version 3 1044 * and Level 2 Version 4, but remains for backward 1045 * compatibility and support for reading models in older Versions of 1046 * Level 2. 1047 <p> 1048 * @param name a string to be tested 1049 <p> 1050 * @param level a long integer representing the SBML specification 1051 * Level 1052 <p> 1053 * @param version a long integer representing the SBML specification 1054 * Version 1055 <p> 1056 * @return <code>true</code> if name is a valid SBML UnitKind, <code>false</code> otherwise 1057 <p> 1058 * @note The allowed unit names differ between SBML Levels 1 1059 * and 2 and again slightly between Level 2 Versions 1 1060 * and 2. 1061 <p> 1062 * 1063 */ public 1064 static boolean isUnitKind(String name, long level, long version) { 1065 return libsbmlJNI.Unit_isUnitKind(name, level, version); 1066 } 1067 1068 1069/** 1070 * Predicate returning <code>true</code> if two 1071 * {@link Unit} objects are identical. 1072 <p> 1073 * Two {@link Unit} objects are considered to be <em>identical</em> if they match in 1074 * all attributes. (Contrast this to the method areEquivalent(* {@link Unit} u1, Unit u2), which compares {@link Unit} objects only with respect 1075 * to certain attributes.) 1076 <p> 1077 * @param unit1 the first {@link Unit} object to compare 1078 * @param unit2 the second {@link Unit} object to compare 1079 <p> 1080 * @return <code>true</code> if all the attributes of unit1 are identical 1081 * to the attributes of unit2, <code>false</code> otherwise. 1082 <p> 1083 * 1084 <p> 1085 * @see Unit#areEquivalent(Unit u1, Unit u2) 1086 */ public 1087 static boolean areIdentical(Unit unit1, Unit unit2) { 1088 return libsbmlJNI.Unit_areIdentical(Unit.getCPtr(unit1), unit1, Unit.getCPtr(unit2), unit2); 1089 } 1090 1091 1092/** 1093 * Predicate returning <code>true</code> if 1094 * {@link Unit} objects are equivalent. 1095 <p> 1096 * Two {@link Unit} objects are considered to be <em>equivalent</em> either if (1) both 1097 * have a 'kind' attribute value of <code>dimensionless</code>, or (2) their 'kind', 1098 * 'exponent' and (for SBML Level 2 Version 1) 'offset' 1099 * attribute values are equal. (Contrast this to the method 1100 * areIdentical(Unit u1, Unit u2), which compares {@link Unit} objects with respect to all 1101 * attributes, not just the 'kind' and 'exponent'.) 1102 <p> 1103 * @param unit1 the first {@link Unit} object to compare 1104 * @param unit2 the second {@link Unit} object to compare 1105 <p> 1106 * @return <code>true</code> if the 'kind' and 'exponent' attributes of unit1 are 1107 * identical to the kind and exponent attributes of unit2, <code>false</code> 1108 * otherwise. 1109 <p> 1110 * 1111 <p> 1112 * @see Unit#areIdentical(Unit u1, Unit u2) 1113 */ public 1114 static boolean areEquivalent(Unit unit1, Unit unit2) { 1115 return libsbmlJNI.Unit_areEquivalent(Unit.getCPtr(unit1), unit1, Unit.getCPtr(unit2), unit2); 1116 } 1117 1118 1119/** 1120 * Manipulates the attributes of the {@link Unit} to express the unit with the 1121 * value of the scale attribute reduced to zero. 1122 <p> 1123 * For example, 1 millimetre can be expressed as a {@link Unit} with kind= 1124 * <code>'metre'</code> multiplier=<code>'1'</code> scale=<code>'-3'</code> exponent=<code>'1'.</code> It can also be 1125 * expressed as a {@link Unit} with kind=<code>'metre'</code> 1126 * multiplier=<code>'0.001'</code> scale=<code>'0'</code> exponent=<code>'1'.</code> 1127 <p> 1128 * @param unit the {@link Unit} object to manipulate. 1129 <p> 1130 * @return integer value indicating success/failure of the function. The 1131 * possible values returned by this function are: 1132 * <ul> 1133 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1134 * 1135 * </ul> <p> 1136 * 1137 <p> 1138 * @see Unit#convertToSI(Unit u) 1139 * @see Unit#merge(Unit u1, Unit u2) 1140 */ public 1141 static int removeScale(Unit unit) { 1142 return libsbmlJNI.Unit_removeScale(Unit.getCPtr(unit), unit); 1143 } 1144 1145 1146/** 1147 * Merges two {@link Unit} objects with the same 'kind' attribute value into a 1148 * single {@link Unit}. 1149 <p> 1150 * For example, the following, 1151 * <div class='fragment'><pre class='fragment'> 1152 <unit kind='metre' exponent='2'/> 1153 <unit kind='metre' exponent='1'/> 1154 </pre></div> 1155 * would be merged to become 1156 * <div class='fragment'><pre class='fragment'> 1157 <unit kind='metre' exponent='3'/> 1158 </pre></div> 1159 <p> 1160 * @param unit1 the first {@link Unit} object; the result of the operation is 1161 * left as a new version of this unit, modified in-place. Not modified if 1162 * the two units have different kinds. 1163 <p> 1164 * @param unit2 the second {@link Unit} object to merge with the first 1165 <p> 1166 * 1167 <p> 1168 * @see Unit#convertToSI(Unit u) 1169 * @see Unit#removeScale(Unit u) 1170 */ public 1171 static void merge(Unit unit1, Unit unit2) { 1172 libsbmlJNI.Unit_merge(Unit.getCPtr(unit1), unit1, Unit.getCPtr(unit2), unit2); 1173 } 1174 1175 1176/** 1177 * Returns a {@link UnitDefinition} object containing the given <code>unit</code> converted 1178 * to the appropriate SI unit. 1179 <p> 1180 * This method exists because some units can be expressed in terms of 1181 * others when the same physical dimension is involved. For example, one 1182 * hertz is identical to 1 sec<sup>-1</sup>, one litre is equivalent 1183 * to 1 cubic decametre, and so on. 1184 <p> 1185 * @param unit the {@link Unit} object to convert to SI 1186 <p> 1187 * @return a {@link UnitDefinition} object containing the SI unit. 1188 <p> 1189 * 1190 <p> 1191 * @see Unit#merge(Unit u1, Unit u2) 1192 */ public 1193 static UnitDefinition convertToSI(Unit unit) { 1194 long cPtr = libsbmlJNI.Unit_convertToSI(Unit.getCPtr(unit), unit); 1195 return (cPtr == 0) ? null : new UnitDefinition(cPtr, true); 1196 } 1197 1198 1199/** 1200 * Predicate returning <code>true</code> if 1201 * all the required attributes for this {@link Unit} object 1202 * have been set. 1203 <p> 1204 * @note The required attributes for a {@link Unit} object are: 1205 * <ul> 1206 * <li> 'kind' 1207 * <li> 'exponent' (required in SBML Level 3; optional in Level 2) 1208 * <li> 'multiplier' (required in SBML Level 3; optional in Level 2) 1209 * <li> 'scale' (required in SBML Level 3; optional in Level 2) 1210 * 1211 * </ul> <p> 1212 * @return a boolean value indicating whether all the required 1213 * elements for this object have been defined. 1214 */ public 1215 boolean hasRequiredAttributes() { 1216 return libsbmlJNI.Unit_hasRequiredAttributes(swigCPtr, this); 1217 } 1218 1219}