Service Activator Toolkit
Version 1.0.0

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


public interface IDependencyTracker

IDependencyTracker.java

See Also:
FactoryUtility

Nested Class Summary
static interface IDependencyTracker.IXmlProvider
          IXmlProvider
 
Method Summary
 boolean add(Object dependent, Object prerequisite)
          Create a dependent and prerequisite relationship.
 List getAllDependents(Object prerequisite)
          Answers all the dependents of an entry.
 List getAllPrerequisites(Object dependent)
          Answers all the prerequisites of an entry.
 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 DependencyTracker.
 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 DependencyTracker.
 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 DependencyTracker.
 String toXml(String name)
          Answers an XML representation of the DependencyTracker.
 String toXml(String name, IDependencyTracker.IXmlProvider xmlProvider)
          Answers an XML representation of the DependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider.
 String toXml(String name, int indent)
          Answers an XML representation of the DependencyTracker.
 String toXml(String name, int indent, IDependencyTracker.IXmlProvider xmlProvider)
          Answers an XML representation of the DependencyTracker using the specified implementation of the interface IDependencyTracker.IXmlProvider.
 

Method Detail

add

public boolean add(Object dependent,
                   Object prerequisite)
Create 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 dependency relationship was added return true, otherwise false.

getAllDependents

public List getAllDependents(Object prerequisite)
Answers all the dependents of an entry.

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

getAllPrerequisites

public List getAllPrerequisites(Object dependent)
Answers all the prerequisites of an entry.

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

getDependents

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

Returns:
List

getDependents

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

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

getPrerequisites

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

Returns:
List

getPrerequisites

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

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

getValues

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

Returns:
List

hasCircularReferences

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

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

hasDependents

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

Returns:
boolean

hasPrerequisites

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

Returns:
boolean

isEmpty

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

Returns:
boolean

remove

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

Parameters:
entry - An object in the DependencyTracker.

remove

public 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

public void removeAll()
Removes all the objects from the DependencyTracker.


removeDependent

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

Parameters:
entry - A dependent object.

removePrerequisite

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

Parameters:
entry - A prerequisite object.

removeWithAllPrerequisites

public 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

public 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

public int size()
Answers the number of entries in the DependencyTracker.

Returns:
int

toXml

public String toXml(String name)
Answers an XML representation of the DependencyTracker. 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 DependencyTracker.

toXml

public String toXml(String name,
                    IDependencyTracker.IXmlProvider xmlProvider)
Answers an XML representation of the DependencyTracker 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. %bc.
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 DependencyTracker.

toXml

public String toXml(String name,
                    int indent)
Answers an XML representation of the DependencyTracker. 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 DependencyTracker.

toXml

public String toXml(String name,
                    int indent,
                    IDependencyTracker.IXmlProvider xmlProvider)
Answers an XML representation of the DependencyTracker 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 DependencyTracker.

Service Activator Toolkit
Version 1.0.0