public ArrayList < Double > segmentCost ( ProjectCalendar projectCalendar , List < TimephasedCost > cost , TimescaleUnits rangeUnits , ArrayList < DateRange > dateList ) { ArrayList < Double > result = new ArrayList < Double > ( dateList . size ( ) ) ; int lastStartIndex = 0 ; // // Iterate through the list of dates range we are interested in. // Each date range in this list corresponds to a column // shown on the "timescale" view by MS Project // for ( DateRange range : dateList ) { // // If the current date range does not intersect with any of the // assignment date ranges in the list, then we show a zero // duration for this date range. // int startIndex = lastStartIndex == - 1 ? - 1 : getStartIndex ( range , cost , lastStartIndex ) ; if ( startIndex == - 1 ) { result . add ( NumberHelper . DOUBLE_ZERO ) ; } else { // // We have found an assignment which intersects with the current // date range, call the method below to determine how // much time from this resource assignment can be allocated // to the current date range. // result . add ( getRangeCost ( projectCalendar , rangeUnits , range , cost , startIndex ) ) ; lastStartIndex = startIndex ; } } return result ; }
This is the main entry point used to convert the internal representation of timephased cost into an external form which can be displayed to the user .