idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
143,700
public static final String getString ( InputStream is ) throws IOException { int type = is . read ( ) ; if ( type != 1 ) { throw new IllegalArgumentException ( "Unexpected string format" ) ; } Charset charset = CharsetHelper . UTF8 ; int length = is . read ( ) ; if ( length == 0xFF ) { length = getShort ( is ) ; if ( l...
Read a Synchro string from an input stream .
143,701
public static final UUID getUUID ( InputStream is ) throws IOException { byte [ ] data = new byte [ 16 ] ; is . read ( data ) ; long long1 = 0 ; long1 |= ( ( long ) ( data [ 3 ] & 0xFF ) ) << 56 ; long1 |= ( ( long ) ( data [ 2 ] & 0xFF ) ) << 48 ; long1 |= ( ( long ) ( data [ 1 ] & 0xFF ) ) << 40 ; long1 |= ( ( long )...
Retrieve a UUID from an input stream .
143,702
public static final Date getDate ( InputStream is ) throws IOException { long timeInSeconds = getInt ( is ) ; if ( timeInSeconds == 0x93406FFF ) { return null ; } timeInSeconds -= 3600 ; timeInSeconds *= 1000 ; return DateHelper . getDateFromLong ( timeInSeconds ) ; }
Read a Synchro date from an input stream .
143,703
public static final Date getTime ( InputStream is ) throws IOException { int timeValue = getInt ( is ) ; timeValue -= 86400 ; timeValue /= 60 ; return DateHelper . getTimeFromMinutesPastMidnight ( Integer . valueOf ( timeValue ) ) ; }
Read a Synchro time from an input stream .
143,704
public static final Duration getDuration ( InputStream is ) throws IOException { double durationInSeconds = getInt ( is ) ; durationInSeconds /= ( 60 * 60 ) ; return Duration . getInstance ( durationInSeconds , TimeUnit . HOURS ) ; }
Retrieve a Synchro Duration from an input stream .
143,705
public static final Double getDouble ( InputStream is ) throws IOException { double result = Double . longBitsToDouble ( getLong ( is ) ) ; if ( Double . isNaN ( result ) ) { result = 0 ; } return Double . valueOf ( result ) ; }
Retrieve a Double from an input stream .
143,706
public void process ( ) { if ( m_data != null ) { int index = 0 ; int offset = 0 ; int length = MPPUtility . getInt ( m_data , offset ) ; offset += 8 ; int numberOfAliases = MPPUtility . getInt ( m_data , offset ) ; offset += 4 ; while ( index < numberOfAliases && offset < length ) { int fieldID = MPPUtility . getInt (...
Process field aliases .
143,707
public List < ProjectListType . Project > getProject ( ) { if ( project == null ) { project = new ArrayList < ProjectListType . Project > ( ) ; } return this . project ; }
Gets the value of the project property .
143,708
public static final String printExtendedAttributeCurrency ( Number value ) { return ( value == null ? null : NUMBER_FORMAT . get ( ) . format ( value . doubleValue ( ) * 100 ) ) ; }
Print an extended attribute currency value .
143,709
public static final Number parseExtendedAttributeCurrency ( String value ) { Number result ; if ( value == null ) { result = null ; } else { result = NumberHelper . getDouble ( Double . parseDouble ( correctNumberFormat ( value ) ) / 100 ) ; } return result ; }
Parse an extended attribute currency value .
143,710
public static final Boolean parseExtendedAttributeBoolean ( String value ) { return ( ( value . equals ( "1" ) ? Boolean . TRUE : Boolean . FALSE ) ) ; }
Parse an extended attribute boolean value .
143,711
public static final String printExtendedAttributeDate ( Date value ) { return ( value == null ? null : DATE_FORMAT . get ( ) . format ( value ) ) ; }
Print an extended attribute date value .
143,712
public static final Date parseExtendedAttributeDate ( String value ) { Date result = null ; if ( value != null ) { try { result = DATE_FORMAT . get ( ) . parse ( value ) ; } catch ( ParseException ex ) { } } return ( result ) ; }
Parse an extended attribute date value .
143,713
public static final String printExtendedAttribute ( MSPDIWriter writer , Object value , DataType type ) { String result ; if ( type == DataType . DATE ) { result = printExtendedAttributeDate ( ( Date ) value ) ; } else { if ( value instanceof Boolean ) { result = printExtendedAttributeBoolean ( ( Boolean ) value ) ; } ...
Print an extended attribute value .
143,714
public static final void parseExtendedAttribute ( ProjectFile file , FieldContainer mpx , String value , FieldType mpxFieldID , TimeUnit durationFormat ) { if ( mpxFieldID != null ) { switch ( mpxFieldID . getDataType ( ) ) { case STRING : { mpx . set ( mpxFieldID , value ) ; break ; } case DATE : { mpx . set ( mpxFiel...
Parse an extended attribute value .
143,715
public static final String printCurrencySymbolPosition ( CurrencySymbolPosition value ) { String result ; switch ( value ) { default : case BEFORE : { result = "0" ; break ; } case AFTER : { result = "1" ; break ; } case BEFORE_WITH_SPACE : { result = "2" ; break ; } case AFTER_WITH_SPACE : { result = "3" ; break ; } }...
Prints a currency symbol position value .
143,716
public static final CurrencySymbolPosition parseCurrencySymbolPosition ( String value ) { CurrencySymbolPosition result = CurrencySymbolPosition . BEFORE ; switch ( NumberHelper . getInt ( value ) ) { case 0 : { result = CurrencySymbolPosition . BEFORE ; break ; } case 1 : { result = CurrencySymbolPosition . AFTER ; br...
Parse a currency symbol position value .
143,717
public static final String printAccrueType ( AccrueType value ) { return ( Integer . toString ( value == null ? AccrueType . PRORATED . getValue ( ) : value . getValue ( ) ) ) ; }
Print an accrue type .
143,718
public static final String printResourceType ( ResourceType value ) { return ( Integer . toString ( value == null ? ResourceType . WORK . getValue ( ) : value . getValue ( ) ) ) ; }
Print a resource type .
143,719
public static final String printWorkGroup ( WorkGroup value ) { return ( Integer . toString ( value == null ? WorkGroup . DEFAULT . getValue ( ) : value . getValue ( ) ) ) ; }
Print a work group .
143,720
public static final String printWorkContour ( WorkContour value ) { return ( Integer . toString ( value == null ? WorkContour . FLAT . getValue ( ) : value . getValue ( ) ) ) ; }
Print a work contour .
143,721
public static final String printBookingType ( BookingType value ) { return ( Integer . toString ( value == null ? BookingType . COMMITTED . getValue ( ) : value . getValue ( ) ) ) ; }
Print a booking type .
143,722
public static final String printTaskType ( TaskType value ) { return ( Integer . toString ( value == null ? TaskType . FIXED_UNITS . getValue ( ) : value . getValue ( ) ) ) ; }
Print a task type .
143,723
public static final BigInteger printEarnedValueMethod ( EarnedValueMethod value ) { return ( value == null ? BigInteger . valueOf ( EarnedValueMethod . PERCENT_COMPLETE . getValue ( ) ) : BigInteger . valueOf ( value . getValue ( ) ) ) ; }
Print an earned value method .
143,724
public static final BigDecimal printUnits ( Number value ) { return ( value == null ? BIGDECIMAL_ONE : new BigDecimal ( value . doubleValue ( ) / 100 ) ) ; }
Print units .
143,725
public static final Number parseUnits ( Number value ) { return ( value == null ? null : NumberHelper . getDouble ( value . doubleValue ( ) * 100 ) ) ; }
Parse units .
143,726
public static final BigInteger printTimeUnit ( TimeUnit value ) { return ( BigInteger . valueOf ( value == null ? TimeUnit . DAYS . getValue ( ) + 1 : value . getValue ( ) + 1 ) ) ; }
Print time unit .
143,727
public static final TimeUnit parseWorkUnits ( BigInteger value ) { TimeUnit result = TimeUnit . HOURS ; if ( value != null ) { switch ( value . intValue ( ) ) { case 1 : { result = TimeUnit . MINUTES ; break ; } case 3 : { result = TimeUnit . DAYS ; break ; } case 4 : { result = TimeUnit . WEEKS ; break ; } case 5 : { ...
Parse work units .
143,728
public static final BigInteger printWorkUnits ( TimeUnit value ) { int result ; if ( value == null ) { value = TimeUnit . HOURS ; } switch ( value ) { case MINUTES : { result = 1 ; break ; } case DAYS : { result = 3 ; break ; } case WEEKS : { result = 4 ; break ; } case MONTHS : { result = 5 ; break ; } case YEARS : { ...
Print work units .
143,729
public static final Double parseCurrency ( Number value ) { return ( value == null ? null : NumberHelper . getDouble ( value . doubleValue ( ) / 100 ) ) ; }
Parse currency .
143,730
public static final BigDecimal printCurrency ( Number value ) { return ( value == null || value . doubleValue ( ) == 0 ? null : new BigDecimal ( value . doubleValue ( ) * 100 ) ) ; }
Print currency .
143,731
public static final TimeUnit parseDurationTimeUnits ( BigInteger value , TimeUnit defaultValue ) { TimeUnit result = defaultValue ; if ( value != null ) { switch ( value . intValue ( ) ) { case 3 : case 35 : { result = TimeUnit . MINUTES ; break ; } case 4 : case 36 : { result = TimeUnit . ELAPSED_MINUTES ; break ; } c...
Parse duration time units .
143,732
public static final Priority parsePriority ( BigInteger priority ) { return ( priority == null ? null : Priority . getInstance ( priority . intValue ( ) ) ) ; }
Parse priority .
143,733
public static final BigInteger printPriority ( Priority priority ) { int result = Priority . MEDIUM ; if ( priority != null ) { result = priority . getValue ( ) ; } return ( BigInteger . valueOf ( result ) ) ; }
Print priority .
143,734
public static final Duration parseDurationInThousanthsOfMinutes ( ProjectProperties properties , Number value , TimeUnit targetTimeUnit ) { return parseDurationInFractionsOfMinutes ( properties , value , targetTimeUnit , 1000 ) ; }
Parse duration represented in thousandths of minutes .
143,735
public static final BigDecimal printDurationInDecimalThousandthsOfMinutes ( Duration duration ) { BigDecimal result = null ; if ( duration != null && duration . getDuration ( ) != 0 ) { result = BigDecimal . valueOf ( printDurationFractionsOfMinutes ( duration , 1000 ) ) ; } return result ; }
Print duration in thousandths of minutes .
143,736
public static final BigInteger printDurationInIntegerTenthsOfMinutes ( Duration duration ) { BigInteger result = null ; if ( duration != null && duration . getDuration ( ) != 0 ) { result = BigInteger . valueOf ( ( long ) printDurationFractionsOfMinutes ( duration , 10 ) ) ; } return result ; }
Print duration in tenths of minutes .
143,737
public static final UUID parseUUID ( String value ) { return value == null || value . isEmpty ( ) ? null : UUID . fromString ( value ) ; }
Convert the MSPDI representation of a UUID into a Java UUID instance .
143,738
private static final Duration parseDurationInFractionsOfMinutes ( ProjectProperties properties , Number value , TimeUnit targetTimeUnit , int factor ) { Duration result = null ; if ( value != null ) { result = Duration . getInstance ( value . intValue ( ) / factor , TimeUnit . MINUTES ) ; if ( targetTimeUnit != result ...
Parse duration represented as an arbitrary fraction of minutes .
143,739
private static final double printDurationFractionsOfMinutes ( Duration duration , int factor ) { double result = 0 ; if ( duration != null ) { result = duration . getDuration ( ) ; switch ( duration . getUnits ( ) ) { case HOURS : case ELAPSED_HOURS : { result *= 60 ; break ; } case DAYS : { result *= ( 60 * 8 ) ; brea...
Print a duration represented by an arbitrary fraction of minutes .
143,740
public static final BigDecimal printRate ( Rate rate ) { BigDecimal result = null ; if ( rate != null && rate . getAmount ( ) != 0 ) { result = new BigDecimal ( rate . getAmount ( ) ) ; } return result ; }
Print rate .
143,741
public static final Rate parseRate ( BigDecimal value ) { Rate result = null ; if ( value != null ) { result = new Rate ( value , TimeUnit . HOURS ) ; } return ( result ) ; }
Parse rate .
143,742
public static final BigInteger printDay ( Day day ) { return ( day == null ? null : BigInteger . valueOf ( day . getValue ( ) - 1 ) ) ; }
Print a day .
143,743
public static final BigInteger printConstraintType ( ConstraintType value ) { return ( value == null ? null : BigInteger . valueOf ( value . getValue ( ) ) ) ; }
Print a constraint type .
143,744
public static final String printTaskUID ( Integer value ) { ProjectFile file = PARENT_FILE . get ( ) ; if ( file != null ) { file . getEventManager ( ) . fireTaskWrittenEvent ( file . getTaskByUniqueID ( value ) ) ; } return ( value . toString ( ) ) ; }
Print a task UID .
143,745
public static final String printResourceUID ( Integer value ) { ProjectFile file = PARENT_FILE . get ( ) ; if ( file != null ) { file . getEventManager ( ) . fireResourceWrittenEvent ( file . getResourceByUniqueID ( value ) ) ; } return ( value . toString ( ) ) ; }
Print a resource UID .
143,746
public static final Boolean parseBoolean ( String value ) { return ( value == null || value . charAt ( 0 ) != '1' ? Boolean . FALSE : Boolean . TRUE ) ; }
Parse a boolean .
143,747
public static final String printDateTime ( Date value ) { return ( value == null ? null : DATE_FORMAT . get ( ) . format ( value ) ) ; }
Print a date time value .
143,748
private static final String correctNumberFormat ( String value ) { String result ; int index = value . indexOf ( ',' ) ; if ( index == - 1 ) { result = value ; } else { char [ ] chars = value . toCharArray ( ) ; chars [ index ] = '.' ; result = new String ( chars ) ; } return result ; }
Detect numbers using comma as a decimal separator and replace with period .
143,749
public static final ProjectFile setProjectNameAndRead ( File directory ) throws MPXJException { List < String > projects = listProjectNames ( directory ) ; if ( ! projects . isEmpty ( ) ) { P3DatabaseReader reader = new P3DatabaseReader ( ) ; reader . setProjectName ( projects . get ( 0 ) ) ; return reader . read ( dir...
Convenience method which locates the first P3 database in a directory and opens it .
143,750
public static final List < String > listProjectNames ( File directory ) { List < String > result = new ArrayList < String > ( ) ; File [ ] files = directory . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { return name . toUpperCase ( ) . endsWith ( "STR.P3" ) ; } } ) ; if ( file...
Retrieve a list of the available P3 project names from a directory .
143,751
private void readProjectHeader ( ) { Table table = m_tables . get ( "DIR" ) ; MapRow row = table . find ( "" ) ; if ( row != null ) { setFields ( PROJECT_FIELDS , row , m_projectFile . getProjectProperties ( ) ) ; m_wbsFormat = new P3WbsFormat ( row ) ; } }
Read general project properties .
143,752
private void readWBS ( ) { Map < Integer , List < MapRow > > levelMap = new HashMap < Integer , List < MapRow > > ( ) ; for ( MapRow row : m_tables . get ( "STR" ) ) { Integer level = row . getInteger ( "LEVEL_NUMBER" ) ; List < MapRow > items = levelMap . get ( level ) ; if ( items == null ) { items = new ArrayList < ...
Read tasks representing the WBS .
143,753
private void readRelationships ( ) { for ( MapRow row : m_tables . get ( "REL" ) ) { Task predecessor = m_activityMap . get ( row . getString ( "PREDECESSOR_ACTIVITY_ID" ) ) ; Task successor = m_activityMap . get ( row . getString ( "SUCCESSOR_ACTIVITY_ID" ) ) ; if ( predecessor != null && successor != null ) { Duratio...
Read task relationships .
143,754
private void setFields ( Map < String , FieldType > map , MapRow row , FieldContainer container ) { if ( row != null ) { for ( Map . Entry < String , FieldType > entry : map . entrySet ( ) ) { container . set ( entry . getValue ( ) , row . getObject ( entry . getKey ( ) ) ) ; } } }
Set the value of one or more fields based on the contents of a database row .
143,755
private static void defineField ( Map < String , FieldType > container , String name , FieldType type ) { defineField ( container , name , type , null ) ; }
Configure the mapping between a database column and a field .
143,756
private static void dumpTree ( PrintWriter pw , DirectoryEntry dir , String prefix , boolean showData , boolean hex , String indent ) throws Exception { long byteCount ; for ( Iterator < Entry > iter = dir . getEntries ( ) ; iter . hasNext ( ) ; ) { Entry entry = iter . next ( ) ; if ( entry instanceof DirectoryEntry )...
This method recursively descends the directory structure dumping details of any files it finds to the output file .
143,757
private static long hexdump ( InputStream is , PrintWriter pw ) throws Exception { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; long byteCount = 0 ; char c ; int loop ; int count ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { count = is . read ( buffer ) ; if ( count == - 1 ) { break ; } byteCount += cou...
This method dumps the entire contents of a file to an output print writer as hex and ASCII data .
143,758
private static long asciidump ( InputStream is , PrintWriter pw ) throws Exception { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; long byteCount = 0 ; char c ; int loop ; int count ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { count = is . read ( buffer ) ; if ( count == - 1 ) { break ; } byteCount += c...
This method dumps the entire contents of a file to an output print writer as ascii data .
143,759
protected void mergeSameCost ( LinkedList < TimephasedCost > list ) { LinkedList < TimephasedCost > result = new LinkedList < TimephasedCost > ( ) ; TimephasedCost previousAssignment = null ; for ( TimephasedCost assignment : list ) { if ( previousAssignment == null ) { assignment . setAmountPerDay ( assignment . getTo...
This method merges together assignment data for the same cost .
143,760
public void write ( ProjectFile projectFile , OutputStream out ) throws IOException { m_projectFile = projectFile ; m_eventManager = projectFile . getEventManager ( ) ; m_writer = new PrintStream ( out ) ; m_buffer = new StringBuilder ( ) ; try { write ( ) ; } finally { m_writer = null ; m_projectFile = null ; m_buffer...
Write a project file in SDEF format to an output stream .
143,761
private void writeProjectProperties ( ProjectProperties record ) throws IOException { m_minutesPerDay = record . getMinutesPerDay ( ) . doubleValue ( ) ; m_minutesPerWeek = record . getMinutesPerWeek ( ) . doubleValue ( ) ; m_daysPerMonth = record . getDaysPerMonth ( ) . doubleValue ( ) ; m_buffer . setLength ( 0 ) ; m...
Write project properties .
143,762
private void writeCalendars ( List < ProjectCalendar > records ) { for ( ProjectCalendar record : records ) { m_buffer . setLength ( 0 ) ; m_buffer . append ( "CLDR " ) ; m_buffer . append ( SDEFmethods . lset ( record . getUniqueID ( ) . toString ( ) , 2 ) ) ; String workDays = SDEFmethods . workDays ( record ) ; m_bu...
This will create a line in the SDEF file for each calendar if there are more than 9 calendars you ll have a big error as USACE numbers them 0 - 9 .
143,763
private void writeExceptions ( List < ProjectCalendar > records ) throws IOException { for ( ProjectCalendar record : records ) { if ( ! record . getCalendarExceptions ( ) . isEmpty ( ) ) { for ( ProjectCalendarException ex : record . getCalendarExceptions ( ) ) { writeCalendarException ( record , ex ) ; } } m_eventMan...
Write calendar exceptions .
143,764
private void writeTaskPredecessors ( Task record ) { m_buffer . setLength ( 0 ) ; if ( ! record . getSummary ( ) && ! record . getPredecessors ( ) . isEmpty ( ) ) { m_buffer . append ( "PRED " ) ; List < Relation > predecessors = record . getPredecessors ( ) ; for ( Relation pred : predecessors ) { m_buffer . append ( ...
Write each predecessor for a task .
143,765
private Duration getAssignmentWork ( ProjectCalendar calendar , TimephasedWork assignment ) { Date assignmentStart = assignment . getStart ( ) ; Date splitStart = assignmentStart ; Date splitFinishTime = calendar . getFinishTime ( splitStart ) ; Date splitFinish = DateHelper . setTime ( splitStart , splitFinishTime ) ;...
Retrieves the pro - rata work carried out on a given day .
143,766
private Map < Integer , List < Row > > createWorkPatternAssignmentMap ( List < Row > rows ) throws ParseException { Map < Integer , List < Row > > map = new HashMap < Integer , List < Row > > ( ) ; for ( Row row : rows ) { Integer calendarID = row . getInteger ( "ID" ) ; String workPatterns = row . getString ( "WORK_PA...
Create the work pattern assignment map .
143,767
private List < Row > createWorkPatternAssignmentRowList ( String workPatterns ) throws ParseException { List < Row > list = new ArrayList < Row > ( ) ; String [ ] patterns = workPatterns . split ( ",|:" ) ; int index = 1 ; while ( index < patterns . length ) { Integer workPattern = Integer . valueOf ( patterns [ index ...
Extract a list of work pattern assignments .
143,768
private Map < Integer , List < Row > > createExceptionAssignmentMap ( List < Row > rows ) { Map < Integer , List < Row > > map = new HashMap < Integer , List < Row > > ( ) ; for ( Row row : rows ) { Integer calendarID = row . getInteger ( "ID" ) ; String exceptions = row . getString ( "EXCEPTIONS" ) ; map . put ( calen...
Create the exception assignment map .
143,769
private List < Row > createExceptionAssignmentRowList ( String exceptionData ) { List < Row > list = new ArrayList < Row > ( ) ; String [ ] exceptions = exceptionData . split ( ",|:" ) ; int index = 1 ; while ( index < exceptions . length ) { Date startDate = DatatypeConverter . parseEpochTimestamp ( exceptions [ index...
Extract a list of exception assignments .
143,770
private Map < Integer , List < Row > > createTimeEntryMap ( List < Row > rows ) throws ParseException { Map < Integer , List < Row > > map = new HashMap < Integer , List < Row > > ( ) ; for ( Row row : rows ) { Integer workPatternID = row . getInteger ( "ID" ) ; String shifts = row . getString ( "SHIFTS" ) ; map . put ...
Create the time entry map .
143,771
private List < Row > createTimeEntryRowList ( String shiftData ) throws ParseException { List < Row > list = new ArrayList < Row > ( ) ; String [ ] shifts = shiftData . split ( ",|:" ) ; int index = 1 ; while ( index < shifts . length ) { index += 2 ; int entryCount = Integer . parseInt ( shifts [ index ] ) ; index ++ ...
Extract a list of time entries .
143,772
public Map < Integer , TableDefinition > tableDefinitions ( ) { Map < Integer , TableDefinition > result = new HashMap < Integer , TableDefinition > ( ) ; result . put ( Integer . valueOf ( 2 ) , new TableDefinition ( "PROJECT_SUMMARY" , columnDefinitions ( PROJECT_SUMMARY_COLUMNS , projectSummaryColumnsOrder ( ) ) ) )...
Retrieves the table structure for an Asta PP file . Subclasses determine the exact contents of the structure for a specific version of the Asta PP file .
143,773
private ColumnDefinition [ ] columnDefinitions ( ColumnDefinition [ ] columns , String [ ] order ) { Map < String , ColumnDefinition > map = makeColumnMap ( columns ) ; ColumnDefinition [ ] result = new ColumnDefinition [ order . length ] ; for ( int index = 0 ; index < order . length ; index ++ ) { result [ index ] = ...
Generate an ordered set of column definitions from an ordered set of column names .
143,774
private Map < String , ColumnDefinition > makeColumnMap ( ColumnDefinition [ ] columns ) { Map < String , ColumnDefinition > map = new HashMap < String , ColumnDefinition > ( ) ; for ( ColumnDefinition def : columns ) { map . put ( def . getName ( ) , def ) ; } return map ; }
Convert an array of column definitions into a map keyed by column name .
143,775
private void writeProjectExtendedAttributes ( Project project ) { Project . ExtendedAttributes attributes = m_factory . createProjectExtendedAttributes ( ) ; project . setExtendedAttributes ( attributes ) ; List < Project . ExtendedAttributes . ExtendedAttribute > list = attributes . getExtendedAttribute ( ) ; Set < Fi...
This method writes project extended attribute data into an MSPDI file .
143,776
private void writeCalendars ( Project project ) { Project . Calendars calendars = m_factory . createProjectCalendars ( ) ; project . setCalendars ( calendars ) ; List < Project . Calendars . Calendar > calendar = calendars . getCalendar ( ) ; for ( ProjectCalendar cal : m_projectFile . getCalendars ( ) ) { calendar . a...
This method writes calendar data to an MSPDI file .
143,777
private Project . Calendars . Calendar writeCalendar ( ProjectCalendar bc ) { Project . Calendars . Calendar calendar = m_factory . createProjectCalendarsCalendar ( ) ; calendar . setUID ( NumberHelper . getBigInteger ( bc . getUniqueID ( ) ) ) ; calendar . setIsBaseCalendar ( Boolean . valueOf ( ! bc . isDerived ( ) )...
This method writes data for a single calendar to an MSPDI file .
143,778
private void writeExceptions ( Project . Calendars . Calendar calendar , List < Project . Calendars . Calendar . WeekDays . WeekDay > dayList , List < ProjectCalendarException > exceptions ) { writeExceptions9 ( dayList , exceptions ) ; if ( m_saveVersion . getValue ( ) > SaveVersion . Project2003 . getValue ( ) ) { wr...
Main entry point used to determine the format used to write calendar exceptions .
143,779
private void writeExceptions9 ( List < Project . Calendars . Calendar . WeekDays . WeekDay > dayList , List < ProjectCalendarException > exceptions ) { for ( ProjectCalendarException exception : exceptions ) { boolean working = exception . getWorking ( ) ; Project . Calendars . Calendar . WeekDays . WeekDay day = m_fac...
Write exceptions in the format used by MSPDI files prior to Project 2007 .
143,780
private void writeExceptions12 ( Project . Calendars . Calendar calendar , List < ProjectCalendarException > exceptions ) { Exceptions ce = m_factory . createProjectCalendarsCalendarExceptions ( ) ; calendar . setExceptions ( ce ) ; List < Exceptions . Exception > el = ce . getException ( ) ; for ( ProjectCalendarExcep...
Write exceptions into the format used by MSPDI files from Project 2007 onwards .
143,781
private void populateRecurringException ( ProjectCalendarException mpxjException , Exceptions . Exception xmlException ) { RecurringData data = mpxjException . getRecurring ( ) ; xmlException . setEnteredByOccurrences ( Boolean . TRUE ) ; xmlException . setOccurrences ( NumberHelper . getBigInteger ( data . getOccurren...
Writes the details of a recurring exception .
143,782
private BigInteger getDaysOfTheWeek ( RecurringData data ) { int value = 0 ; for ( Day day : Day . values ( ) ) { if ( data . getWeeklyDay ( day ) ) { value = value | DAY_MASKS [ day . getValue ( ) ] ; } } return BigInteger . valueOf ( value ) ; }
Converts days of the week into a bit field .
143,783
private void writeWorkWeeks ( Project . Calendars . Calendar xmlCalendar , ProjectCalendar mpxjCalendar ) { List < ProjectCalendarWeek > weeks = mpxjCalendar . getWorkWeeks ( ) ; if ( ! weeks . isEmpty ( ) ) { WorkWeeks xmlWorkWeeks = m_factory . createProjectCalendarsCalendarWorkWeeks ( ) ; xmlCalendar . setWorkWeeks ...
Write the work weeks associated with this calendar .
143,784
private void writeResources ( Project project ) { Project . Resources resources = m_factory . createProjectResources ( ) ; project . setResources ( resources ) ; List < Project . Resources . Resource > list = resources . getResource ( ) ; for ( Resource resource : m_projectFile . getResources ( ) ) { list . add ( write...
This method writes resource data to an MSPDI file .
143,785
private void writeResourceBaselines ( Project . Resources . Resource xmlResource , Resource mpxjResource ) { Project . Resources . Resource . Baseline baseline = m_factory . createProjectResourcesResourceBaseline ( ) ; boolean populated = false ; Number cost = mpxjResource . getBaselineCost ( ) ; if ( cost != null && c...
Writes resource baseline data .
143,786
private void writeResourceExtendedAttributes ( Project . Resources . Resource xml , Resource mpx ) { Project . Resources . Resource . ExtendedAttribute attrib ; List < Project . Resources . Resource . ExtendedAttribute > extendedAttributes = xml . getExtendedAttribute ( ) ; for ( ResourceField mpxFieldID : getAllResour...
This method writes extended attribute data for a resource .
143,787
private void writeCostRateTables ( Project . Resources . Resource xml , Resource mpx ) { List < Project . Resources . Resource . Rates . Rate > ratesList = null ; for ( int tableIndex = 0 ; tableIndex < 5 ; tableIndex ++ ) { CostRateTable table = mpx . getCostRateTable ( tableIndex ) ; if ( table != null ) { Date from ...
Writes a resource s cost rate tables .
143,788
private boolean costRateTableWriteRequired ( CostRateTableEntry entry , Date from ) { boolean fromDate = ( DateHelper . compare ( from , DateHelper . FIRST_DATE ) > 0 ) ; boolean toDate = ( DateHelper . compare ( entry . getEndDate ( ) , DateHelper . LAST_DATE ) > 0 ) ; boolean costPerUse = ( NumberHelper . getDouble (...
This method determines whether the cost rate table should be written . A default cost rate table should not be written to the file .
143,789
private void writeAvailability ( Project . Resources . Resource xml , Resource mpx ) { AvailabilityPeriods periods = m_factory . createProjectResourcesResourceAvailabilityPeriods ( ) ; xml . setAvailabilityPeriods ( periods ) ; List < AvailabilityPeriod > list = periods . getAvailabilityPeriod ( ) ; for ( Availability ...
This method writes a resource s availability table .
143,790
private void writeTasks ( Project project ) { Project . Tasks tasks = m_factory . createProjectTasks ( ) ; project . setTasks ( tasks ) ; List < Project . Tasks . Task > list = tasks . getTask ( ) ; for ( Task task : m_projectFile . getTasks ( ) ) { list . add ( writeTask ( task ) ) ; } }
This method writes task data to an MSPDI file .
143,791
private void writeTaskBaselines ( Project . Tasks . Task xmlTask , Task mpxjTask ) { Project . Tasks . Task . Baseline baseline = m_factory . createProjectTasksTaskBaseline ( ) ; boolean populated = false ; Number cost = mpxjTask . getBaselineCost ( ) ; if ( cost != null && cost . intValue ( ) != 0 ) { populated = true...
Writes task baseline data .
143,792
private void writeTaskExtendedAttributes ( Project . Tasks . Task xml , Task mpx ) { Project . Tasks . Task . ExtendedAttribute attrib ; List < Project . Tasks . Task . ExtendedAttribute > extendedAttributes = xml . getExtendedAttribute ( ) ; for ( TaskField mpxFieldID : getAllTaskExtendedAttributes ( ) ) { Object valu...
This method writes extended attribute data for a task .
143,793
private BigInteger printExtendedAttributeDurationFormat ( Object value ) { BigInteger result = null ; if ( value instanceof Duration ) { result = DatatypeConverter . printDurationTimeUnits ( ( ( Duration ) value ) . getUnits ( ) , false ) ; } return ( result ) ; }
Converts a duration to duration time units .
143,794
private BigInteger getTaskCalendarID ( Task mpx ) { BigInteger result = null ; ProjectCalendar cal = mpx . getCalendar ( ) ; if ( cal != null ) { result = NumberHelper . getBigInteger ( cal . getUniqueID ( ) ) ; } else { result = NULL_CALENDAR_ID ; } return ( result ) ; }
This method retrieves the UID for a calendar associated with a task .
143,795
private void writePredecessors ( Project . Tasks . Task xml , Task mpx ) { List < Project . Tasks . Task . PredecessorLink > list = xml . getPredecessorLink ( ) ; List < Relation > predecessors = mpx . getPredecessors ( ) ; for ( Relation rel : predecessors ) { Integer taskUniqueID = rel . getTargetTask ( ) . getUnique...
This method writes predecessor data to an MSPDI file . We have to deal with a slight anomaly in this method that is introduced by the MPX file format . It would be possible for someone to create an MPX file with both the predecessor list and the unique ID predecessor list populated ... which means that we must process ...
143,796
private Project . Tasks . Task . PredecessorLink writePredecessor ( Integer taskID , RelationType type , Duration lag ) { Project . Tasks . Task . PredecessorLink link = m_factory . createProjectTasksTaskPredecessorLink ( ) ; link . setPredecessorUID ( NumberHelper . getBigInteger ( taskID ) ) ; link . setType ( BigInt...
This method writes a single predecessor link to the MSPDI file .
143,797
private void writeAssignments ( Project project ) { Project . Assignments assignments = m_factory . createProjectAssignments ( ) ; project . setAssignments ( assignments ) ; List < Project . Assignments . Assignment > list = assignments . getAssignment ( ) ; for ( ResourceAssignment assignment : m_projectFile . getReso...
This method writes assignment data to an MSPDI file .
143,798
private void writeAssignmentBaselines ( Project . Assignments . Assignment xml , ResourceAssignment mpxj ) { Project . Assignments . Assignment . Baseline baseline = m_factory . createProjectAssignmentsAssignmentBaseline ( ) ; boolean populated = false ; Number cost = mpxj . getBaselineCost ( ) ; if ( cost != null && c...
Writes assignment baseline data .
143,799
private void writeAssignmentExtendedAttributes ( Project . Assignments . Assignment xml , ResourceAssignment mpx ) { Project . Assignments . Assignment . ExtendedAttribute attrib ; List < Project . Assignments . Assignment . ExtendedAttribute > extendedAttributes = xml . getExtendedAttribute ( ) ; for ( AssignmentField...
This method writes extended attribute data for an assignment .