|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.representation.SubModel
Represents a submodel of a knowledgemodel. This means a set of entities and relations. Each relation of entity may only exists once in the set. This class is not thread-safe.
Constructor Summary | |
SubModel()
Creates an empty submodel. |
|
SubModel(Entity[] ents,
Relation[] rels)
Creates a new SubModel from an array of entities and relations to be included in the submodel. |
Method Summary | |
void |
add(Entity e)
Adds an entity to the submodel. |
void |
add(Entity[] ents)
Adds a set of entitites to the submodel. |
void |
add(Relation r)
Adds a relation to the submodel. |
void |
add(Relation[] rels)
Adds an array of relations to the submodel. |
void |
add(SubModel other)
Adds all relations and entities in the supplied submodel to this submodel. |
void |
addExpanded(Relation r)
Adds a relation, but if the relation is composite, the submodel of containing all relations of the composite structure is added instead. |
void |
addExpanded(Relation[] rels)
Adds an array of relations to the submodel, but if the relation is composite, the submodel of containing all relations of the composite structure is added instead. |
void |
clear()
Removes all contents (relations and entities) from the submodel. |
boolean |
contains(Entity ent)
Returns true if the submodel contains the entity. |
boolean |
contains(Relation rel)
Returns true if the submodel contains the relation. |
boolean |
contains(SubModel model)
Returns true if model specified is submodel of this submodel, i.e. if all the entities and all of the relations of the specified model is also contained in this model. |
Entity[] |
getEntities()
Returns an array of all the entities in the submodel. |
Relation[] |
getRelations()
Returns an array of all the relations in the submodel. |
SubModel |
joinWith(SubModel other)
Deprecated. |
boolean |
remove(Entity r)
Removes an entity from the submodel. |
boolean |
remove(Relation r)
Removes a relation from the submodel. |
void |
remove(SubModel other)
Removes all the relations and entities in the supplied model from this model. |
int |
size()
Return the number of entities and relations in the submodel. |
java.util.Set |
toSet()
Returns a Set that contains all the relations and entities in this model. |
java.lang.String |
toString()
|
SubModel |
union(SubModel other)
Changes this submodel to be the union of the specified model and this submodel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SubModel(Entity[] ents, Relation[] rels)
public SubModel()
Method Detail |
public void add(Entity e)
e
- The entity to add.public void add(Entity[] ents)
ents
- The arrays of entities to add.public void add(Relation r)
r
- The relation to add.public void add(Relation[] rels)
rels
- The array of relations to add.public boolean remove(Relation r)
public void addExpanded(Relation r)
r
- The relation to (expand and) add.public void addExpanded(Relation[] rels)
public boolean remove(Entity r)
public boolean contains(Entity ent)
public boolean contains(Relation rel)
public Entity[] getEntities()
public Relation[] getRelations()
public int size()
public boolean contains(SubModel model)
public SubModel union(SubModel other)
public void add(SubModel other)
other
- The submodel to add to this model.public SubModel joinWith(SubModel other)
public java.util.Set toSet()
public void remove(SubModel other)
other
- The model to intersect with this model.public void clear()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |