public class ModelHistory 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.
The SBML specification beginning with Level 2 Version 2 defines
a standard approach to recording optional model history and model creator
information in a form that complies with MIRIAM ('Minimum
Information Requested in the Annotation of biochemical Models',
Nature Biotechnology, vol. 23, no. 12, Dec. 2005). LibSBML
provides the ModelHistory class as a convenient high-level interface for
working with model history data.
Model histories in SBML consist of one or more model creators,
a single date of creation, and one or more modification dates.
The overall XML form of this data takes the following form:
<dc:creator>
<rdf:Bag>
<rdf:li rdf:parseType='Resource'>
+++
<vCard:N rdf:parseType='Resource'>
<vCard:Family>family name</vCard:Family>
<vCard:Given>given name</vCard:Given>
</vCard:N>
+++
<vCard:EMAIL>email address</vCard:EMAIL>
+++
<vCard:ORG rdf:parseType='Resource'>
<vCard:Orgname>organization name</vCard:Orgname>
</vCard:ORG>
+++
</rdf:li>
...
</rdf:Bag>
</dc:creator>
<dcterms:created rdf:parseType='Resource'>
<dcterms:W3CDTF>creation date</dcterms:W3CDTF>
</dcterms:created>
<dcterms:modified rdf:parseType='Resource'>
<dcterms:W3CDTF>modification date</dcterms:W3CDTF>
</dcterms:modified>
...
In the template above, the underlined
portions are optional, the symbol
+++ is a placeholder
for either no content or valid XML content that is not defined by
the annotation scheme, and the ellipses
...
are placeholders for zero or more elements of the same form as the
immediately preceding element. The various placeholders for content, namely
family name,
given name,
email address,
organization,
creation date, and
modification date
are data that can be filled in using the various methods on
the ModelHistory class described below.
ModelCreator,
Date| Constructor and Description |
|---|
ModelHistory()
Creates a new
ModelHistory object. |
ModelHistory(ModelHistory orig)
Copy constructor; creates a copy of this
ModelHistory object. |
| Modifier and Type | Method and Description |
|---|---|
int |
addCreator(ModelCreator mc)
Adds a copy of a
ModelCreator object to the list of 'model creator'
values stored in this ModelHistory object. |
int |
addModifiedDate(Date date)
Adds a copy of a
Date object to the list of 'modified date' values
stored in this ModelHistory object. |
ModelHistory |
cloneObject()
Creates and returns a deep copy of this
ModelHistory object. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
equals(java.lang.Object sb)
Equality comparison method for ModelHistory.
|
Date |
getCreatedDate()
Returns the 'creation date' portion of this
ModelHistory object. |
ModelCreator |
getCreator(long n)
Get the nth
ModelCreator object stored in this ModelHistory object. |
ModelCreatorList |
getListCreators()
Returns the list of
ModelCreator objects stored in this ModelHistory
object. |
DateList |
getListModifiedDates()
Returns the list of 'modified date' values (as
Date objects) stored in
this ModelHistory object. |
Date |
getModifiedDate()
Returns the 'modified date' portion of this
ModelHistory object. |
Date |
getModifiedDate(long n)
Get the nth
Date object in the list of 'modified date' values stored
in this ModelHistory object. |
long |
getNumCreators()
Get the number of
ModelCreator objects stored in this ModelHistory
object. |
long |
getNumModifiedDates()
Get the number of
Date objects in this ModelHistory object's list of
'modified dates'. |
int |
hashCode()
Returns a hashcode for this ModelHistory object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required elements for this
ModelHistory object have been set. |
boolean |
isSetCreatedDate()
|
boolean |
isSetModifiedDate()
|
int |
setCreatedDate(Date date)
Sets the creation date of this
ModelHistory object. |
int |
setModifiedDate(Date date)
Sets the modification date of this
ModelHistory object. |
public ModelHistory()
ModelHistory object.public ModelHistory(ModelHistory orig)
ModelHistory object.
orig - the object to copy.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 ModelHistory.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 ModelHistory.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.Objectsb - 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.Objectpublic ModelHistory cloneObject()
ModelHistory object.
ModelHistory object.public Date getCreatedDate()
ModelHistory object.
Date object representing the creation date stored in
this ModelHistory object.public Date getModifiedDate()
ModelHistory object.
Note that in the MIRIAM format for annotations, there can be multiple
modification dates. The libSBML ModelHistory class supports this by
storing a list of 'modified date' values. If this ModelHistory object
contains more than one 'modified date' value in the list, this method
will return the first one in the list.
Date object representing the date of modification
stored in this ModelHistory object.public boolean isSetCreatedDate()
true if the creation date value of this ModelHistory is
set, false otherwise.public boolean isSetModifiedDate()
true if the modification date value of this ModelHistory
object is set, false otherwise.public int setCreatedDate(Date date)
ModelHistory object.
date - a Date object representing the date to which the 'created
date' portion of this ModelHistory should be set.
public int setModifiedDate(Date date)
ModelHistory object.
date - a Date object representing the date to which the 'modified
date' portion of this ModelHistory should be set.
public int addModifiedDate(Date date)
Date object to the list of 'modified date' values
stored in this ModelHistory object.
In the MIRIAM format for annotations, there can be multiple
modification dates. The libSBML ModelHistory class supports this by
storing a list of 'modified date' values.
date - a Date object representing the 'modified date' that should
be added to this ModelHistory object.
public DateList getListModifiedDates()
Date objects) stored in
this ModelHistory object.
In the MIRIAM format for annotations, there can be multiple
modification dates. The libSBML ModelHistory class supports this by
storing a list of 'modified date' values.
ModelHistory object.public Date getModifiedDate(long n)
Date object in the list of 'modified date' values stored
in this ModelHistory object.
In the MIRIAM format for annotations, there can be multiple
modification dates. The libSBML ModelHistory class supports this by
storing a list of 'modified date' values.
Date in the list of ModifiedDates of this
ModelHistory or null if no such object exists.public long getNumModifiedDates()
Date objects in this ModelHistory object's list of
'modified dates'.
In the MIRIAM format for annotations, there can be multiple
modification dates. The libSBML ModelHistory class supports this by
storing a list of 'modified date' values.
ModelHistory.public int addCreator(ModelCreator mc)
ModelCreator object to the list of 'model creator'
values stored in this ModelHistory object.
In the MIRIAM format for annotations, there can be multiple model
creators. The libSBML ModelHistory class supports this by storing a
list of 'model creator' values.
mc - the ModelCreator to add.
public ModelCreatorList getListCreators()
ModelCreator objects stored in this ModelHistory
object.
In the MIRIAM format for annotations, there can be multiple model
creators. The libSBML ModelHistory class supports this by storing a
list of 'model creator' values.
ModelCreator objects.public ModelCreator getCreator(long n)
ModelCreator object stored in this ModelHistory object.
In the MIRIAM format for annotations, there can be multiple model
creators. The libSBML ModelHistory class supports this by storing a
list of 'model creator' values.
ModelCreator object or null if no such object exists.public long getNumCreators()
ModelCreator objects stored in this ModelHistory
object.
In the MIRIAM format for annotations, there can be multiple model
creators. The libSBML ModelHistory class supports this by storing a
list of 'model creator' values.
public boolean hasRequiredAttributes()
true if all the required elements for this
ModelHistory object have been set.
The required elements for a ModelHistory object are 'created
name', 'modified date', and at least one 'model creator'.