|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The PartitionData interface is an interface for storing data about partitions. An implementation of the KnowledgeModel interface will also typically have a custom implementation of this interface. The contract of this interface specifices that: - Each ParitionData object can be encapsulated by multiple Partition objects. - The contract does NOT state that the data is stored locally in the PartitionData object, and this can not be assumed. This means that the PartitionData object can be an interface to a standard SQL database or a concurrently accessed knowledge model server. - The data represented by an PartitionData object must be possible to access concurrently. If an implementation of PartitionData allows multiple instances of PartitionData to exist at once, the access must allow concurrent, thread-safe even access to the data across the PartitionData instances. - All manipulations of this object is done either from a KnowledgeModel or Partition object (or a subclass of these). PartitionData classes should be viewed as internal classes to the Partition, Entity, Relation and KnowledgeModel classes.
Method Summary | |
void |
addEntity(Entity entity)
Adds an entity to this partition. |
void |
addRelation(Relation relation)
Adds a relation to this partition. |
long |
getCreationTime()
Returns the time of creation for this partition in the same format as System.getCurrentTimeMillis(); |
Entity[] |
getEntities()
Returns all the entitys in this partition. |
java.util.Iterator |
getEntityIterator()
Returns an iterator for all the entities in this partition. |
java.lang.Object |
getID()
Returns a unique ID for the entity this EntityData represents. |
java.lang.String |
getName()
Returns the name of this partition. |
java.util.Iterator |
getRelationIterator()
Returns an iterator for all the relations in this partition. |
Relation[] |
getRelations()
Returns all the relations in this partition. |
boolean |
hasEntity(Entity entity)
Returns true if the given entity is a part of this partition. |
boolean |
hasRelation(Relation relation)
Returns true if the given relation is a part of this partition. |
void |
remove()
Permanently deletes the parition. |
boolean |
removeEntity(Entity entity)
Removes an entity to the list of entity from this partition. |
boolean |
removeRelation(Relation relation)
Removes a relation to the list of relation from this entity. |
void |
setCreationTime(long time)
Sets the creation time. |
void |
setName(java.lang.String name)
Sets the name of this partition. |
Method Detail |
public void setName(java.lang.String name)
name
- The new namepublic java.lang.String getName()
public java.lang.Object getID()
public long getCreationTime()
public void setCreationTime(long time)
time
- The time in the format of System.getCurrentTimeMillis() this parition was created.public void addRelation(Relation relation)
relation
- The relation to add.public boolean removeRelation(Relation relation)
relation
- The relation to remove.public Relation[] getRelations()
public java.util.Iterator getRelationIterator()
public boolean hasRelation(Relation relation)
relation
- public void addEntity(Entity entity)
entity
- The entity to add.public boolean removeEntity(Entity entity)
entity
- The entity to remove.public Entity[] getEntities()
public java.util.Iterator getEntityIterator()
public boolean hasEntity(Entity entity)
entity
- public void remove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |