|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.grana.DependencyGraph<S,T>
S
- the identifier typeT
- the object typepublic class DependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
A graph structure for expressing and resolving object dependencies.
Constructor Summary | |
---|---|
DependencyGraph()
|
Method Summary | |
---|---|
boolean |
add(T object)
Adds an object to the graph if all dependencies can be resolved. |
List<T> |
addAll(Collection<T> objects)
Adds a collection of objects to the graph and tries to resolve dependencies. Returns a list of objects that could not be added cause they had missing dependencies or were part of a cycle. |
List<T> |
dependencySort(List<T> objects)
Returns a sorted list of the objects so that an object that depends on another object precedes it in the list. |
T |
get(S id)
Returns an object by it's identifier. |
List<T> |
remove(T object)
Removes an object from the graph and all objects depending on it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DependencyGraph()
Method Detail |
---|
public boolean add(T object)
add
in interface IDependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
object
- the object
public List<T> remove(T object)
remove
in interface IDependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
object
- the object to remove
public List<T> addAll(Collection<T> objects)
addAll
in interface IDependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
objects
- the objects to add
public T get(S id)
get
in interface IDependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
id
- the identifier
public List<T> dependencySort(List<T> objects)
dependencySort
in interface IDependencyGraph<S extends Comparable<S>,T extends IDepending<S>>
objects
- the objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |