i3.dragos.gm.core.schema
Interface RelationClass

All Superinterfaces:
ExistenceCheckable, GraphEntityClass, MetaAttributable
All Known Implementing Classes:
RelationClassProxy

public interface RelationClass
extends GraphEntityClass

Schema class for relations.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>
See Also:
Core Graph Model, Implementation Issues

Method Summary
 RelationEndClass declareRelationEndClass(java.lang.String name, GraphEntityClass target, Cardinality card, RelationEndDirection direction)
          Adds a relation end to the relation class.
 java.util.Collection<? extends RelationEndClass> getRelationEndClasses()
          Returns a collection with all relation ends of the relation class.
 void undeclareRelationEndClass(RelationEndClass rec)
          Undeclares a relation end previously declared for the relation class.
 
Methods inherited from interface i3.dragos.gm.core.schema.GraphEntityClass
addSubClass, declareAttribute, equals, getAllDeclaredAttributes, getAllSubClasses, getAllSuperClasses, getAttribute, getDataSourceURL, getDeclaredAttributes, getDirectSubClasses, getDirectSuperClasses, getInternalIdentifier, getName, getWrappedGraphEntityClass, hasAttribute, hashCode, isAbstract, isSubClassOf, isSuperClassOf, removeSubClass, undeclareAllAttributes, undeclareAttribute, undeclareAttribute
 
Methods inherited from interface i3.dragos.gm.core.schema.MetaAttributable
getAllMetaAttributes, getMetaAttribute, isMetaAttributeKeyReserved, isMetaAttributeSet, setMetaAttribute, unsetMetaAttribute
 
Methods inherited from interface i3.dragos.gm.core.schema.ExistenceCheckable
checkExistence, checkExistenceOptional
 

Method Detail

declareRelationEndClass

RelationEndClass declareRelationEndClass(java.lang.String name,
                                         GraphEntityClass target,
                                         Cardinality card,
                                         RelationEndDirection direction)
                                         throws EntityNotFoundException,
                                                DragosException,
                                                EntityAlreadyExistsException
Adds a relation end to the relation class.

Parameters:
name - The name of the relation end.
target - The target of the relation end.
card - The cardinality allowed for the target.
direction - The direction of the relation end.
Returns:
the new relation end class.
Throws:
EntityNotFoundException - if the graph element class does not exist.
EntityAlreadyExistsException - if a schema entity with the same name has already been declared.
DragosException - if something else went wrong.

undeclareRelationEndClass

void undeclareRelationEndClass(RelationEndClass rec)
                               throws EntityNotFoundException,
                                      DragosException
Undeclares a relation end previously declared for the relation class.

It simply performs an additional check whether the RelationEndClass to undeclare really belongs to this RelationClass, throwing an EntityNotFoundException if not. Afterwards, it follows the same procedure as Schema.undeclareGraphEntityClass(GraphEntityClass).

This method could/should be implemented roughly as follows:

 if (! this.equals(rec.getRelationClass())) {
     throw new EntityNotFoundException("RelationEndClass " + rec + " does not belong to " + toString());
 }
 getSchema().undeclareGraphEntityClass(rec);
 

Parameters:
rec - The RelationEndClass to undeclare.
Throws:
EntityNotFoundException - if the RelationEndClass does not exist or does not belong to this RelationClass.
DragosException - if something else went wrong.
See Also:
Schema.undeclareGraphEntityClass(GraphEntityClass)

getRelationEndClasses

java.util.Collection<? extends RelationEndClass> getRelationEndClasses()
                                                                       throws DragosException
Returns a collection with all relation ends of the relation class. The elements of the collection are of type RelationEndClass

Returns:
a collection with all relation ends of the relation class.
Throws:
DragosException - if something went wrong.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.