Package com.google.refine.model

Examples of com.google.refine.model.Cell


        _cellIndex = cellIndex;
    }

    @Override
    public boolean filterRow(Project project, int rowIndex, Row row) {
        Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
       
        Properties bindings = ExpressionUtils.createBindings(project);
        ExpressionUtils.bind(bindings, row, rowIndex, _columnName, cell);
       
        Object value = _evaluable.evaluate(bindings);
View Full Code Here


        _y_cellIndex = y_cellIndex;
    }

    @Override
    public boolean filterRow(Project project, int rowIndex, Row row) {
        Cell x_cell = _x_cellIndex < 0 ? null : row.getCell(_x_cellIndex);
        Properties x_bindings = ExpressionUtils.createBindings(project);
        ExpressionUtils.bind(x_bindings, row, rowIndex, _x_columnName, x_cell);
        Object x_value = _x_evaluable.evaluate(x_bindings);
       
        Cell y_cell = _y_cellIndex < 0 ? null : row.getCell(_y_cellIndex);
        Properties y_bindings = ExpressionUtils.createBindings(project);
        ExpressionUtils.bind(y_bindings, row, rowIndex, _y_columnName, y_cell);
        Object y_value = _y_evaluable.evaluate(y_bindings);

        if (x_value != null && y_value != null) {
View Full Code Here

                internalInvertedFilterRow(project, rowIndex, row) :
                internalFilterRow(project, rowIndex, row);
    }
   
    public boolean internalFilterRow(Project project, int rowIndex, Row row) {
        Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
       
        Properties bindings = ExpressionUtils.createBindings(project);
        ExpressionUtils.bind(bindings, row, rowIndex, _columnName, cell);
       
        Object value = _evaluable.evaluate(bindings);
View Full Code Here

       
        return testValue(value);
    }
   
    public boolean internalInvertedFilterRow(Project project, int rowIndex, Row row) {
        Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
       
        Properties bindings = ExpressionUtils.createBindings(project);
        ExpressionUtils.bind(bindings, row, rowIndex, _columnName, cell);
       
        Object value = _evaluable.evaluate(bindings);
View Full Code Here

            this.schemaSpace = schemaSpace;
        }

        @Override
        protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
            Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
            if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) {
                throw new Exception("Cell is blank or error");
            }

            Column column = _project.columnModel.getColumnByCellIndex(cellIndex);
            if (column == null) {
                throw new Exception("No such column");
            }

            Judgment oldJudgment = cell.recon == null ? Judgment.None : cell.recon.judgment;

            newCell = new Cell(
                cell.value,
                cell.recon == null ? new Recon(historyEntryID, identifierSpace, schemaSpace) : cell.recon.dup(historyEntryID)
            );

            String cellDescription =
View Full Code Here

                    Object result = null;
                   
                    int rowIndex = rowIndices.getInt(i);
                    if (rowIndex >= 0 && rowIndex < project.rows.size()) {
                        Row row = project.rows.get(rowIndex);
                        Cell cell = row.getCell(cellIndex);
                           
                        try {
                            ExpressionUtils.bind(bindings, row, rowIndex, columnName, cell);
                            result = eval.evaluate(bindings);
                           
                            if (repeat) {
                                for (int r = 0; r < repeatCount && ExpressionUtils.isStorable(result); r++) {
                                    Cell newCell = new Cell((Serializable) result, (cell != null) ? cell.recon : null);
                                    ExpressionUtils.bind(bindings, row, rowIndex, columnName, newCell);
                                   
                                    Object newResult = eval.evaluate(bindings);
                                    if (ExpressionUtils.isError(newResult)) {
                                        break;
View Full Code Here

            processValue(value, rowIndex);
        }
    }

    protected Object evalRow(Project project, int rowIndex, Row row, Properties bindings) {
        Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);

        ExpressionUtils.bind(bindings, row, rowIndex, _columnName, cell);

        return _evaluable.evaluate(bindings);
    }
View Full Code Here

                    jsonWriter.array();
                   
                    for (ColumnDetail c : columnDetails) {
                        int detailCellIndex = project.columnModel.getColumnByName(c.columnName).getCellIndex();
                       
                        Cell cell2 = row.getCell(detailCellIndex);
                        if (cell2 == null || !ExpressionUtils.isNonBlankData(cell2.value)) {
                            int cellIndex = project.columnModel.getColumnByName(columnName).getCellIndex();
                           
                            RowDependency rd = project.recordModel.getRowDependency(rowIndex);
                            if (rd != null && rd.cellDependencies != null) {
View Full Code Here

                    List<Object> cells = new ArrayList<Object>();
                    OdfTableRow row = table.getRowByIndex(nextRow++);
                    if (row != null) {
                        int lastCell = row.getCellCount();
                        for (int cellIndex = 0; cellIndex <= lastCell; cellIndex++) {
                            Cell cell = null;

                            OdfTableCell sourceCell = row.getCellByIndex(cellIndex);
                            if (sourceCell != null) {
                                cell = extractCell(sourceCell, reconMap);
                            }
View Full Code Here

                            reconMap.put(id, recon);
                        }
                    }
                }
            }
            return new Cell(value, recon);
        } else {
            return null;
        }
    }
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.