Package com.google.refine.model

Examples of com.google.refine.model.Column


    @Override
    public void apply(Project project) {
        project.rows.get(row).setCell(cellIndex, newCell);
       
        Column column = project.columnModel.getColumnByCellIndex(cellIndex);
        column.clearPrecomputes();
        ProjectManager.singleton.getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, column.getName());
    }
View Full Code Here


    @Override
    public void revert(Project project) {
        project.rows.get(row).setCell(cellIndex, oldCell);
       
        Column column = project.columnModel.getColumnByCellIndex(cellIndex);
        column.clearPrecomputes();
        ProjectManager.singleton.getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, column.getName());
    }
View Full Code Here

            for (CellChange cellChange : _cellChanges) {
                rows.get(cellChange.row).setCell(cellChange.cellIndex, cellChange.newCell);
            }
           
            if (_commonColumnName != null) {
                Column column = project.columnModel.getColumnByName(_commonColumnName);
                column.clearPrecomputes();
                ProjectManager.singleton.getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, _commonColumnName);
            }
           
            if (_updateRowContextDependencies) {
                project.update();
View Full Code Here

            for (CellChange cellChange : _cellChanges) {
                rows.get(cellChange.row).setCell(cellChange.cellIndex, cellChange.oldCell);
            }
           
            if (_commonColumnName != null) {
                Column column = project.columnModel.getColumnByName(_commonColumnName);
                column.clearPrecomputes();
                ProjectManager.singleton.getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, _commonColumnName);
            }
           
            if (_updateRowContextDependencies) {
                project.update();
View Full Code Here

           
            for (int i = 0; i < _columnNames.size(); i++) {
                String name = _columnNames.get(i);
                int cellIndex = _firstNewCellIndex + i;
               
                Column column = new Column(cellIndex, name);
               
                project.columnModel.columns.add(_columnIndex + 1 + i, column);
            }
           
            if (_removeOriginalColumn) {
View Full Code Here

        List<String>                columnNames = null;
        List<Integer>               rowIndices = null;
        List<List<Serializable>>    tuples = null;
        boolean                     removeOriginalColumn = false;

        Column                      column = null;
        int                         columnIndex = -1;
       
        int                         firstNewCellIndex = -1;
        List<Row>                   oldRows = null;
        List<Row>                   newRows = null;
View Full Code Here

        }

        @Override
        protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
            Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
            Column column = _project.columnModel.getColumnByCellIndex(cellIndex);
            if (column == null) {
                throw new Exception("No such column");
            }

            newCell = new Cell(
                value,
                cell != null ? cell.recon : null
            );

            String description =
                "Edit single cell on row " + (rowIndex + 1) +
                ", column " + column.getName();

            Change change = new CellChange(rowIndex, cellIndex, cell, newCell);

            return new HistoryEntry(
                historyEntryID, _project, description, null, change);
View Full Code Here

            }
            if (_oldColumnGroups == null) {
                _oldColumnGroups = new ArrayList<ColumnGroup>(project.columnModel.columnGroups);
            }
           
            Column column = project.columnModel.columns.remove(_oldColumnIndex);
            project.columnModel.columns.add(_newColumnIndex, column);
            project.columnModel.columnGroups.clear();
           
            project.update();
        }
View Full Code Here

    }

    @Override
    public void revert(Project project) {
        synchronized (project) {
            Column column = project.columnModel.columns.remove(_newColumnIndex);
            project.columnModel.columns.add(_oldColumnIndex, column);
           
            project.columnModel.columnGroups.clear();
            project.columnModel.columnGroups.addAll(_oldColumnGroups);
           
View Full Code Here

        writer.write("/ec/\n"); // end of change marker
    }
   
    static public Change load(LineNumberReader reader, Pool pool) throws Exception {
        int oldColumnIndex = -1;
        Column oldColumn = null;
        CellAtRow[] oldCells = null;
        List<ColumnGroup> oldColumnGroups = null;
       
        String line;
        while ((line = reader.readLine()) != null && !"/ec/".equals(line)) {
View Full Code Here

TOP

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

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.