Package com.google.refine.model

Examples of com.google.refine.model.Cell


                }
               
                @Override
                public boolean visit(Project project, int rowIndex, Row row) {
                    if (_cellIndex < row.cells.size()) {
                        Cell cell = row.cells.get(_cellIndex);
                        if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
                            _entries.add(new ReconEntry(rowIndex, cell));
                        }
                    }
                    return false;
View Full Code Here


                        recon = _reconConfig.createNewRecon(_historyEntryID);
                    }
                    recon.judgmentBatchSize = entries.size();
                   
                    for (ReconEntry entry : entries) {
                        Cell oldCell = entry.cell;
                        Cell newCell = new Cell(oldCell.value, recon);
                       
                        CellChange cellChange = new CellChange(
                            entry.rowIndex,
                            _cellIndex,
                            oldCell,
View Full Code Here

            // nothing to do
        }
       
        @Override
        public boolean visit(Project project, int rowIndex, Row row) {
            Cell cell = row.getCell(_colindex);
            if (cell != null && cell.value != null) {
                Object v = cell.value;
                String s = (v instanceof String) ? ((String) v) : v.toString().intern();
                _clusterer.populate(s);
                count(s);
View Full Code Here

            }
           
            // First value goes into the same row
            {
                Row firstNewRow = oldRow.dup();
                firstNewRow.setCell(cellIndex, new Cell(values[0].trim(), null));
               
                newRows.add(firstNewRow);
            }
           
            int r2 = r + 1;
            for (int v = 1; v < values.length; v++) {
                Cell newCell = new Cell(values[v].trim(), null);
               
                if (r2 < project.rows.size()) {
                    Row oldRow2 = project.rows.get(r2);
                    if (oldRow2.isCellBlank(cellIndex) &&
                        oldRow2.isCellBlank(keyCellIndex)) {
View Full Code Here

                // nothing to do
            }
           
            @Override
            public boolean visit(Project project, int rowIndex, Row row) {
                Cell cell = row.getCell(cellIndex);
                if (cell != null && cell.recon != null) {
                    Recon newRecon = null;
                    if (!_clearData) {
                        if (dupReconMap.containsKey(cell.recon.id)) {
                            newRecon = dupReconMap.get(cell.recon.id);
                            newRecon.judgmentBatchSize++;
                        } else {
                            newRecon = cell.recon.dup(historyEntryID);
                            newRecon.match = null;
                            newRecon.matchRank = -1;
                            newRecon.judgment = Judgment.None;
                            newRecon.judgmentAction = "mass";
                            newRecon.judgmentBatchSize = 1;
                           
                            dupReconMap.put(cell.recon.id, newRecon);
                        }
                    }
                   
                    Cell newCell = new Cell(cell.value, newRecon);
                   
                    CellChange cellChange = new CellChange(rowIndex, cellIndex, cell, newCell);
                    cellChanges.add(cellChange);
                }
                return false;
View Full Code Here

                        int contextRowIndex = cd.rowIndex;
                        int contextCellIndex = cd.cellIndex;

                        if (contextRowIndex >= 0 && contextRowIndex < oldRows.size()) {
                            Row contextRow = oldRows.get(contextRowIndex);
                            Cell contextCell = contextRow.getCell(contextCellIndex);

                            newRow.setCell(contextCellIndex, contextCell);
                        }
                    }
                }
View Full Code Here

                // nothing to do
            }
           
            @Override
            public boolean visit(Project project, int rowIndex, Row row) {
                Cell cell = row.getCell(cellIndex);
                if (cell != null) {
                    Recon recon = null;
                    if (_shareNewTopics) {
                        String s = cell.value == null ? "" : cell.value.toString();
                        if (sharedRecons.containsKey(s)) {
                            recon = sharedRecons.get(s);
                            recon.judgmentBatchSize++;
                        } else {
                            recon = new Recon(historyEntryID, null, null);
                            recon.judgment = Judgment.New;
                            recon.judgmentBatchSize = 1;
                            recon.judgmentAction = "mass";
                           
                            sharedRecons.put(s, recon);
                        }
                    } else {
                        recon = cell.recon == null ? new Recon(historyEntryID, null, null) : cell.recon.dup(historyEntryID);
                        recon.match = null;
                        recon.matchRank = -1;
                        recon.judgment = Judgment.New;
                        recon.judgmentBatchSize = 1;
                        recon.judgmentAction = "mass";
                    }
                   
                    Cell newCell = new Cell(cell.value, recon);
                   
                    CellChange cellChange = new CellChange(rowIndex, cellIndex, cell, newCell);
                    cellChanges.add(cellChange);
                }
                return false;
View Full Code Here

    @Override
    public Object eval(
            Project project, int rowIndex, Row row, Properties bindings) {
       
        Cell cell = row.getCell(_cellIndex);

        ExpressionUtils.bind(bindings, row, rowIndex, _columnName, cell);
       
        return _eval.evaluate(bindings);
    }
View Full Code Here

    }
   
    static public CellAtRow load(String s, Pool pool) throws Exception {
        int semicolon = s.indexOf(';');
        int row = Integer.parseInt(s.substring(0, semicolon));
        Cell cell = semicolon < s.length() - 1 ? Cell.loadStreaming(s.substring(semicolon + 1), pool) : null;
       
        return new CellAtRow(row, cell);
    }
View Full Code Here

    }
   
    static public CellChange load(LineNumberReader reader, Pool pool) throws Exception {
        int row = -1;
        int cellIndex = -1;
        Cell oldCell = null;
        Cell newCell = null;
       
        String line;
        while ((line = reader.readLine()) != null && !"/ec/".equals(line)) {
            int equal = line.indexOf('=');
            CharSequence field = line.subSequence(0, equal);
View Full Code Here

TOP

Related Classes of com.google.refine.model.Cell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.