|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used to access the data encapsulated by an Entity object. Typically, a KnowledgeModel-implementation will also implement this interface. The contract of this interface specifices that: - Each EntityData object can be encapsulated by multiple Entity objects. This may for instance happen when a relation type is used both in an Entity and a RelationType object. - The contract does NOT state that the data is stored locally in the EntityData object, and this can not be assumed. This means that the EntityData object can be an interface to a standard SQL database or a concurrently accessed knowledge model server. - The data represented by an EntityData object must be possible to access concurrently. If an implementation of EntityData allows multiple instances of EntityData to exist at once, the access must allow concurrentl, thread-safe even access to the data across the EntityData instances. - All manipulations of this object is done either from a KnowledgeModel or Entity object (or a subclass of these). EntityData classes should be viewed as internal classes to the Entity, Relation and KnowledgeModel classes.
Method Summary | |
void |
addConstraint(Constraint constraint)
|
void |
addRelation(Relation relation)
Adds a relation to the list of relations from this entity. |
void |
addRelationInstance(Relation relation)
Registers a relation as beeing an instance of this entity (which then represents a relation type). |
long |
getCreationTime()
Returns the time of creation for this entity in the same format as System.getCurrentMillis(); |
java.lang.String |
getDescription()
Returns the description of this entity. |
java.io.Serializable |
getEntityObject()
Returns the current (if any) data object encapsulated by this entity. |
java.lang.Object |
getID()
Returns a unique ID for the entity this EntityData represents. |
Constraint[] |
getLocalConstraints()
|
Relation[] |
getLocalRelations()
Returns all the relations from this entity. |
Relation[] |
getLocalRelations(Entity[] relationTypes)
Returns the local relations from the entity represented by this object, where the type of each relation must be in the array of relation types supplied to this method. |
java.lang.String |
getName()
Gives the name of this entity. |
Relation[] |
getRelationInstances()
Returns the Relation objects that are of the relation type represented by this entity. |
void |
remove()
Permanently deletes the entity. |
void |
removeConstraint(Constraint c)
|
void |
removeRelation(Relation relation)
Removes a relation to the list of relation from this entity. |
void |
removeRelationInstance(Relation relation)
Removes a relation as beeing an instance of this entity (which then represents a relation type). |
void |
setCreationTime(long time)
Sets the creation time. |
void |
setDescription(java.lang.String description)
Sets the description of this entity. |
void |
setEntityObject(java.io.Serializable object)
Sets data object encapsulated by this entity. |
void |
setName(java.lang.String name)
Sets the name of this entity. |
Method Detail |
public java.lang.Object getID()
public void setName(java.lang.String name)
name
- The new name of the entity.public java.lang.String getName()
public void setDescription(java.lang.String description)
description
- The description String.public java.lang.String getDescription()
public void addRelationInstance(Relation relation)
public void removeRelationInstance(Relation relation)
relation
- The relation to remove.public void addRelation(Relation relation)
relation
- The relation to add.public void removeRelation(Relation relation)
relation
- The relation to remove.public Relation[] getRelationInstances()
public long getCreationTime()
public void setCreationTime(long time)
time
- The time in the format of System.getCurrentMillis() this entity was created.public Relation[] getLocalRelations(Entity[] relationTypes)
relationTypes
- An array of the relation types of relations to return.public Relation[] getLocalRelations()
public java.io.Serializable getEntityObject()
public void setEntityObject(java.io.Serializable object)
object
- Any Java object that implements the Serializable interface.public void remove()
public void addConstraint(Constraint constraint)
public Constraint[] getLocalConstraints()
public void removeConstraint(Constraint c)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |