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.

@param records list of ProjectCalendar instances
432955
private void writeCalendars(List<ProjectCalendar> records)
   {

      //
      // Write project calendars
      //
      for (ProjectCalendar record : records)
      {
         m_buffer.setLength(0);
         m_buffer.append("CLDR ");
         m_buffer.append(SDEFmethods.lset(record.getUniqueID().toString(), 2)); // 2 character used, USACE allows 1
         String workDays = SDEFmethods.workDays(record); // custom line, like NYYYYYN for a week
         m_buffer.append(SDEFmethods.lset(workDays, 8));
         m_buffer.append(SDEFmethods.lset(record.getName(), 30));
         m_writer.println(m_buffer);
      }
   }
757729
private void createMessageElement(StringBuilder sb, RepositoryLogRecord record){	// 660484 elim string concat
		sb.append(lineSeparator).append(INDENT[0]).append("<msgDataElement msgLocale=\"").append(record.getMessageLocale()).append("\">");
		if (record.getParameters() != null) {
			// how many params do we have?
			for (int c = 0; c < record.getParameters().length; c++) {
				sb.append(lineSeparator).append(INDENT[1]).append("<msgCatalogTokens value=\"").
					append(MessageFormat.format("{" + c + "}", record.getParameters())).append("\"/>");
			}
		}
		// IBM SWG MsgID
		if (record.getMessageID() != null) {
			// Seems to be a IBM SWG ID.
			sb.append(lineSeparator).append(INDENT[1]).append("<msgId>").append(record.getMessageID()).append("</msgId>");
			// IBM SWG MsgType
			sb.append(lineSeparator).append(INDENT[1]).append("<msgIdType>");
			if (record.getMessageID().length() == 10)
				sb.append("IBM5.4.1");
			else
				sb.append("IBM4.4.1");
			sb.append("</msgIdType>");
		}

		if (record.getRawMessage() != null && record.getResourceBundleName() != null) {
			sb.append(lineSeparator).append(INDENT[1]).append("<msgCatalogId>").append(record.getRawMessage()).append("</msgCatalogId>");
			sb.append(lineSeparator).append(INDENT[1]).append("<msgCatalogType>Java</msgCatalogType>");
			sb.append(lineSeparator).append(INDENT[1]).append("<msgCatalog>").append(record.getResourceBundleName()).append("</msgCatalog>");
		}

		sb.append(lineSeparator).append(INDENT[0]).append("</msgDataElement>");
	}
150869
public void setUsageRecords(java.util.Collection<UsageRecord> usageRecords) {
        if (usageRecords == null) {
            this.usageRecords = null;
            return;
        }

        this.usageRecords = new java.util.ArrayList<UsageRecord>(usageRecords);
    }
1024125
public void setBillingRecords(java.util.Collection<BillingRecord> billingRecords) {
        if (billingRecords == null) {
            this.billingRecords = null;
            return;
        }

        this.billingRecords = new com.amazonaws.internal.SdkInternalList<BillingRecord>(billingRecords);
    }
883355
public void write(Object[] record) throws IOException, DbaseFileException {

		if (record.length != header.getNumFields()) {
			throw new DbaseFileException("Wrong number of fields "
					+ record.length + " expected " + header.getNumFields());
		}

		buffer.position(0);

		// put the 'not-deleted' marker
		buffer.put((byte) ' ');

		for (int i = 0; i < header.getNumFields(); i++) {
			String fieldString = fieldString(record[i], i);
			if (header.getFieldLength(i) != fieldString
					.getBytes(charset.name()).length) {
				buffer.put(new byte[header.getFieldLength(i)]);
			} else {
				buffer.put(fieldString.getBytes(charset.name()));
			}

		}

		write();
	}
738623
public void setRecord(Rec record)
    {
        if (m_tableNext != null)
            m_tableNext.setRecord(record);  // Must be synchronized
        super.setRecord(record);
    }
530188
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_factory.createProjectCalendarsCalendarWeekDaysWeekDay();
         dayList.add(day);
         day.setDayType(BIGINTEGER_ZERO);
         day.setDayWorking(Boolean.valueOf(working));

         Project.Calendars.Calendar.WeekDays.WeekDay.TimePeriod period = m_factory.createProjectCalendarsCalendarWeekDaysWeekDayTimePeriod();
         day.setTimePeriod(period);
         period.setFromDate(exception.getFromDate());
         period.setToDate(exception.getToDate());

         if (working)
         {
            Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes times = m_factory.createProjectCalendarsCalendarWeekDaysWeekDayWorkingTimes();
            day.setWorkingTimes(times);
            List<Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes.WorkingTime> timesList = times.getWorkingTime();

            for (DateRange range : exception)
            {
               Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes.WorkingTime time = m_factory.createProjectCalendarsCalendarWeekDaysWeekDayWorkingTimesWorkingTime();
               timesList.add(time);

               time.setFromTime(range.getStart());
               time.setToTime(range.getEnd());
            }
         }
      }
   }
612988
private void populateDateTimeSettings(Record record, ProjectProperties properties)
   {
      properties.setDateOrder(record.getDateOrder(0));
      properties.setTimeFormat(record.getTimeFormat(1));

      Date time = getTimeFromInteger(record.getInteger(2));
      if (time != null)
      {
         properties.setDefaultStartTime(time);
      }

      Character c = record.getCharacter(3);
      if (c != null)
      {
         properties.setDateSeparator(c.charValue());
      }

      c = record.getCharacter(4);
      if (c != null)
      {
         properties.setTimeSeparator(c.charValue());
      }

      properties.setAMText(record.getString(5));
      properties.setPMText(record.getString(6));
      properties.setDateFormat(record.getDateFormat(7));
      properties.setBarTextDateFormat(record.getDateFormat(8));
   }
114801
private void setRecordNumber(LinkedList<String> list)
   {
      try
      {
         String number = list.remove(0);
         m_recordNumber = Integer.valueOf(number);
      }
      catch (NumberFormatException ex)
      {
         // Malformed MPX file: the record number isn't a valid integer
         // Catch the exception here, leaving m_recordNumber as null
         // so we will skip this record entirely.
      }
   }
944307
public void writeRecord(byte[] record) throws IOException {
        if (this.debug) {
            System.err.println("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
        }

        if (this.outStream == null) {
            throw new IOException("writing to an input buffer");
        }

        if (record.length != this.recordSize) {
            throw new IOException("record to write has length '" + record.length
                + "' which is not the record size of '" + this.recordSize + "'");
        }

        if (this.currRecIdx >= this.recsPerBlock) {
            this.writeBlock();
        }

        System.arraycopy(record, 0, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize);

        this.currRecIdx++;
    }
587795
public void record(long timeNano, int numEvents) {
    long leftEndPoint = bucket(timeNano);
    mSeries.put(leftEndPoint, mSeries.getOrDefault(leftEndPoint, 0) + numEvents);
  }
551328
private boolean processRecord(List<String> record) throws MPXJException
   {
      boolean done = false;

      XerRecordType type = RECORD_TYPE_MAP.get(record.get(0));
      if (type == null)
      {
         throw new MPXJException(MPXJException.INVALID_FORMAT);
      }

      switch (type)
      {
         case HEADER:
         {
            processHeader(record);
            break;
         }

         case TABLE:
         {
            m_currentTableName = record.get(1).toLowerCase();
            m_skipTable = !REQUIRED_TABLES.contains(m_currentTableName);
            if (m_skipTable)
            {
               m_currentTable = null;
            }
            else
            {
               m_currentTable = new LinkedList<Row>();
               m_tables.put(m_currentTableName, m_currentTable);
            }
            break;
         }

         case FIELDS:
         {
            if (m_skipTable)
            {
               m_currentFieldNames = null;
            }
            else
            {
               m_currentFieldNames = record.toArray(new String[record.size()]);
               for (int loop = 0; loop < m_currentFieldNames.length; loop++)
               {
                  m_currentFieldNames[loop] = m_currentFieldNames[loop].toLowerCase();
               }
            }
            break;
         }

         case DATA:
         {
            if (!m_skipTable)
            {
               Map<String, Object> map = new HashMap<String, Object>();
               for (int loop = 1; loop < record.size(); loop++)
               {
                  String fieldName = m_currentFieldNames[loop];
                  String fieldValue = record.get(loop);
                  XerFieldType fieldType = FIELD_TYPE_MAP.get(fieldName);
                  if (fieldType == null)
                  {
                     fieldType = XerFieldType.STRING;
                  }

                  Object objectValue;
                  if (fieldValue.length() == 0)
                  {
                     objectValue = null;
                  }
                  else
                  {
                     switch (fieldType)
                     {
                        case DATE:
                        {
                           try
                           {
                              objectValue = m_df.parseObject(fieldValue);
                           }

                           catch (ParseException ex)
                           {
                              objectValue = fieldValue;
                           }

                           break;
                        }

                        case CURRENCY:
                        case DOUBLE:
                        case DURATION:
                        {
                           try
                           {
                              objectValue = Double.valueOf(m_numberFormat.parse(fieldValue.trim()).doubleValue());
                           }

                           catch (ParseException ex)
                           {
                              objectValue = fieldValue;
                           }
                           break;
                        }

                        case INTEGER:
                        {
                           objectValue = Integer.valueOf(fieldValue.trim());
                           break;
                        }

                        default:
                        {
                           objectValue = fieldValue;
                           break;
                        }
                     }
                  }

                  map.put(fieldName, objectValue);
               }

               Row currentRow = new MapRow(map);
               m_currentTable.add(currentRow);

               //
               // Special case - we need to know the default currency format
               // ahead of time, so process each row as we get it so that
               // we can correctly parse currency values in later tables.
               //
               if (m_currentTableName.equals("currtype"))
               {
                  processCurrency(currentRow);
               }
            }
            break;
         }

         case END:
         {
            done = true;
            break;
         }

         default:
         {
            break;
         }
      }

      return done;
   }
387982
private void readCalendars(Storepoint phoenixProject)
   {
      Calendars calendars = phoenixProject.getCalendars();
      if (calendars != null)
      {
         for (Calendar calendar : calendars.getCalendar())
         {
            readCalendar(calendar);
         }

         ProjectCalendar defaultCalendar = m_projectFile.getCalendarByName(phoenixProject.getDefaultCalendar());
         if (defaultCalendar != null)
         {
            m_projectFile.getProjectProperties().setDefaultCalendarName(defaultCalendar.getName());
         }
      }
   }
82122
private void populateCalendarHours(Record record, ProjectCalendarHours hours) throws MPXJException
   {
      hours.setDay(Day.getInstance(NumberHelper.getInt(record.getInteger(0))));
      addDateRange(hours, record.getTime(1), record.getTime(2));
      addDateRange(hours, record.getTime(3), record.getTime(4));
      addDateRange(hours, record.getTime(5), record.getTime(6));
   }
130381
public static void writeRecords(final List<VcfSample> samples,
                                    final List<VcfRecord> records,
                                    final PrintWriter writer) {
        checkNotNull(samples);
        checkNotNull(records);
        checkNotNull(writer);

        for (VcfRecord record : records) {
            writeRecord(samples, record, writer);
        }
    }
575008
public void add(List<BatchCSVRecord> record) {
        if (records == null)
            records = new ArrayList<>();
        records.add(record);
    }
803427
private void processCalendars() throws SQLException
   {
      for (ResultSetRow row : getRows("SELECT * FROM MSP_CALENDARS WHERE PROJ_ID=?", m_projectID))
      {
         processCalendar(row);
      }

      updateBaseCalendarNames();

      processCalendarData(m_project.getCalendars());
   }