org.eclipse.higgins.idas
Interface IHasRelationships<T>

Package class diagram package IHasRelationships
Type Parameters:
T - The type of object used to represent the relationship. This is typically an identifier.

This type is used to type the uses of IRelationship in this interface.

All Known Subinterfaces:
IContext, IDigitalSubject

public interface IHasRelationships<T>

Extended by interfaces which have relationships to other objects.


Method Summary
 void addRelationship(IRelationship<T> relationship)
          Adds the specified Relationship to this Object.
 IRelationship<T> createRelationship(URI type)
          Creates a relationship to another Object.
 Iterable<IRelationship<T>> getRelationships()
          Returns the relationships this Object has to others.
 void removeRelationship(IRelationship<T> relationship)
          Removes the specified Relationship from this Object.
 

Method Detail

createRelationship

IRelationship<T> createRelationship(URI type)
                                    throws IdASException
Creates a relationship to another Object.

TODO: Specify whether this also adds the relationship to this Object, or if add must subsequently be called.

TODO: If this method also adds, note that updates to the returned IRelationship affect the added relationship.

Parameters:
type - The type of relationship. TODO: give example.
Returns:
The resulting Relationship.
Throws:
IdASException

addRelationship

void addRelationship(IRelationship<T> relationship)
                     throws IdASException
Adds the specified Relationship to this Object.

Parameters:
relationship - The Relationship to add.
Throws:
IdASException

removeRelationship

void removeRelationship(IRelationship<T> relationship)
                        throws IdASException
Removes the specified Relationship from this Object.

TODO: How does the Service Provider match relationships in order to do the remove?

Parameters:
relationship - The Relationship to remove.
Throws:
IdASException

getRelationships

Iterable<IRelationship<T>> getRelationships()
                                            throws IdASException
Returns the relationships this Object has to others.

Returns:
The set of Relationships this Object has.
Throws:
IdASException


Copyright © 2006 Novell Inc. All Rights Reserved.
This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Contributors:
  Jim Sermersheim (Novell, Inc.) - initial API and implementation