private LinkedList < TimephasedWork > readTimephasedAssignment ( ProjectCalendar calendar , Project . Assignments . Assignment assignment , int type ) { LinkedList < TimephasedWork > result = new LinkedList < TimephasedWork > ( ) ; for ( TimephasedDataType item : assignment . getTimephasedData ( ) ) { if ( NumberHelper . getInt ( item . getType ( ) ) != type ) { continue ; } Date startDate = item . getStart ( ) ; Date finishDate = item . getFinish ( ) ; // Exclude ranges which don't have a start and end date. // These seem to be generated by Synchro and have a zero duration. if ( startDate == null && finishDate == null ) { continue ; } Duration work = DatatypeConverter . parseDuration ( m_projectFile , TimeUnit . MINUTES , item . getValue ( ) ) ; if ( work == null ) { work = Duration . getInstance ( 0 , TimeUnit . MINUTES ) ; } else { work = Duration . getInstance ( NumberHelper . round ( work . getDuration ( ) , 2 ) , TimeUnit . MINUTES ) ; } TimephasedWork tra = new TimephasedWork ( ) ; tra . setStart ( startDate ) ; tra . setFinish ( finishDate ) ; tra . setTotalAmount ( work ) ; result . add ( tra ) ; } return result ; }
Reads timephased assignment data .