synchronized Weight getMinimumDuration ( ) { if ( calcMinDuration == null ) { Weight min = WeightFactory . POS_INFINITY ; for ( int i = 0 , n = intervals . size ( ) ; i < n ; i ++ ) { Object finish = intervals . get ( i ) . getFinish ( ) ; Map < ? , Weight > d = BellmanFord . calcShortestDistances ( finish , directedGraph , BellmanFord . Mode . SOURCE ) ; if ( d == null ) { throw new IllegalStateException ( "Negative cycle detected!" ) ; } for ( int j = 0 ; j < n ; j ++ ) { Object start = intervals . get ( j ) . getStart ( ) ; min = Weight . min ( min , d . get ( start ) ) ; } } calcMinDuration = min . invertSign ( ) ; } return calcMinDuration ; }
Calculates and returns the minimum time distance from the start of an interval to the finish of an interval .