A dependency analysis utility in Java which uses topological sorting to order values based on their dependencies.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
build
src/org/magnos/dependency
test/org/magnos/dependency
.classpath
.gitignore
.project
LICENSE.txt
README.md
build.properties
build.xml
formatter.xml

README.md

Dependz

Stable

A dependency analysis utility in Java which uses topological sorting to order values based on their dependencies.

There are two methods to build a DependencyGraph, one with DependencyNodes (which requires all DependencyNode references to be created ahead of time) or by using DependencyMap which can use an arbitrary key to map dependencies between values.

Example

DependencyMap<String, Integer> map = new DependencyMap<String, Integer>();
map.put( "value0", 0 );
map.put( "value1", 1 );
map.put( "value2", 2 );
map.put( "value3", 3 );
map.put( "value4", 4 );
map.addDependency( "value0", "value1" ); // value0 depends on value1
map.addDependency( "value2", "value0" ); 
map.addDependency( "value1", "value3" );
map.addDependency( "value1", "value4" );
        
DependencyAnalyzer<Integer> analyzer = map.toAnalyzer();

assertTrue( analyzer.isValid() );
assertEquals( Arrays.asList( 3, 4, 1, 0, 2 ), graph.getOrdered() );

Builds

Projects using Dependz