public final class OWLOntologyChangeRecord
extends java.lang.Object
implements java.io.Serializable
Associates an OWLOntologyID
with ontology-less change data.
An OWLOntologyChangeRecord
captures information about an OWLOntologyChange
in a way that does
not require a reference to an OWLOntology
object. It does this by referencing an OWLOntologyID
instead of referencing an OWLOntology
. The primary reason for doing this is so that changes can be
serialized and logged more easily. It should be kept in mind that OWLOntologyChangeRecord
objects can
represent changes for which there might be no in memory representation of a specific OWLOntology
. This is
also true if an OWLOntology
object has its OWLOntologyID
changed.
An OWLOntologyChange
object contains two important pieces of information:
OWLOntologyID
that identifies the ontology that the change pertains to.
OWLOntologyChangeData
that describes the change specific data. For each kind of
OWLOntologyChange
there is a corresponding OWLOntologyChangeData
class which
captures the essential details that pertain to the change. The reason for this separation is that it
allows change information to be captured where the context of the change (the ontology) is known via some
other mechanism.
OWLOntologyChangeRecord
objects are immutable.
Constructor and Description |
---|
OWLOntologyChangeRecord(OWLOntologyID ontologyID,
OWLOntologyChangeData data)
Constructs an
OWLOntologyChangeRecord object which holds information about a change to a particular
ontology identified by an OWLOntologyID object and also change details specified by the OWLOntologyChangeData object. |
Modifier and Type | Method and Description |
---|---|
static OWLOntologyChangeRecord |
createFromOWLOntologyChange(OWLOntologyChange change)
A convenience method that creates an
OWLOntologyChangeRecord by
deriving data from an OWLOntologyChange object. |
OWLOntologyChange |
createOntologyChange(OWLOntologyManager manager)
Creates an
OWLOntologyChange from the OWLOntologyID and OWLOntologyChangeData
associated with this OWLOntologyChangeRecord object. |
boolean |
equals(java.lang.Object obj) |
OWLOntologyChangeData |
getData()
Gets the
OWLOntologyChangeData which is associated with this OWLOntologyChangeRecord . |
OWLOntologyID |
getOntologyID()
Gets the
OWLOntologyID that identifies the ontology associated with this change record. |
int |
hashCode() |
java.lang.String |
toString() |
public OWLOntologyChangeRecord(OWLOntologyID ontologyID, OWLOntologyChangeData data)
OWLOntologyChangeRecord
object which holds information about a change to a particular
ontology identified by an OWLOntologyID
object and also change details specified by the OWLOntologyChangeData
object.ontologyID
- The OWLOntologyID
which identifies the ontology that the change was applied to. Not
null
.data
- The OWLOntologyChangeData
that describes the particular details of the change.
Not null
.java.lang.NullPointerException
- if ontologyID
is null
or if recordInfo
is null
.public static OWLOntologyChangeRecord createFromOWLOntologyChange(OWLOntologyChange change)
OWLOntologyChangeRecord
by
deriving data from an OWLOntologyChange
object.change
- The OWLOntologyChange
object. Not null
.java.lang.NullPointerException
- if change
is null
.public OWLOntologyID getOntologyID()
OWLOntologyID
that identifies the ontology associated with this change record.OWLOntologyID
. Not null
.public OWLOntologyChangeData getData()
OWLOntologyChangeData
which is associated with this OWLOntologyChangeRecord
.OWLOntologyChangeData
. Not null
.public OWLOntologyChange createOntologyChange(OWLOntologyManager manager) throws UnknownOWLOntologyException
OWLOntologyChange
from the OWLOntologyID
and OWLOntologyChangeData
associated with this OWLOntologyChangeRecord
object. The OWLOntology
that is the target of the
resulting OWLOntologyChange
is derived from an OWLOntologyManager
. The manager
OWLOntologyID
which is equal to the OWLOntologyID
associated
with
this OWLOntologyChangeRecord
object.
manager
- The manager which will be used to obtain a reference to an OWLOntology
object having the
same OWLOntologyID
as the OWLOntologyID
associated with this OWLOntologyChangeRecord
.
Not null
.OWLOntologyChange
object that is derived from this record's OWLOntologyID
and
OWLOntologyChangeData
. The specific concrete subclass of the returned OWLOntologyChange
will depend upon the specific concrete subclass of the OWLOntologyChangeData
associated
with this
OWLOntologyChangeRecord
.UnknownOWLOntologyException
- if the specified manager does not contain an ontology which has an OWLOntologyID
equal to the OWLOntologyID
associated with this
OWLOntologyChangeRecord
.java.lang.NullPointerException
- if manager
is null
.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object