Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface IDependencyTracker


public interface IDependencyTracker

The IDependencyTracker interface defines the API for a container that holds pairs of objects that represent a relationship. When adding a pair of objects to the container there is always a dependent object that depends on a prerequisite object, and there is always a prerequisite object that is a prerequisite of the dependent object. An implementation of this interface is a generally useful object container for tracking dependencies between objects. For example, you could track parent-child relationships using an implementation of this interface.


Nested Class Summary
static interface IDependencyTracker.IXmlProvider
          The IXmlProvider interface defines the API for converting a dependent object and a prerequisite object into XML.
 
Method Summary
 boolean add(Object dependent, Object prerequisite)
          Create a dependent and prerequisite relationship.
 List getAllDependents(Object prerequisite)
          Answers all the dependents of a prerequisite.
 List getAllPrerequisites(Object dependent)
          Answers all the prerequisites of a dependent.
 List getDependents()
          Answers all the entries that are dependents.
 List getDependents(Object prerequisite)
          Answers the immediate dependents of an entry.
 List getPrerequisites()
          Answers all the entries that are prerequisites.
 List getPrerequisites(Object dependent)
          Answers the immediate prerequisites of an entry.
 List getValues()
          Answers a list of all the objects in the IDependencyTracker.
 boolean hasCircularReferences(Object entry)
          Answers true if an entry has circular references otherwise false.
 boolean hasDependents()
          Answers true if dependent entries exist, otherwise false.
 boolean hasPrerequisites()
          Answers true if prerequisite entries exist, otherwise false.
 boolean isEmpty()
          Answers true if the DepenencyTrackerService is empty, otherwise false.
 void remove(Object entry)
          Removes an Object, severing its dependent and prerequisite relationships.
 boolean remove(Object dependent, Object prerequisite)
          Destroy a dependent and prerequisite relationship.
 void removeAll()
          Removes all the objects from the IDependencyTracker.
 void removeDependent(Object entry)
          Utility that removes a dependent entry.
 void removePrerequisite(Object entry)
          Utility that removes a prerequisite entry.
 List removeWithAllPrerequisites(Object entry)
          Removes an entry, along with all its prerequisites that are only dependents of the entry.
 List removeWithPrerequisites(Object entry)
          Removes an entry, along with its prerequisites that are only dependents of the entry.
 int size()
          Answers the number of entries in the IDependencyTracker.
 String toXml(String name)
          Answers an XML representation of the IDependencyTracker.
 String toXml(String name, IDependencyTracker.IXmlProvider xmlProvider)
          Answers an XML representation of the IDependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider.
 String toXml(String name, int indent)
          Answers an XML representation of the IDependencyTracker.
 String toXml(String name, int indent, IDependencyTracker.IXmlProvider xmlProvider)
          Answers an XML representation of the IDependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider.
 

Method Detail

add

boolean add(Object dependent,
            Object prerequisite)
Create a dependent and prerequisite relationship.

Parameters:
dependent - An Object that is a dependent of a prerequisite Object.
prerequisite - An Object that is a prerequisite of a dependent Object.
Returns:
If the dependency relationship was added return true, otherwise false.

getAllDependents

List getAllDependents(Object prerequisite)
Answers all the dependents of a prerequisite.

Parameters:
prerequisite - An Object that is a prerequisite.
Returns:
List

getAllPrerequisites

List getAllPrerequisites(Object dependent)
Answers all the prerequisites of a dependent.

Parameters:
dependent - An Object that is a dependent.
Returns:
List

getDependents

List getDependents()
Answers all the entries that are dependents.

Returns:
List

getDependents

List getDependents(Object prerequisite)
Answers the immediate dependents of an entry.

Parameters:
prerequisite - An Object that is a prerequisite.
Returns:
List

getPrerequisites

List getPrerequisites()
Answers all the entries that are prerequisites.

Returns:
List

getPrerequisites

List getPrerequisites(Object dependent)
Answers the immediate prerequisites of an entry.

Parameters:
dependent - An Object that is a dependent.
Returns:
List

getValues

List getValues()
Answers a list of all the objects in the IDependencyTracker.

Returns:
List

hasCircularReferences

boolean hasCircularReferences(Object entry)
Answers true if an entry has circular references otherwise false.

Parameters:
entry - Any object stored in the IDependencyTracker.
Returns:
boolean

hasDependents

boolean hasDependents()
Answers true if dependent entries exist, otherwise false.

Returns:
boolean

hasPrerequisites

boolean hasPrerequisites()
Answers true if prerequisite entries exist, otherwise false.

Returns:
boolean

isEmpty

boolean isEmpty()
Answers true if the DepenencyTrackerService is empty, otherwise false.

Returns:
boolean

remove

void remove(Object entry)
Removes an Object, severing its dependent and prerequisite relationships.

Parameters:
entry - An Object in the IDependencyTracker.

remove

boolean remove(Object dependent,
               Object prerequisite)
Destroy a dependent and prerequisite relationship.

Parameters:
dependent - An Object that is dependent of a prerequisite object.
prerequisite - An Object that is a prerequisite of a dependent object.
Returns:
If the dependent or prerequisite was removed return true, otherwise false.

removeAll

void removeAll()
Removes all the objects from the IDependencyTracker.


removeDependent

void removeDependent(Object entry)
Utility that removes a dependent entry.

Parameters:
entry - A dependent Object.

removePrerequisite

void removePrerequisite(Object entry)
Utility that removes a prerequisite entry.

Parameters:
entry - A prerequisite Object.

removeWithAllPrerequisites

List removeWithAllPrerequisites(Object entry)
Removes an entry, along with all its prerequisites that are only dependents of the entry. Answers the prerequisites that were removed.

Parameters:
entry - An dependent Object.
Returns:
List

removeWithPrerequisites

List removeWithPrerequisites(Object entry)
Removes an entry, along with its prerequisites that are only dependents of the entry. Answers the prerequisites that were removed.

Parameters:
entry - A dependent Object.
Returns:
The immediate prerequisites of the dependent entry that were removed.

size

int size()
Answers the number of entries in the IDependencyTracker.

Returns:
int

toXml

String toXml(String name)
Answers an XML representation of the IDependencyTracker. This method uses the default implementation of the interface IDependencyTracker.IXmlProvider, which simply returns the value of the dependent and prerequisite object without performing a conversion. This is most appropriate for cases where the dependent and prerequisite objects are instances of the class String.

Parameters:
name - The value of the name attribute in the top-most <dependencyTracker> element.
Returns:
The XML representation of the IDependencyTracker.

toXml

String toXml(String name,
             IDependencyTracker.IXmlProvider xmlProvider)
Answers an XML representation of the IDependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider. This is most appropriate for cases where the dependent or prerequisite objects are not instances of the class String.

Parameters:
name - The value of the name attribute in the top-most <dependencyTracker> element.
xmlProvider - An custom implementation of the interface IDependencyTracker.IXmlProvider responsible for converting the dependent and prerequisite objects into XML.
Returns:
The XML representation of the IDependencyTracker.

toXml

String toXml(String name,
             int indent)
Answers an XML representation of the IDependencyTracker. This method uses the default implementation of the interface IDependencyTracker.IXmlProvider, which simply returns the value of the dependent and prerequisite object without performing a conversion. This is most appropriate for cases where the dependent and prerequisite objects are instances of the class String.

Parameters:
name - The value of the name attribute in the top-most <dependencyTracker> element.
indent - The indent level at which to start.
Returns:
The XML representation of the IDependencyTracker.

toXml

String toXml(String name,
             int indent,
             IDependencyTracker.IXmlProvider xmlProvider)
Answers an XML representation of the IDependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider. This is most appropriate for cases where the dependent or prerequisite objects are not instances of the class String.

Parameters:
name - The value of the name attribute in the top-most <dependencyTracker> element.
indent - The indent level at which to start.
xmlProvider - An custom implementation of the interface IDependencyTracker.IXmlProvider responsible for converting the dependent and prerequisite objects into XML.
Returns:
The XML representation of the IDependencyTracker.

Service Activator Toolkit
Version 1.1.0 (20081206)