コード例 #1
0
 private void mergeFields(Row row, Row requiredRow) {
   for (Field field : requiredRow.getFields().toFieldList()) {
     if (!row.containsField(field.getName())) {
       row.getLocalDefinedFields().put(new Field(field));
     }
   }
   LocationUtil.mergeLocationPointers(row.getLocationPointer(), requiredRow.getLocationPointer());
 }
コード例 #2
0
 private void mergeRequiredRow(Table destinationTable, Row requiredRow) {
   boolean thereIsAMerge = false;
   for (Row existingRow : destinationTable.getRows()) {
     if (checker.matchAllFields(requiredRow, existingRow)) {
       LocationUtil.mergeLocationPointers(
           existingRow.getLocationPointer(), requiredRow.getLocationPointer());
       thereIsAMerge = true;
     }
   }
   if (!thereIsAMerge) {
     if (requiredRow.getUniqueKey() == null) {
       destinationTable.addRow(requiredRow);
     } else {
       mergeRequiredRowWithUniqueKey(destinationTable, requiredRow);
     }
   }
 }