public class Date extends java.lang.Object
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
A Date
object stores a reasonably complete representation of date and
time. Its purpose is to serve as a way to store dates to be read and
written in the W3C date format used in
RDF Dublin Core annotations within SBML. The W3C date format is a
restricted form of ISO 8601, the
international standard for the representation of dates and times. A
time and date value in this W3C format takes the form
YYYY-MM-DDThh:mm:ssXHH:ZZ (e.g., 1997-07-16T19:20:30+01:00
)
where XHH:ZZ is the time zone offset. The libSBML Date
object contains
the following fields to represent these values:
2011.
1
represents January, and so on.
0
signifying +
and 1
signifying -
). See the paragraph below for
further explanations.
To illustrate the time zone offset, a value of -05:00
would
correspond to USA Eastern Standard Time. In the Date
object, this would
require a value of 1
for the sign field, 5
for the hour offset and
0
for the minutes offset.
In the restricted RDF annotations used in SBML, described in Section 6 of the SBML Level 2 and Level 3 specification documents, date/time stamps can be used to indicate the time of creation and modification of a model. The following SBML model fragment illustrates this:
<model metaid='_180340' id='GMO' name='Goldbeter1991_MinMitOscil'> <annotation> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:dcterms='http://purl.org/dc/terms/' xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#' > <rdf:Description rdf:about='#_180340'> <dc:creator> <rdf:Bag> <rdf:li rdf:parseType='Resource'> <vCard:N rdf:parseType='Resource'> <vCard:Family>Shapiro</vCard:Family> <vCard:Given>Bruce</vCard:Given> </vCard:N> <vCard:EMAIL>bshapiro@jpl.nasa.gov</vCard:EMAIL> <vCard:ORG rdf:parseType='Resource'> <vCard:Orgname>NASA Jet Propulsion Laboratory</vCard:Orgname> </vCard:ORG> </rdf:li> </rdf:Bag> </dc:creator> <dcterms:created rdf:parseType='Resource'> <dcterms:W3CDTF>2005-02-06T23:39:40+00:00</dcterms:W3CDTF> </dcterms:created> <dcterms:modified rdf:parseType='Resource'> <dcterms:W3CDTF>2005-09-13T13:24:56+00:00</dcterms:W3CDTF> </dcterms:modified> </rdf:Description> </rdf:RDF> </annotation> </model>
Constructor and Description |
---|
Date()
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(Date orig)
Copy constructor creates a copy of this
Date . |
Date(long year)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour,
long minute)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour,
long minute,
long second)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour,
long minute,
long second,
long sign)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour,
long minute,
long second,
long sign,
long hoursOffset)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(long year,
long month,
long day,
long hour,
long minute,
long second,
long sign,
long hoursOffset,
long minutesOffset)
Creates a time and date representation for use in model annotations
and elsewhere.
|
Date(java.lang.String date)
Creates a
Date object from a string expressing a date and time value. |
Modifier and Type | Method and Description |
---|---|
Date |
cloneObject()
Creates and returns a deep copy of this
Date object. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
equals(java.lang.Object sb)
Equality comparison method for Date.
|
java.lang.String |
getDateAsString()
Returns the current
Date value in text-string form. |
long |
getDay()
Returns the day from this
Date . |
long |
getHour()
Returns the hour from this
Date . |
long |
getHoursOffset()
Returns the hours of the time zone offset from this
Date . |
long |
getMinute()
Returns the minute from this
Date . |
long |
getMinutesOffset()
Returns the minutes of the time zone offset from this
Date . |
long |
getMonth()
Returns the month from this
Date . |
long |
getSecond()
Returns the seconds from this
Date . |
long |
getSignOffset()
Returns the sign of the time zone offset from this
Date . |
long |
getYear()
Returns the year from this
Date . |
int |
hashCode()
Returns a hashcode for this Date object.
|
boolean |
representsValidDate()
Returns true or false depending on whether this date object represents
a valid date and time value.
|
int |
setDateAsString(java.lang.String date)
Sets the value of this
Date object using a date and time value
expressed as a text string. |
int |
setDay(long day)
Sets the value of the day of this
Date object. |
int |
setHour(long hour)
Sets the value of the hour of this
Date object. |
int |
setHoursOffset(long hoursOffset)
Sets the value of this
Date object's time zone hour offset. |
int |
setMinute(long minute)
Sets the value of the minute of this
Date object. |
int |
setMinutesOffset(long minutesOffset)
Sets the value of this
Date object's time zone minutes offset. |
int |
setMonth(long month)
Sets the value of the month of this
Date object. |
int |
setSecond(long second)
Sets the value of the second of the
Date object. |
int |
setSignOffset(long sign)
Sets the value of the sign of the time zone offset of this
Date object. |
int |
setYear(long year)
Sets the value of the year of this
Date object. |
public Date(long year, long month, long day, long hour, long minute, long second, long sign, long hoursOffset, long minutesOffset)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day, long hour, long minute, long second, long sign, long hoursOffset)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day, long hour, long minute, long second, long sign)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day, long hour, long minute, long second)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day, long hour, long minute)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day, long hour)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month, long day)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year, long month)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(long year)
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date()
The following is the complete set of possible arguments to this constructor, with default values as indicated:
year
- a long integereger representing the year. This should be
a four-digit number such as 2011.
(Default value used if this
argument is not given: 2000.
)
month
- a long integereger representing the month, with a range
of values of 1&ndash12. The value 1
represents January, and so
on. (Default value used if this argument is not given: 1.
)
day
- a long integereger representing the day of the month, with
a range of values of 1&ndash31. (Default value used if this argument
is not given: 1.
)
hour
- a long integereger representing the hour on a 24-hour
clock, with a range of values of 0&ndash23. (Default value used if
this argument is not given: 0.
)
minute
- a long integereger representing the minute, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
second
- a long integereger representing the second, with a
range of 0&ndash59. (Default value used if this argument is not
given: 0.
)
sign
- a long integereger representing the sign of the offset
(0
signifying +
and 1
signifying -
). See the paragraph
below for further explanations. (Default value used if this argument
is not given: 0.
)
hoursOffset
- a long integereger representing the time zone's
hour offset from GMT. (Default value used if this argument is not
given: 0.
)
minutesOffset
- a long integereger representing the time zone's
minute offset from GMT. (Default value used if this argument is not
given: 0.
)
To illustrate the time zone offset, a value of -05:00
would correspond to USA Eastern Standard Time. In the Date
object,
this would require a value of 1
for the sign field, 5
for the
hour offset and 0
for the minutes offset.
public Date(java.lang.String date)
Date
object from a string expressing a date and time value.
This constructor expects its argument to be in the W3C date format with time zone offset, used in RDF Dublin Core annotations within SBML.
The date format expresses a date and time value as a string of the form YYYY-MM-DDThh:mm:ssXHH:ZZ, where
2011.
1
represents January, and so
on.
+
or
-
.
In the string format above, it is important not to forget the literal
character T
in the string. Here is an example date/time string:
1997-07-16T19:20:30+01:00
, which would represent July 16,
1997, at 19:20:30 in Central European Time (which is UTC +1:00).
If this constructor is given a null
argument or a string of length
zero, it constructs a Date
object with the value of January 1, 2000,
at time 00:00 UTC. Otherwise, the argument must be in the
complete format described above, or unpredictable results will happen.
date
- a string representing the date.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the Date.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Date.delete()
themselves.
public boolean equals(java.lang.Object sb)
Because the Java methods for libSBML are actually wrappers around code
implemented in C++ and C, certain operations will not behave as
expected. Equality comparison is one such case. An instance of a
libSBML object class is actually a proxy object
wrapping the real underlying C/C++ object. The normal ==
equality operator in Java will only compare the Java proxy objects,
not the underlying native object. The result is almost never what you
want in practical situations. Unfortunately, Java does not provide a
way to override ==
.
The alternative that must be followed is to use the
equals()
method. The equals
method on this
class overrides the default java.lang.Object one, and performs an
intelligent comparison of instances of objects of this class. The
result is an assessment of whether two libSBML Java objects are truly
the same underlying native-code objects.
The use of this method in practice is the same as the use of any other
Java equals
method. For example,
a.equals(
b)
returns
true
if a and b are references to the
same underlying object.
equals
 in class java.lang.Object
sb
- a reference to an object to which the current object
instance will be comparedtrue
if sb
refers to the same underlying
native object as this one, false
otherwisepublic int hashCode()
hashCode
 in class java.lang.Object
public Date cloneObject()
Date
object.
Date
object.public long getYear()
Date
.
Date
.public long getMonth()
Date
.
Date
.public long getDay()
Date
.
Date
.public long getHour()
Date
.
Date
.public long getMinute()
Date
.
Date
.public long getSecond()
Date
.
Date
.public long getSignOffset()
Date
.
Date
.public long getHoursOffset()
Date
.
Date
.public long getMinutesOffset()
Date
.
Date
.public java.lang.String getDateAsString()
Date
value in text-string form.
The string returned will be in the W3C date format with time zone offset, used in RDF Dublin Core annotations within SBML.
The date format expresses a date and time value as a string of the form YYYY-MM-DDThh:mm:ssXHH:ZZ, where
2011.
1
represents January, and so
on.
+
or
-
.
In the string format above, it is important not to forget the literal
character T
in the string. Here is an example date/time string:
1997-07-16T19:20:30+01:00
, which would represent July 16,
1997, at 19:20:30 in Central European Time (which is UTC +1:00).
public int setYear(long year)
Date
object.
The value given as argument must be between 1000 and 9999 inclusive.
(In the millennium during which this libSBML documentation is being
written, a typical value is 2011
, but we hope that SBML will
continue to be used for a long time.)
year
- a long integer representing the year.
public int setMonth(long month)
Date
object.
month
- a long integer representing the month it must be in the
range 1&ndash12 or an error will be signaled.
public int setDay(long day)
Date
object.
day
- a long integer representing the day it must be in the
range 0&ndash31 or an error will be signaled.
public int setHour(long hour)
Date
object.
hour
- a long integer representing the hour to set it must be
in the range 0&ndash23 or an error will be signaled.
public int setMinute(long minute)
Date
object.
minute
- a long integer representing the minute to set it must
be in the range 0&ndash59 or an error will be signaled.
public int setSecond(long second)
Date
object.
second
- a long integer representing the seconds it must
be in the range 0&ndash59 or an error will be signaled.
public int setSignOffset(long sign)
Date
object.
The only permissible values are 0
and 1.
sign
- a long integer representing the sign of the offset, with
0
signifying +
and 1
signifying -.
public int setHoursOffset(long hoursOffset)
Date
object's time zone hour offset.
hoursOffset
- a long integer representing the hours of the
offset it must be in the range 0&ndash23 or an error will be
signaled.
public int setMinutesOffset(long minutesOffset)
Date
object's time zone minutes offset.
minutesOffset
- a long integer representing the minutes of the
offset it must be in the range 0&ndash59 or an error will be
signaled.
public int setDateAsString(java.lang.String date)
Date
object using a date and time value
expressed as a text string.
This method expects its argument to be in the W3C date format with time zone offset, used in RDF Dublin Core annotations within SBML.
The date format expresses a date and time value as a string of the form YYYY-MM-DDThh:mm:ssXHH:ZZ, where
2011.
1
represents January, and so
on.
+
or
-
.
In the string format above, it is important not to forget the literal
character T
in the string. Here is an example date/time string:
1997-07-16T19:20:30+01:00
, which would represent July 16,
1997, at 19:20:30 in Central European Time (which is UTC +1:00).
If this method is given a null
argument or a string of length zero,
it constructs a Date
object with the value of January 1, 2000, at time
00:00 UTC. Otherwise, the argument must be in the complete format
described above, or unpredictable results will happen.
date
- a string representing the date.
public boolean representsValidDate()
This method verifies that the date/time value stored in this object is
well-formed and represents plausible values. A time and date value in
the W3C format takes the form YYYY-MM-DDThh:mm:ssXHH:ZZ (e.g.,
1997-07-16T19:20:30+01:00
) where XHH:ZZ is the time zone
offset. This method checks such things as whether the value of the
month number is less than or equal to 12, whether the value of the
minutes number is less than or equal to 59, whether a time zone offset
is set, etc.
true
if the date is valid, false
otherwise.