001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.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 * A MIRIAM-compliant date representation. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. This class is not prescribed by 017the SBML specifications, although it is used to implement features 018defined in SBML. 019</p> 020 021 <p> 022 * A {@link Date} object stores a reasonably complete representation of date and 023 * time. Its purpose is to serve as a way to store dates to be read and 024 * written in the <a target='_blank' 025 * href='http://www.w3.org/TR/NOTE-datetime'>W3C date format</a> used in 026 * RDF Dublin Core annotations within SBML. The W3C date format is a 027 * restricted form of <a target='_blank' 028 * href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a>, the 029 * international standard for the representation of dates and times. A 030 * time and date value in this W3C format takes the form 031 * YYYY-MM-DDThh:mm:ssXHH:ZZ (e.g., <code>1997-07-16T19:20:30+01:00</code>) 032 * where XHH:ZZ is the time zone offset. The libSBML {@link Date} object contains 033 * the following fields to represent these values: 034 <p> 035 * <ul> 036 * <li> <em>year</em>: a long integer representing the year. This should be a 037 * four-digit number such as <code>2011.</code> 038 <p> 039 * <li> <em>month</em>: a long integer representing the month, with a range of 040 * values of 1–12. The value <code>1</code> represents January, and so on. 041 <p> 042 * <li> <em>day</em>: a long integer representing the day of the month, with a 043 * range of values of 1–31. 044 <p> 045 * <li> <em>hour</em>: a long integer representing the hour on a 24-hour clock, 046 * with a range of values of 0–23. 047 <p> 048 * <li> <em>minute</em>: a long integer representing the minute, with a range 049 * of 0–59. 050 <p> 051 * <li> <em>second</em>: a long integer representing the second, with a range 052 * of 0–59. 053 <p> 054 * <li> <em>sign</em>: a long integer representing the sign of the offset (<code>0</code> 055 * signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph below for 056 * further explanations. 057 <p> 058 * <li> <em>hours</em> <em>offset</em>: a long integer representing the time zone's hour 059 * offset from GMT, with a range of 0–12. 060 <p> 061 * <li> <em>minute</em> <em>offset</em>: a long integer representing the time zone's 062 * minute offset from GMT, with a range of 0–59. 063 * 064 * </ul> <p> 065 * To illustrate the time zone offset, a value of <code>-05:00</code> would 066 * correspond to USA Eastern Standard Time. In the {@link Date} object, this would 067 * require a value of <code>1</code> for the sign field, <code>5</code> for the hour offset and 068 * <code>0</code> for the minutes offset. 069 <p> 070 * In the restricted RDF annotations used in SBML, described in 071 * Section 6 of the SBML Level 2 and Level 3 specification 072 * documents, date/time stamps can be used to indicate the time of 073 * creation and modification of a model. The following SBML model fragment 074 * illustrates this: 075<pre class='fragment'> 076<model metaid='_180340' id='GMO' name='Goldbeter1991_MinMitOscil'> 077 <annotation> 078 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' 079 xmlns:dc='http://purl.org/dc/elements/1.1/' 080 xmlns:dcterms='http://purl.org/dc/terms/' 081 xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#' > 082 <rdf:Description rdf:about='#_180340'> 083 <dc:creator> 084 <rdf:Bag> 085 <rdf:li rdf:parseType='Resource'> 086 <vCard:N rdf:parseType='Resource'> 087 <vCard:Family>Shapiro</vCard:Family> 088 <vCard:Given>Bruce</vCard:Given> 089 </vCard:N> 090 <vCard:EMAIL>bshapiro@jpl.nasa.gov</vCard:EMAIL> 091 <vCard:ORG rdf:parseType='Resource'> 092 <vCard:Orgname>NASA Jet Propulsion Laboratory</vCard:Orgname> 093 </vCard:ORG> 094 </rdf:li> 095 </rdf:Bag> 096 </dc:creator> 097 <dcterms:created rdf:parseType='Resource'> 098 <dcterms:W3CDTF>2005-02-06T23:39:40+00:00</dcterms:W3CDTF> 099 </dcterms:created> 100 <dcterms:modified rdf:parseType='Resource'> 101 <dcterms:W3CDTF>2005-09-13T13:24:56+00:00</dcterms:W3CDTF> 102 </dcterms:modified> 103 </rdf:Description> 104 </rdf:RDF> 105 </annotation> 106</model> 107</pre> 108 */ 109 110public class Date { 111 private long swigCPtr; 112 protected boolean swigCMemOwn; 113 114 protected Date(long cPtr, boolean cMemoryOwn) 115 { 116 swigCMemOwn = cMemoryOwn; 117 swigCPtr = cPtr; 118 } 119 120 protected static long getCPtr(Date obj) 121 { 122 return (obj == null) ? 0 : obj.swigCPtr; 123 } 124 125 protected static long getCPtrAndDisown (Date obj) 126 { 127 long ptr = 0; 128 129 if (obj != null) 130 { 131 ptr = obj.swigCPtr; 132 obj.swigCMemOwn = false; 133 } 134 135 return ptr; 136 } 137 138 protected void finalize() { 139 delete(); 140 } 141 142 public synchronized void delete() { 143 if (swigCPtr != 0) { 144 if (swigCMemOwn) { 145 swigCMemOwn = false; 146 libsbmlJNI.delete_Date(swigCPtr); 147 } 148 swigCPtr = 0; 149 } 150 } 151 152 /** 153 * Equality comparison method for Date. 154 * <p> 155 * Because the Java methods for libSBML are actually wrappers around code 156 * implemented in C++ and C, certain operations will not behave as 157 * expected. Equality comparison is one such case. An instance of a 158 * libSBML object class is actually a <em>proxy object</em> 159 * wrapping the real underlying C/C++ object. The normal <code>==</code> 160 * equality operator in Java will <em>only compare the Java proxy objects</em>, 161 * not the underlying native object. The result is almost never what you 162 * want in practical situations. Unfortunately, Java does not provide a 163 * way to override <code>==</code>. 164 * <p> 165 * The alternative that must be followed is to use the 166 * <code>equals()</code> method. The <code>equals</code> method on this 167 * class overrides the default java.lang.Object one, and performs an 168 * intelligent comparison of instances of objects of this class. The 169 * result is an assessment of whether two libSBML Java objects are truly 170 * the same underlying native-code objects. 171 * <p> 172 * The use of this method in practice is the same as the use of any other 173 * Java <code>equals</code> method. For example, 174 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 175 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 176 * same underlying object. 177 * 178 * @param sb a reference to an object to which the current object 179 * instance will be compared 180 * 181 * @return <code>true</code> if <code>sb</code> refers to the same underlying 182 * native object as this one, <code>false</code> otherwise 183 */ 184 public boolean equals(Object sb) 185 { 186 if ( this == sb ) 187 { 188 return true; 189 } 190 return swigCPtr == getCPtr((Date)(sb)); 191 } 192 193 /** 194 * Returns a hashcode for this Date object. 195 * 196 * @return a hash code usable by Java methods that need them. 197 */ 198 public int hashCode() 199 { 200 return (int)(swigCPtr^(swigCPtr>>>32)); 201 } 202 203 204/** 205 * Creates a time and date representation for use in model annotations 206 * and elsewhere. 207 <p> 208 * The following is the complete set of possible arguments to this 209 * constructor, with default values as indicated: 210 <p> 211 * @param year a long integereger representing the year. This should be 212 * a four-digit number such as <code>2011.</code> (Default value used if this 213 * argument is not given: <code>2000.</code>) 214 <p> 215 * @param month a long integereger representing the month, with a range 216 * of values of 1–12. The value <code>1</code> represents January, and so 217 * on. (Default value used if this argument is not given: <code>1.</code>) 218 <p> 219 * @param day a long integereger representing the day of the month, with 220 * a range of values of 1–31. (Default value used if this argument 221 * is not given: <code>1.</code>) 222 <p> 223 * @param hour a long integereger representing the hour on a 24-hour 224 * clock, with a range of values of 0–23. (Default value used if 225 * this argument is not given: <code>0.</code>) 226 <p> 227 * @param minute a long integereger representing the minute, with a 228 * range of 0–59. (Default value used if this argument is not 229 * given: <code>0.</code>) 230 <p> 231 * @param second a long integereger representing the second, with a 232 * range of 0–59. (Default value used if this argument is not 233 * given: <code>0.</code>) 234 <p> 235 * @param sign a long integereger representing the sign of the offset 236 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 237 * below for further explanations. (Default value used if this argument 238 * is not given: <code>0.</code>) 239 <p> 240 * @param hoursOffset a long integereger representing the time zone's 241 * hour offset from GMT. (Default value used if this argument is not 242 * given: <code>0.</code>) 243 <p> 244 * @param minutesOffset a long integereger representing the time zone's 245 * minute offset from GMT. (Default value used if this argument is not 246 * given: <code>0.</code>) 247 <p> 248 * To illustrate the time zone offset, a value of <code>-05:00</code> 249 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 250 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 251 * hour offset and <code>0</code> for the minutes offset. 252 <p> 253 * 254</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 255The native C++ implementation of this method defines a default argument 256value. In the documentation generated for different libSBML language 257bindings, you may or may not see corresponding arguments in the method 258declarations. For example, in Java and C#, a default argument is handled by 259declaring two separate methods, with one of them having the argument and 260the other one lacking the argument. However, the libSBML documentation will 261be <em>identical</em> for both methods. Consequently, if you are reading 262this and do not see an argument even though one is described, please look 263for descriptions of other variants of this method near where this one 264appears in the documentation. 265</dd></dl> 266 267 */ public 268 Date(long year, long month, long day, long hour, long minute, long second, long sign, long hoursOffset, long minutesOffset) { 269 this(libsbmlJNI.new_Date__SWIG_0(year, month, day, hour, minute, second, sign, hoursOffset, minutesOffset), true); 270 } 271 272 273/** 274 * Creates a time and date representation for use in model annotations 275 * and elsewhere. 276 <p> 277 * The following is the complete set of possible arguments to this 278 * constructor, with default values as indicated: 279 <p> 280 * @param year a long integereger representing the year. This should be 281 * a four-digit number such as <code>2011.</code> (Default value used if this 282 * argument is not given: <code>2000.</code>) 283 <p> 284 * @param month a long integereger representing the month, with a range 285 * of values of 1–12. The value <code>1</code> represents January, and so 286 * on. (Default value used if this argument is not given: <code>1.</code>) 287 <p> 288 * @param day a long integereger representing the day of the month, with 289 * a range of values of 1–31. (Default value used if this argument 290 * is not given: <code>1.</code>) 291 <p> 292 * @param hour a long integereger representing the hour on a 24-hour 293 * clock, with a range of values of 0–23. (Default value used if 294 * this argument is not given: <code>0.</code>) 295 <p> 296 * @param minute a long integereger representing the minute, with a 297 * range of 0–59. (Default value used if this argument is not 298 * given: <code>0.</code>) 299 <p> 300 * @param second a long integereger representing the second, with a 301 * range of 0–59. (Default value used if this argument is not 302 * given: <code>0.</code>) 303 <p> 304 * @param sign a long integereger representing the sign of the offset 305 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 306 * below for further explanations. (Default value used if this argument 307 * is not given: <code>0.</code>) 308 <p> 309 * @param hoursOffset a long integereger representing the time zone's 310 * hour offset from GMT. (Default value used if this argument is not 311 * given: <code>0.</code>) 312 <p> 313 * @param minutesOffset a long integereger representing the time zone's 314 * minute offset from GMT. (Default value used if this argument is not 315 * given: <code>0.</code>) 316 <p> 317 * To illustrate the time zone offset, a value of <code>-05:00</code> 318 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 319 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 320 * hour offset and <code>0</code> for the minutes offset. 321 <p> 322 * 323</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 324The native C++ implementation of this method defines a default argument 325value. In the documentation generated for different libSBML language 326bindings, you may or may not see corresponding arguments in the method 327declarations. For example, in Java and C#, a default argument is handled by 328declaring two separate methods, with one of them having the argument and 329the other one lacking the argument. However, the libSBML documentation will 330be <em>identical</em> for both methods. Consequently, if you are reading 331this and do not see an argument even though one is described, please look 332for descriptions of other variants of this method near where this one 333appears in the documentation. 334</dd></dl> 335 336 */ public 337 Date(long year, long month, long day, long hour, long minute, long second, long sign, long hoursOffset) { 338 this(libsbmlJNI.new_Date__SWIG_1(year, month, day, hour, minute, second, sign, hoursOffset), true); 339 } 340 341 342/** 343 * Creates a time and date representation for use in model annotations 344 * and elsewhere. 345 <p> 346 * The following is the complete set of possible arguments to this 347 * constructor, with default values as indicated: 348 <p> 349 * @param year a long integereger representing the year. This should be 350 * a four-digit number such as <code>2011.</code> (Default value used if this 351 * argument is not given: <code>2000.</code>) 352 <p> 353 * @param month a long integereger representing the month, with a range 354 * of values of 1–12. The value <code>1</code> represents January, and so 355 * on. (Default value used if this argument is not given: <code>1.</code>) 356 <p> 357 * @param day a long integereger representing the day of the month, with 358 * a range of values of 1–31. (Default value used if this argument 359 * is not given: <code>1.</code>) 360 <p> 361 * @param hour a long integereger representing the hour on a 24-hour 362 * clock, with a range of values of 0–23. (Default value used if 363 * this argument is not given: <code>0.</code>) 364 <p> 365 * @param minute a long integereger representing the minute, with a 366 * range of 0–59. (Default value used if this argument is not 367 * given: <code>0.</code>) 368 <p> 369 * @param second a long integereger representing the second, with a 370 * range of 0–59. (Default value used if this argument is not 371 * given: <code>0.</code>) 372 <p> 373 * @param sign a long integereger representing the sign of the offset 374 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 375 * below for further explanations. (Default value used if this argument 376 * is not given: <code>0.</code>) 377 <p> 378 * @param hoursOffset a long integereger representing the time zone's 379 * hour offset from GMT. (Default value used if this argument is not 380 * given: <code>0.</code>) 381 <p> 382 * @param minutesOffset a long integereger representing the time zone's 383 * minute offset from GMT. (Default value used if this argument is not 384 * given: <code>0.</code>) 385 <p> 386 * To illustrate the time zone offset, a value of <code>-05:00</code> 387 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 388 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 389 * hour offset and <code>0</code> for the minutes offset. 390 <p> 391 * 392</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 393The native C++ implementation of this method defines a default argument 394value. In the documentation generated for different libSBML language 395bindings, you may or may not see corresponding arguments in the method 396declarations. For example, in Java and C#, a default argument is handled by 397declaring two separate methods, with one of them having the argument and 398the other one lacking the argument. However, the libSBML documentation will 399be <em>identical</em> for both methods. Consequently, if you are reading 400this and do not see an argument even though one is described, please look 401for descriptions of other variants of this method near where this one 402appears in the documentation. 403</dd></dl> 404 405 */ public 406 Date(long year, long month, long day, long hour, long minute, long second, long sign) { 407 this(libsbmlJNI.new_Date__SWIG_2(year, month, day, hour, minute, second, sign), true); 408 } 409 410 411/** 412 * Creates a time and date representation for use in model annotations 413 * and elsewhere. 414 <p> 415 * The following is the complete set of possible arguments to this 416 * constructor, with default values as indicated: 417 <p> 418 * @param year a long integereger representing the year. This should be 419 * a four-digit number such as <code>2011.</code> (Default value used if this 420 * argument is not given: <code>2000.</code>) 421 <p> 422 * @param month a long integereger representing the month, with a range 423 * of values of 1–12. The value <code>1</code> represents January, and so 424 * on. (Default value used if this argument is not given: <code>1.</code>) 425 <p> 426 * @param day a long integereger representing the day of the month, with 427 * a range of values of 1–31. (Default value used if this argument 428 * is not given: <code>1.</code>) 429 <p> 430 * @param hour a long integereger representing the hour on a 24-hour 431 * clock, with a range of values of 0–23. (Default value used if 432 * this argument is not given: <code>0.</code>) 433 <p> 434 * @param minute a long integereger representing the minute, with a 435 * range of 0–59. (Default value used if this argument is not 436 * given: <code>0.</code>) 437 <p> 438 * @param second a long integereger representing the second, with a 439 * range of 0–59. (Default value used if this argument is not 440 * given: <code>0.</code>) 441 <p> 442 * @param sign a long integereger representing the sign of the offset 443 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 444 * below for further explanations. (Default value used if this argument 445 * is not given: <code>0.</code>) 446 <p> 447 * @param hoursOffset a long integereger representing the time zone's 448 * hour offset from GMT. (Default value used if this argument is not 449 * given: <code>0.</code>) 450 <p> 451 * @param minutesOffset a long integereger representing the time zone's 452 * minute offset from GMT. (Default value used if this argument is not 453 * given: <code>0.</code>) 454 <p> 455 * To illustrate the time zone offset, a value of <code>-05:00</code> 456 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 457 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 458 * hour offset and <code>0</code> for the minutes offset. 459 <p> 460 * 461</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 462The native C++ implementation of this method defines a default argument 463value. In the documentation generated for different libSBML language 464bindings, you may or may not see corresponding arguments in the method 465declarations. For example, in Java and C#, a default argument is handled by 466declaring two separate methods, with one of them having the argument and 467the other one lacking the argument. However, the libSBML documentation will 468be <em>identical</em> for both methods. Consequently, if you are reading 469this and do not see an argument even though one is described, please look 470for descriptions of other variants of this method near where this one 471appears in the documentation. 472</dd></dl> 473 474 */ public 475 Date(long year, long month, long day, long hour, long minute, long second) { 476 this(libsbmlJNI.new_Date__SWIG_3(year, month, day, hour, minute, second), true); 477 } 478 479 480/** 481 * Creates a time and date representation for use in model annotations 482 * and elsewhere. 483 <p> 484 * The following is the complete set of possible arguments to this 485 * constructor, with default values as indicated: 486 <p> 487 * @param year a long integereger representing the year. This should be 488 * a four-digit number such as <code>2011.</code> (Default value used if this 489 * argument is not given: <code>2000.</code>) 490 <p> 491 * @param month a long integereger representing the month, with a range 492 * of values of 1–12. The value <code>1</code> represents January, and so 493 * on. (Default value used if this argument is not given: <code>1.</code>) 494 <p> 495 * @param day a long integereger representing the day of the month, with 496 * a range of values of 1–31. (Default value used if this argument 497 * is not given: <code>1.</code>) 498 <p> 499 * @param hour a long integereger representing the hour on a 24-hour 500 * clock, with a range of values of 0–23. (Default value used if 501 * this argument is not given: <code>0.</code>) 502 <p> 503 * @param minute a long integereger representing the minute, with a 504 * range of 0–59. (Default value used if this argument is not 505 * given: <code>0.</code>) 506 <p> 507 * @param second a long integereger representing the second, with a 508 * range of 0–59. (Default value used if this argument is not 509 * given: <code>0.</code>) 510 <p> 511 * @param sign a long integereger representing the sign of the offset 512 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 513 * below for further explanations. (Default value used if this argument 514 * is not given: <code>0.</code>) 515 <p> 516 * @param hoursOffset a long integereger representing the time zone's 517 * hour offset from GMT. (Default value used if this argument is not 518 * given: <code>0.</code>) 519 <p> 520 * @param minutesOffset a long integereger representing the time zone's 521 * minute offset from GMT. (Default value used if this argument is not 522 * given: <code>0.</code>) 523 <p> 524 * To illustrate the time zone offset, a value of <code>-05:00</code> 525 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 526 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 527 * hour offset and <code>0</code> for the minutes offset. 528 <p> 529 * 530</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 531The native C++ implementation of this method defines a default argument 532value. In the documentation generated for different libSBML language 533bindings, you may or may not see corresponding arguments in the method 534declarations. For example, in Java and C#, a default argument is handled by 535declaring two separate methods, with one of them having the argument and 536the other one lacking the argument. However, the libSBML documentation will 537be <em>identical</em> for both methods. Consequently, if you are reading 538this and do not see an argument even though one is described, please look 539for descriptions of other variants of this method near where this one 540appears in the documentation. 541</dd></dl> 542 543 */ public 544 Date(long year, long month, long day, long hour, long minute) { 545 this(libsbmlJNI.new_Date__SWIG_4(year, month, day, hour, minute), true); 546 } 547 548 549/** 550 * Creates a time and date representation for use in model annotations 551 * and elsewhere. 552 <p> 553 * The following is the complete set of possible arguments to this 554 * constructor, with default values as indicated: 555 <p> 556 * @param year a long integereger representing the year. This should be 557 * a four-digit number such as <code>2011.</code> (Default value used if this 558 * argument is not given: <code>2000.</code>) 559 <p> 560 * @param month a long integereger representing the month, with a range 561 * of values of 1–12. The value <code>1</code> represents January, and so 562 * on. (Default value used if this argument is not given: <code>1.</code>) 563 <p> 564 * @param day a long integereger representing the day of the month, with 565 * a range of values of 1–31. (Default value used if this argument 566 * is not given: <code>1.</code>) 567 <p> 568 * @param hour a long integereger representing the hour on a 24-hour 569 * clock, with a range of values of 0–23. (Default value used if 570 * this argument is not given: <code>0.</code>) 571 <p> 572 * @param minute a long integereger representing the minute, with a 573 * range of 0–59. (Default value used if this argument is not 574 * given: <code>0.</code>) 575 <p> 576 * @param second a long integereger representing the second, with a 577 * range of 0–59. (Default value used if this argument is not 578 * given: <code>0.</code>) 579 <p> 580 * @param sign a long integereger representing the sign of the offset 581 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 582 * below for further explanations. (Default value used if this argument 583 * is not given: <code>0.</code>) 584 <p> 585 * @param hoursOffset a long integereger representing the time zone's 586 * hour offset from GMT. (Default value used if this argument is not 587 * given: <code>0.</code>) 588 <p> 589 * @param minutesOffset a long integereger representing the time zone's 590 * minute offset from GMT. (Default value used if this argument is not 591 * given: <code>0.</code>) 592 <p> 593 * To illustrate the time zone offset, a value of <code>-05:00</code> 594 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 595 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 596 * hour offset and <code>0</code> for the minutes offset. 597 <p> 598 * 599</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 600The native C++ implementation of this method defines a default argument 601value. In the documentation generated for different libSBML language 602bindings, you may or may not see corresponding arguments in the method 603declarations. For example, in Java and C#, a default argument is handled by 604declaring two separate methods, with one of them having the argument and 605the other one lacking the argument. However, the libSBML documentation will 606be <em>identical</em> for both methods. Consequently, if you are reading 607this and do not see an argument even though one is described, please look 608for descriptions of other variants of this method near where this one 609appears in the documentation. 610</dd></dl> 611 612 */ public 613 Date(long year, long month, long day, long hour) { 614 this(libsbmlJNI.new_Date__SWIG_5(year, month, day, hour), true); 615 } 616 617 618/** 619 * Creates a time and date representation for use in model annotations 620 * and elsewhere. 621 <p> 622 * The following is the complete set of possible arguments to this 623 * constructor, with default values as indicated: 624 <p> 625 * @param year a long integereger representing the year. This should be 626 * a four-digit number such as <code>2011.</code> (Default value used if this 627 * argument is not given: <code>2000.</code>) 628 <p> 629 * @param month a long integereger representing the month, with a range 630 * of values of 1–12. The value <code>1</code> represents January, and so 631 * on. (Default value used if this argument is not given: <code>1.</code>) 632 <p> 633 * @param day a long integereger representing the day of the month, with 634 * a range of values of 1–31. (Default value used if this argument 635 * is not given: <code>1.</code>) 636 <p> 637 * @param hour a long integereger representing the hour on a 24-hour 638 * clock, with a range of values of 0–23. (Default value used if 639 * this argument is not given: <code>0.</code>) 640 <p> 641 * @param minute a long integereger representing the minute, with a 642 * range of 0–59. (Default value used if this argument is not 643 * given: <code>0.</code>) 644 <p> 645 * @param second a long integereger representing the second, with a 646 * range of 0–59. (Default value used if this argument is not 647 * given: <code>0.</code>) 648 <p> 649 * @param sign a long integereger representing the sign of the offset 650 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 651 * below for further explanations. (Default value used if this argument 652 * is not given: <code>0.</code>) 653 <p> 654 * @param hoursOffset a long integereger representing the time zone's 655 * hour offset from GMT. (Default value used if this argument is not 656 * given: <code>0.</code>) 657 <p> 658 * @param minutesOffset a long integereger representing the time zone's 659 * minute offset from GMT. (Default value used if this argument is not 660 * given: <code>0.</code>) 661 <p> 662 * To illustrate the time zone offset, a value of <code>-05:00</code> 663 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 664 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 665 * hour offset and <code>0</code> for the minutes offset. 666 <p> 667 * 668</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 669The native C++ implementation of this method defines a default argument 670value. In the documentation generated for different libSBML language 671bindings, you may or may not see corresponding arguments in the method 672declarations. For example, in Java and C#, a default argument is handled by 673declaring two separate methods, with one of them having the argument and 674the other one lacking the argument. However, the libSBML documentation will 675be <em>identical</em> for both methods. Consequently, if you are reading 676this and do not see an argument even though one is described, please look 677for descriptions of other variants of this method near where this one 678appears in the documentation. 679</dd></dl> 680 681 */ public 682 Date(long year, long month, long day) { 683 this(libsbmlJNI.new_Date__SWIG_6(year, month, day), true); 684 } 685 686 687/** 688 * Creates a time and date representation for use in model annotations 689 * and elsewhere. 690 <p> 691 * The following is the complete set of possible arguments to this 692 * constructor, with default values as indicated: 693 <p> 694 * @param year a long integereger representing the year. This should be 695 * a four-digit number such as <code>2011.</code> (Default value used if this 696 * argument is not given: <code>2000.</code>) 697 <p> 698 * @param month a long integereger representing the month, with a range 699 * of values of 1–12. The value <code>1</code> represents January, and so 700 * on. (Default value used if this argument is not given: <code>1.</code>) 701 <p> 702 * @param day a long integereger representing the day of the month, with 703 * a range of values of 1–31. (Default value used if this argument 704 * is not given: <code>1.</code>) 705 <p> 706 * @param hour a long integereger representing the hour on a 24-hour 707 * clock, with a range of values of 0–23. (Default value used if 708 * this argument is not given: <code>0.</code>) 709 <p> 710 * @param minute a long integereger representing the minute, with a 711 * range of 0–59. (Default value used if this argument is not 712 * given: <code>0.</code>) 713 <p> 714 * @param second a long integereger representing the second, with a 715 * range of 0–59. (Default value used if this argument is not 716 * given: <code>0.</code>) 717 <p> 718 * @param sign a long integereger representing the sign of the offset 719 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 720 * below for further explanations. (Default value used if this argument 721 * is not given: <code>0.</code>) 722 <p> 723 * @param hoursOffset a long integereger representing the time zone's 724 * hour offset from GMT. (Default value used if this argument is not 725 * given: <code>0.</code>) 726 <p> 727 * @param minutesOffset a long integereger representing the time zone's 728 * minute offset from GMT. (Default value used if this argument is not 729 * given: <code>0.</code>) 730 <p> 731 * To illustrate the time zone offset, a value of <code>-05:00</code> 732 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 733 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 734 * hour offset and <code>0</code> for the minutes offset. 735 <p> 736 * 737</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 738The native C++ implementation of this method defines a default argument 739value. In the documentation generated for different libSBML language 740bindings, you may or may not see corresponding arguments in the method 741declarations. For example, in Java and C#, a default argument is handled by 742declaring two separate methods, with one of them having the argument and 743the other one lacking the argument. However, the libSBML documentation will 744be <em>identical</em> for both methods. Consequently, if you are reading 745this and do not see an argument even though one is described, please look 746for descriptions of other variants of this method near where this one 747appears in the documentation. 748</dd></dl> 749 750 */ public 751 Date(long year, long month) { 752 this(libsbmlJNI.new_Date__SWIG_7(year, month), true); 753 } 754 755 756/** 757 * Creates a time and date representation for use in model annotations 758 * and elsewhere. 759 <p> 760 * The following is the complete set of possible arguments to this 761 * constructor, with default values as indicated: 762 <p> 763 * @param year a long integereger representing the year. This should be 764 * a four-digit number such as <code>2011.</code> (Default value used if this 765 * argument is not given: <code>2000.</code>) 766 <p> 767 * @param month a long integereger representing the month, with a range 768 * of values of 1–12. The value <code>1</code> represents January, and so 769 * on. (Default value used if this argument is not given: <code>1.</code>) 770 <p> 771 * @param day a long integereger representing the day of the month, with 772 * a range of values of 1–31. (Default value used if this argument 773 * is not given: <code>1.</code>) 774 <p> 775 * @param hour a long integereger representing the hour on a 24-hour 776 * clock, with a range of values of 0–23. (Default value used if 777 * this argument is not given: <code>0.</code>) 778 <p> 779 * @param minute a long integereger representing the minute, with a 780 * range of 0–59. (Default value used if this argument is not 781 * given: <code>0.</code>) 782 <p> 783 * @param second a long integereger representing the second, with a 784 * range of 0–59. (Default value used if this argument is not 785 * given: <code>0.</code>) 786 <p> 787 * @param sign a long integereger representing the sign of the offset 788 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 789 * below for further explanations. (Default value used if this argument 790 * is not given: <code>0.</code>) 791 <p> 792 * @param hoursOffset a long integereger representing the time zone's 793 * hour offset from GMT. (Default value used if this argument is not 794 * given: <code>0.</code>) 795 <p> 796 * @param minutesOffset a long integereger representing the time zone's 797 * minute offset from GMT. (Default value used if this argument is not 798 * given: <code>0.</code>) 799 <p> 800 * To illustrate the time zone offset, a value of <code>-05:00</code> 801 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 802 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 803 * hour offset and <code>0</code> for the minutes offset. 804 <p> 805 * 806</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 807The native C++ implementation of this method defines a default argument 808value. In the documentation generated for different libSBML language 809bindings, you may or may not see corresponding arguments in the method 810declarations. For example, in Java and C#, a default argument is handled by 811declaring two separate methods, with one of them having the argument and 812the other one lacking the argument. However, the libSBML documentation will 813be <em>identical</em> for both methods. Consequently, if you are reading 814this and do not see an argument even though one is described, please look 815for descriptions of other variants of this method near where this one 816appears in the documentation. 817</dd></dl> 818 819 */ public 820 Date(long year) { 821 this(libsbmlJNI.new_Date__SWIG_8(year), true); 822 } 823 824 825/** 826 * Creates a time and date representation for use in model annotations 827 * and elsewhere. 828 <p> 829 * The following is the complete set of possible arguments to this 830 * constructor, with default values as indicated: 831 <p> 832 * @param year a long integereger representing the year. This should be 833 * a four-digit number such as <code>2011.</code> (Default value used if this 834 * argument is not given: <code>2000.</code>) 835 <p> 836 * @param month a long integereger representing the month, with a range 837 * of values of 1–12. The value <code>1</code> represents January, and so 838 * on. (Default value used if this argument is not given: <code>1.</code>) 839 <p> 840 * @param day a long integereger representing the day of the month, with 841 * a range of values of 1–31. (Default value used if this argument 842 * is not given: <code>1.</code>) 843 <p> 844 * @param hour a long integereger representing the hour on a 24-hour 845 * clock, with a range of values of 0–23. (Default value used if 846 * this argument is not given: <code>0.</code>) 847 <p> 848 * @param minute a long integereger representing the minute, with a 849 * range of 0–59. (Default value used if this argument is not 850 * given: <code>0.</code>) 851 <p> 852 * @param second a long integereger representing the second, with a 853 * range of 0–59. (Default value used if this argument is not 854 * given: <code>0.</code>) 855 <p> 856 * @param sign a long integereger representing the sign of the offset 857 * (<code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-</code>). See the paragraph 858 * below for further explanations. (Default value used if this argument 859 * is not given: <code>0.</code>) 860 <p> 861 * @param hoursOffset a long integereger representing the time zone's 862 * hour offset from GMT. (Default value used if this argument is not 863 * given: <code>0.</code>) 864 <p> 865 * @param minutesOffset a long integereger representing the time zone's 866 * minute offset from GMT. (Default value used if this argument is not 867 * given: <code>0.</code>) 868 <p> 869 * To illustrate the time zone offset, a value of <code>-05:00</code> 870 * would correspond to USA Eastern Standard Time. In the {@link Date} object, 871 * this would require a value of <code>1</code> for the sign field, <code>5</code> for the 872 * hour offset and <code>0</code> for the minutes offset. 873 <p> 874 * 875</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 876The native C++ implementation of this method defines a default argument 877value. In the documentation generated for different libSBML language 878bindings, you may or may not see corresponding arguments in the method 879declarations. For example, in Java and C#, a default argument is handled by 880declaring two separate methods, with one of them having the argument and 881the other one lacking the argument. However, the libSBML documentation will 882be <em>identical</em> for both methods. Consequently, if you are reading 883this and do not see an argument even though one is described, please look 884for descriptions of other variants of this method near where this one 885appears in the documentation. 886</dd></dl> 887 888 */ public 889 Date() { 890 this(libsbmlJNI.new_Date__SWIG_9(), true); 891 } 892 893 894/** 895 * Creates a {@link Date} object from a string expressing a date and time value. 896 <p> 897 * This constructor expects its argument to be in the <a target='_blank' 898 * href='http://www.w3.org/TR/NOTE-datetime'>W3C date format with time 899 * zone offset</a>, used in RDF Dublin Core annotations within SBML. 900 <p> 901 * <p> 902 * The date format expresses a date and time value as a string of the form 903 * YYYY-MM-DDThh:mm:ssXHH:ZZ, where 904 <p> 905 * <ul> 906 * <li> <em>YYYY</em> is a four-digit integer representing the year. This 907 * should be a four-digit number such as <code>2011.</code> 908 <p> 909 * <li> <em>MM</em> is a two-digit integer representing the month, with a range 910 * of values of 01–12. The value <code>1</code> represents January, and so 911 * on. 912 <p> 913 * <li> <em>DD</em> is a two-digit integer representing the day of the month, 914 * with a range of values of 01–31. 915 <p> 916 * <li> <em>T</em> is the literal character <code>T.</code> 917 <p> 918 * <li> <em>hh</em> is a two-digit integer representing the hour on a 24-hour 919 * clock, with a range of values of 00–23. 920 <p> 921 * <li> <em>mm</em> is a two-digit integer representing the minute, with a 922 * range of 00–59. 923 <p> 924 * <li> <em>ss</em> is a two-digit integer representing the second, with a 925 * range of 0–59. 926 <p> 927 * <li> <em>X</em> is the the sign of the time zone offset, either <code>+</code> or 928 * <code>-</code>. 929 <p> 930 * <li> <em>HH</em> is a two-digit integer representing the hour of the time 931 * zone offset, with a range of 00–23. 932 <p> 933 * <li> <em>ZZ</em> is a two-digit integer representing the minutes of the time 934 * zone offset, with a range of 00–59. 935 * 936 * </ul> <p> 937 * In the string format above, it is important not to forget the literal 938 * character <code>T</code> in the string. Here is an example date/time string: 939 * <code>1997-07-16T19:20:30+01:00</code>, which would represent July 16, 940 * 1997, at 19:20:30 in Central European Time (which is UTC +1:00). 941 <p> 942 * If this constructor is given a <code>null</code> argument or a string of length 943 * zero, it constructs a {@link Date} object with the value of January 1, 2000, 944 * at time 00:00 UTC. Otherwise, the argument <em>must</em> be in the 945 * complete format described above, or unpredictable results will happen. 946 <p> 947 * @param date a string representing the date. 948 */ public 949 Date(String date) { 950 this(libsbmlJNI.new_Date__SWIG_10(date), true); 951 } 952 953 954/** 955 * Copy constructor; creates a copy of this {@link Date}. 956 <p> 957 * @param orig the object to copy. 958 */ public 959 Date(Date orig) { 960 this(libsbmlJNI.new_Date__SWIG_11(Date.getCPtr(orig), orig), true); 961 } 962 963 964/** 965 * Creates and returns a deep copy of this {@link Date} object. 966 <p> 967 * @return the (deep) copy of this {@link Date} object. 968 */ public 969 Date cloneObject() { 970 long cPtr = libsbmlJNI.Date_cloneObject(swigCPtr, this); 971 return (cPtr == 0) ? null : new Date(cPtr, true); 972 } 973 974 975/** 976 * Returns the year from this {@link Date}. 977 <p> 978 * @return the year from this {@link Date}. 979 */ public 980 long getYear() { 981 return libsbmlJNI.Date_getYear(swigCPtr, this); 982 } 983 984 985/** 986 * Returns the month from this {@link Date}. 987 <p> 988 * @return the month from this {@link Date}. 989 */ public 990 long getMonth() { 991 return libsbmlJNI.Date_getMonth(swigCPtr, this); 992 } 993 994 995/** 996 * Returns the day from this {@link Date}. 997 <p> 998 * @return the day from this {@link Date}. 999 */ public 1000 long getDay() { 1001 return libsbmlJNI.Date_getDay(swigCPtr, this); 1002 } 1003 1004 1005/** 1006 * Returns the hour from this {@link Date}. 1007 <p> 1008 * @return the hour from this {@link Date}. 1009 */ public 1010 long getHour() { 1011 return libsbmlJNI.Date_getHour(swigCPtr, this); 1012 } 1013 1014 1015/** 1016 * Returns the minute from this {@link Date}. 1017 <p> 1018 * @return the minute from this {@link Date}. 1019 */ public 1020 long getMinute() { 1021 return libsbmlJNI.Date_getMinute(swigCPtr, this); 1022 } 1023 1024 1025/** 1026 * Returns the seconds from this {@link Date}. 1027 <p> 1028 * @return the seconds from this {@link Date}. 1029 */ public 1030 long getSecond() { 1031 return libsbmlJNI.Date_getSecond(swigCPtr, this); 1032 } 1033 1034 1035/** 1036 * Returns the sign of the time zone offset from this {@link Date}. 1037 <p> 1038 * @return the sign of the offset from this {@link Date}. 1039 */ public 1040 long getSignOffset() { 1041 return libsbmlJNI.Date_getSignOffset(swigCPtr, this); 1042 } 1043 1044 1045/** 1046 * Returns the hours of the time zone offset from this {@link Date}. 1047 <p> 1048 * @return the hours of the offset from this {@link Date}. 1049 */ public 1050 long getHoursOffset() { 1051 return libsbmlJNI.Date_getHoursOffset(swigCPtr, this); 1052 } 1053 1054 1055/** 1056 * Returns the minutes of the time zone offset from this {@link Date}. 1057 <p> 1058 * @return the minutes of the offset from this {@link Date}. 1059 */ public 1060 long getMinutesOffset() { 1061 return libsbmlJNI.Date_getMinutesOffset(swigCPtr, this); 1062 } 1063 1064 1065/** 1066 * Returns the current {@link Date} value in text-string form. 1067 <p> 1068 * The string returned will be in the <a target='_blank' 1069 * href='http://www.w3.org/TR/NOTE-datetime'>W3C date format with time 1070 * zone offset</a>, used in RDF Dublin Core annotations within SBML. 1071 <p> 1072 * <p> 1073 * The date format expresses a date and time value as a string of the form 1074 * YYYY-MM-DDThh:mm:ssXHH:ZZ, where 1075 <p> 1076 * <ul> 1077 * <li> <em>YYYY</em> is a four-digit integer representing the year. This 1078 * should be a four-digit number such as <code>2011.</code> 1079 <p> 1080 * <li> <em>MM</em> is a two-digit integer representing the month, with a range 1081 * of values of 01–12. The value <code>1</code> represents January, and so 1082 * on. 1083 <p> 1084 * <li> <em>DD</em> is a two-digit integer representing the day of the month, 1085 * with a range of values of 01–31. 1086 <p> 1087 * <li> <em>T</em> is the literal character <code>T.</code> 1088 <p> 1089 * <li> <em>hh</em> is a two-digit integer representing the hour on a 24-hour 1090 * clock, with a range of values of 00–23. 1091 <p> 1092 * <li> <em>mm</em> is a two-digit integer representing the minute, with a 1093 * range of 00–59. 1094 <p> 1095 * <li> <em>ss</em> is a two-digit integer representing the second, with a 1096 * range of 0–59. 1097 <p> 1098 * <li> <em>X</em> is the the sign of the time zone offset, either <code>+</code> or 1099 * <code>-</code>. 1100 <p> 1101 * <li> <em>HH</em> is a two-digit integer representing the hour of the time 1102 * zone offset, with a range of 00–23. 1103 <p> 1104 * <li> <em>ZZ</em> is a two-digit integer representing the minutes of the time 1105 * zone offset, with a range of 00–59. 1106 * 1107 * </ul> <p> 1108 * In the string format above, it is important not to forget the literal 1109 * character <code>T</code> in the string. Here is an example date/time string: 1110 * <code>1997-07-16T19:20:30+01:00</code>, which would represent July 16, 1111 * 1997, at 19:20:30 in Central European Time (which is UTC +1:00). 1112 <p> 1113 * @return the date as a string. 1114 */ public 1115 String getDateAsString() { 1116 return libsbmlJNI.Date_getDateAsString(swigCPtr, this); 1117 } 1118 1119 1120/** 1121 * Sets the value of the year of this {@link Date} object. 1122 <p> 1123 * The value given as argument must be between 1000 and 9999 inclusive. 1124 * (In the millennium during which this libSBML documentation is being 1125 * written, a typical value is <code>2011</code>, but we hope that SBML will 1126 * continue to be used for a long time.) 1127 <p> 1128 * @param year a long integer representing the year. 1129 <p> 1130 * <p> 1131 * @return integer value indicating success/failure of the 1132 * function. The possible values 1133 * returned by this function are: 1134 * <ul> 1135 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1136 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1137 * </ul> 1138 */ public 1139 int setYear(long year) { 1140 return libsbmlJNI.Date_setYear(swigCPtr, this, year); 1141 } 1142 1143 1144/** 1145 * Sets the value of the month of this {@link Date} object. 1146 <p> 1147 * @param month a long integer representing the month; it must be in the 1148 * range 1–12 or an error will be signaled. 1149 <p> 1150 * <p> 1151 * @return integer value indicating success/failure of the 1152 * function. The possible values 1153 * returned by this function are: 1154 * <ul> 1155 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1156 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1157 * </ul> 1158 */ public 1159 int setMonth(long month) { 1160 return libsbmlJNI.Date_setMonth(swigCPtr, this, month); 1161 } 1162 1163 1164/** 1165 * Sets the value of the day of this {@link Date} object. 1166 <p> 1167 * @param day a long integer representing the day; it must be in the 1168 * range 0–31 or an error will be signaled. 1169 <p> 1170 * <p> 1171 * @return integer value indicating success/failure of the 1172 * function. The possible values 1173 * returned by this function are: 1174 * <ul> 1175 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1176 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1177 * </ul> 1178 */ public 1179 int setDay(long day) { 1180 return libsbmlJNI.Date_setDay(swigCPtr, this, day); 1181 } 1182 1183 1184/** 1185 * Sets the value of the hour of this {@link Date} object. 1186 <p> 1187 * @param hour a long integer representing the hour to set; it must be 1188 * in the range 0–23 or an error will be signaled. 1189 <p> 1190 * <p> 1191 * @return integer value indicating success/failure of the 1192 * function. The possible values 1193 * returned by this function are: 1194 * <ul> 1195 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1196 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1197 * </ul> 1198 */ public 1199 int setHour(long hour) { 1200 return libsbmlJNI.Date_setHour(swigCPtr, this, hour); 1201 } 1202 1203 1204/** 1205 * Sets the value of the minute of this {@link Date} object. 1206 <p> 1207 * @param minute a long integer representing the minute to set; it must 1208 * be in the range 0–59 or an error will be signaled. 1209 <p> 1210 * <p> 1211 * @return integer value indicating success/failure of the 1212 * function. The possible values 1213 * returned by this function are: 1214 * <ul> 1215 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1216 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1217 * </ul> 1218 */ public 1219 int setMinute(long minute) { 1220 return libsbmlJNI.Date_setMinute(swigCPtr, this, minute); 1221 } 1222 1223 1224/** 1225 * Sets the value of the second of the {@link Date} object. 1226 <p> 1227 * @param second a long integer representing the seconds; it must 1228 * be in the range 0–59 or an error will be signaled. 1229 <p> 1230 * <p> 1231 * @return integer value indicating success/failure of the 1232 * function. The possible values 1233 * returned by this function are: 1234 * <ul> 1235 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1236 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1237 * </ul> 1238 */ public 1239 int setSecond(long second) { 1240 return libsbmlJNI.Date_setSecond(swigCPtr, this, second); 1241 } 1242 1243 1244/** 1245 * Sets the value of the sign of the time zone offset of this {@link Date} object. 1246 <p> 1247 * The only permissible values are <code>0</code> and <code>1.</code> 1248 <p> 1249 * @param sign a long integer representing the sign of the offset, with 1250 * <code>0</code> signifying <code>+</code> and <code>1</code> signifying <code>-.</code> 1251 <p> 1252 * <p> 1253 * @return integer value indicating success/failure of the 1254 * function. The possible values 1255 * returned by this function are: 1256 * <ul> 1257 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1258 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1259 * </ul> 1260 */ public 1261 int setSignOffset(long sign) { 1262 return libsbmlJNI.Date_setSignOffset(swigCPtr, this, sign); 1263 } 1264 1265 1266/** 1267 * Sets the value of this {@link Date} object's time zone hour offset. 1268 <p> 1269 * @param hoursOffset a long integer representing the hours of the 1270 * offset; it must be in the range 0–12 or an error will be 1271 * signaled. 1272 <p> 1273 * <p> 1274 * @return integer value indicating success/failure of the 1275 * function. The possible values 1276 * returned by this function are: 1277 * <ul> 1278 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1279 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1280 * </ul> 1281 */ public 1282 int setHoursOffset(long hoursOffset) { 1283 return libsbmlJNI.Date_setHoursOffset(swigCPtr, this, hoursOffset); 1284 } 1285 1286 1287/** 1288 * Sets the value of this {@link Date} object's time zone minutes offset. 1289 <p> 1290 * @param minutesOffset a long integer representing the minutes of the 1291 * offset; it must be in the range 0–59 or an error will be 1292 * signaled. 1293 <p> 1294 * <p> 1295 * @return integer value indicating success/failure of the 1296 * function. The possible values 1297 * returned by this function are: 1298 * <ul> 1299 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1300 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1301 * </ul> 1302 */ public 1303 int setMinutesOffset(long minutesOffset) { 1304 return libsbmlJNI.Date_setMinutesOffset(swigCPtr, this, minutesOffset); 1305 } 1306 1307 1308/** 1309 * Sets the value of this {@link Date} object using a date and time value 1310 * expressed as a text string. 1311 <p> 1312 * This method expects its argument to be in the <a target='_blank' 1313 * href='http://www.w3.org/TR/NOTE-datetime'>W3C date format with time 1314 * zone offset</a>, used in RDF Dublin Core annotations within SBML. 1315 <p> 1316 * <p> 1317 * The date format expresses a date and time value as a string of the form 1318 * YYYY-MM-DDThh:mm:ssXHH:ZZ, where 1319 <p> 1320 * <ul> 1321 * <li> <em>YYYY</em> is a four-digit integer representing the year. This 1322 * should be a four-digit number such as <code>2011.</code> 1323 <p> 1324 * <li> <em>MM</em> is a two-digit integer representing the month, with a range 1325 * of values of 01–12. The value <code>1</code> represents January, and so 1326 * on. 1327 <p> 1328 * <li> <em>DD</em> is a two-digit integer representing the day of the month, 1329 * with a range of values of 01–31. 1330 <p> 1331 * <li> <em>T</em> is the literal character <code>T.</code> 1332 <p> 1333 * <li> <em>hh</em> is a two-digit integer representing the hour on a 24-hour 1334 * clock, with a range of values of 00–23. 1335 <p> 1336 * <li> <em>mm</em> is a two-digit integer representing the minute, with a 1337 * range of 00–59. 1338 <p> 1339 * <li> <em>ss</em> is a two-digit integer representing the second, with a 1340 * range of 0–59. 1341 <p> 1342 * <li> <em>X</em> is the the sign of the time zone offset, either <code>+</code> or 1343 * <code>-</code>. 1344 <p> 1345 * <li> <em>HH</em> is a two-digit integer representing the hour of the time 1346 * zone offset, with a range of 00–23. 1347 <p> 1348 * <li> <em>ZZ</em> is a two-digit integer representing the minutes of the time 1349 * zone offset, with a range of 00–59. 1350 * 1351 * </ul> <p> 1352 * In the string format above, it is important not to forget the literal 1353 * character <code>T</code> in the string. Here is an example date/time string: 1354 * <code>1997-07-16T19:20:30+01:00</code>, which would represent July 16, 1355 * 1997, at 19:20:30 in Central European Time (which is UTC +1:00). 1356 <p> 1357 * If this method is given a <code>null</code> argument or a string of length zero, 1358 * it constructs a {@link Date} object with the value of January 1, 2000, at time 1359 * 00:00 UTC. Otherwise, the argument <em>must</em> be in the complete format 1360 * described above, or unpredictable results will happen. 1361 <p> 1362 * @param date a string representing the date. 1363 <p> 1364 * <p> 1365 * @return integer value indicating success/failure of the 1366 * function. The possible values 1367 * returned by this function are: 1368 * <ul> 1369 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1370 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1371 * </ul> 1372 */ public 1373 int setDateAsString(String date) { 1374 return libsbmlJNI.Date_setDateAsString(swigCPtr, this, date); 1375 } 1376 1377 1378/** 1379 * Returns <code>true</code> or <code>false</code> depending on whether this date object represents 1380 * a valid date and time value. 1381 <p> 1382 * This method verifies that the date/time value stored in this object is 1383 * well-formed and represents plausible values. A time and date value in 1384 * the W3C format takes the form YYYY-MM-DDThh:mm:ssXHH:ZZ (e.g., 1385 * <code>1997-07-16T19:20:30+01:00</code>) where XHH:ZZ is the time zone 1386 * offset. This method checks such things as whether the value of the 1387 * month number is less than or equal to 12, whether the value of the 1388 * minutes number is less than or equal to 59, whether a time zone offset 1389 * is set, etc. 1390 <p> 1391 * @return <code>true</code> if the date is valid, <code>false</code> otherwise. 1392 */ public 1393 boolean representsValidDate() { 1394 return libsbmlJNI.Date_representsValidDate(swigCPtr, this); 1395 } 1396 1397 1398/** * @internal */ public 1399 boolean hasBeenModified() { 1400 return libsbmlJNI.Date_hasBeenModified(swigCPtr, this); 1401 } 1402 1403 1404/** * @internal */ public 1405 void resetModifiedFlags() { 1406 libsbmlJNI.Date_resetModifiedFlags(swigCPtr, this); 1407 } 1408 1409}