rafa.dep
Class DependencyManager

java.lang.Object
  extended by rafa.dep.DependencyManager

public class DependencyManager
extends java.lang.Object

Dependent manager.

Author:
rafa

Constructor Summary
DependencyManager(Dependent dependent)
           
 
Method Summary
 void addDependency(Dependency newDependency)
          Adds a dependency.
 void clearDependencies()
          Removes all of the dependencies.
 java.util.Collection<Dependency> getDependencies()
           
 java.util.Collection<Dependency> getDependencies(java.lang.Object dep)
          Gets the dependencies on a given object, including the details.
 java.util.Collection<java.lang.Object> getDependencyTargets()
          Gets the dependencies, that is the directly required objects themselves, with no further details.
 boolean hasDependency(java.lang.Object dep)
          Checks that a dependency is not included in a dependency tree.
 void removeDependencies(java.lang.Object target)
          Removes every dependency on a given target.
 void removeDependency(Dependency dep)
          Removes a single dependency.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyManager

public DependencyManager(Dependent dependent)
Method Detail

hasDependency

public boolean hasDependency(java.lang.Object dep)
Checks that a dependency is not included in a dependency tree.

Parameters:
dep -
Returns:
true if newDependency is already present in deps

getDependencyTargets

public java.util.Collection<java.lang.Object> getDependencyTargets()
Gets the dependencies, that is the directly required objects themselves, with no further details.

Returns:

getDependencies

public java.util.Collection<Dependency> getDependencies()
Returns:

getDependencies

public java.util.Collection<Dependency> getDependencies(java.lang.Object dep)
Gets the dependencies on a given object, including the details.

Parameters:
dep -
Returns:
a collection of dependencies on the passed object, or null if there is none.

addDependency

public void addDependency(Dependency newDependency)
                   throws CircularDependencyException
Adds a dependency.

Parameters:
newDependency - the added dependency
Throws:
CircularDependencyException - if there is a circular dependency

removeDependency

public void removeDependency(Dependency dep)
Removes a single dependency.

Parameters:
dep -

removeDependencies

public void removeDependencies(java.lang.Object target)
Removes every dependency on a given target.

Parameters:
target -

clearDependencies

public void clearDependencies()
Removes all of the dependencies.



Copyright © 2008-2009. All Rights Reserved.