" cells in column " + column.getName();
}
@Override
protected RowVisitor createRowVisitor(Project project, List<CellChange> cellChanges, long historyEntryID) throws Exception {
Column column = project.columnModel.getColumnByName(_columnName);
return new RowVisitor() {
int cellIndex;
List<CellChange> cellChanges;
Map<Long, Recon> dupReconMap = new HashMap<Long, Recon>();
long historyEntryID;
public RowVisitor init(int cellIndex, List<CellChange> cellChanges, long historyEntryID) {
this.cellIndex = cellIndex;
this.cellChanges = cellChanges;
this.historyEntryID = historyEntryID;
return this;
}
@Override
public void start(Project project) {
// nothing to do
}
@Override
public void end(Project project) {
// nothing to do
}
@Override
public boolean visit(Project project, int rowIndex, Row row) {
Cell cell = row.getCell(cellIndex);
if (cell != null) {
long reconID = cell.recon != null ? cell.recon.id : 0;
Recon newRecon;
if (dupReconMap.containsKey(reconID)) {
newRecon = dupReconMap.get(reconID);
newRecon.judgmentBatchSize++;
} else {
newRecon = cell.recon != null ?
cell.recon.dup(historyEntryID) :
new Recon(
historyEntryID,
identifierSpace,
schemaSpace);
newRecon.match = match;
newRecon.matchRank = -1;
newRecon.judgment = Judgment.Matched;
newRecon.judgmentAction = "mass";
newRecon.judgmentBatchSize = 1;
dupReconMap.put(reconID, newRecon);
}
Cell newCell = new Cell(
cell.value,
newRecon
);
CellChange cellChange = new CellChange(rowIndex, cellIndex, cell, newCell);
cellChanges.add(cellChange);
}
return false;
}
}.init(column.getCellIndex(), cellChanges, historyEntryID);
}