当前位置: 首页>>代码示例>>Java>>正文


Java Project.update方法代码示例

本文整理汇总了Java中com.google.refine.model.Project.update方法的典型用法代码示例。如果您正苦于以下问题:Java Project.update方法的具体用法?Java Project.update怎么用?Java Project.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.refine.model.Project的用法示例。


在下文中一共展示了Project.update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    synchronized (project) {
        List<Row> rows = project.rows;
        
        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.getSingleton().getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, _commonColumnName);
        }
        
        if (_updateRowContextDependencies) {
            project.update();
        }
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:21,代码来源:MassCellChange.java

示例2: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        List<Row> rows = project.rows;
        
        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.getSingleton().getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, _commonColumnName);
        }
        
        if (_updateRowContextDependencies) {
            project.update();
        }
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:21,代码来源:MassCellChange.java

示例3: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    synchronized (project) {
        _oldColumnIndex = project.columnModel.getColumnIndexByName(_columnName);
        
        if (_oldColumnIndex < 0 || _newColumnIndex < 0 
                || _newColumnIndex > project.columnModel.getMaxCellIndex()) {
            throw new RuntimeException("Column index out of range");
        }
        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();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:21,代码来源:ColumnMoveChange.java

示例4: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    synchronized (project) {
        if (_newColumns == null) {
            _newColumns = new ArrayList<Column>();
            _oldColumns = new ArrayList<Column>(project.columnModel.columns);
            
            for (String n : _columnNames) {
                Column column = project.columnModel.getColumnByName(n);
                if (column != null) {
                    _newColumns.add(column);
                }
            }
            
            _oldColumnGroups = new ArrayList<ColumnGroup>(project.columnModel.columnGroups);
        }
        
        project.columnModel.columns.clear();
        project.columnModel.columns.addAll(_newColumns);
        project.columnModel.columnGroups.clear();

        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:25,代码来源:ColumnReorderChange.java

示例5: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        int count = project.rows.size();

        List<Row> newRows = project.rows;
        List<Row> oldRows = new ArrayList<Row>(count);

        for (int r = 0; r < count; r++) {
            oldRows.add(null);
        }

        for (int newIndex = 0; newIndex < count; newIndex++) {
            int oldIndex = _rowIndices.get(newIndex);
            Row row = newRows.get(newIndex);
            oldRows.set(oldIndex, row);
        }

        project.rows.clear();
        project.rows.addAll(oldRows);
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:24,代码来源:RowReorderChange.java

示例6: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    synchronized (project) {
        if (_oldColumnGroups == null) {
            _oldColumnGroups = new ArrayList<ColumnGroup>(project.columnModel.columnGroups);
        }
        if (_oldColumns == null) {
            _oldColumns = new ArrayList<Column>(project.columnModel.columns);
        }
        if (_oldRows == null) {
            _oldRows = new ArrayList<Row>(project.rows);
        }
        
        project.columnModel.columns.clear();
        project.columnModel.columns.addAll(_newColumns);
        project.columnModel.columnGroups.clear();
        
        project.rows.clear();
        project.rows.addAll(_newRows);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:24,代码来源:MassRowColumnChange.java

示例7: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        for (int i = 0; i < _rowIndices.size(); i++) {
            int r = _rowIndices.get(i);
            Row oldRow = _oldRows.get(i);
            
            project.rows.set(r, oldRow);
        }
        
        if (_removeOriginalColumn) {
            project.columnModel.columns.add(_columnIndex, _column);
        }
        
        for (int i = 0; i < _columnNames.size(); i++) {
            project.columnModel.columns.remove(_columnIndex + 1);
            ProjectManager.getSingleton().getInterProjectModel().flushJoinsInvolvingProjectColumn(project.id, _columnNames.get(i));
        }
        
        project.columnModel.columnGroups.clear();
        project.columnModel.columnGroups.addAll(_oldColumnGroups);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:26,代码来源:ColumnSplitChange.java

示例8: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        for (CellAtRow cell : _newCells) {
            Row row = project.rows.get(cell.row);
            row.setCell(_newCellIndex, null);
        }
        
        project.columnModel.columns.remove(_columnIndex);
        
        project.columnModel.columnGroups.clear();
        project.columnModel.columnGroups.addAll(_oldColumnGroups);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:17,代码来源:ColumnAdditionChange.java

示例9: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        project.columnModel.columns.add(_oldColumnIndex, _oldColumn);
        
        int cellIndex = _oldColumn.getCellIndex();
        for (CellAtRow cell : _oldCells) {
            project.rows.get(cell.row).cells.set(cellIndex, cell.cell);
        }
        
        project.columnModel.columnGroups.clear();
        project.columnModel.columnGroups.addAll(_oldColumnGroups);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:17,代码来源:ColumnRemovalChange.java

示例10: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(final Project project) {
    synchronized (project) {
        final int cellIndexes = createColumn(project);
        insertValues(project, cellIndexes);
        project.update();
    }
}
 
开发者ID:giTorto,项目名称:extraCTU-plugin,代码行数:9,代码来源:EstrazChange.java

示例11: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void revert(final Project project) {
    synchronized (project) {
        deleteRows(project);
        deleteColumns(project);
        project.update();
    }
}
 
开发者ID:giTorto,项目名称:extraCTU-plugin,代码行数:12,代码来源:EstrazChange.java

示例12: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@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);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:13,代码来源:ColumnMoveChange.java

示例13: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        project.columnModel.columns.clear();
        project.columnModel.columns.addAll(_oldColumns);
        
        project.columnModel.columnGroups.clear();
        project.columnModel.columnGroups.addAll(_oldColumnGroups);

        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:13,代码来源:ColumnReorderChange.java

示例14: apply

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    synchronized (project) {
        _oldRows = new ArrayList<Row>(project.rows);
        project.rows.clear();
        project.rows.addAll(_newRows);
        
        project.columnModel.clearPrecomputes();
        ProjectManager.getSingleton().getInterProjectModel().flushJoinsInvolvingProject(project.id);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:14,代码来源:MassRowChange.java

示例15: revert

import com.google.refine.model.Project; //导入方法依赖的package包/类
@Override
public void revert(Project project) {
    synchronized (project) {
        project.rows.clear();
        project.rows.addAll(_oldRows);
        
        project.update();
    }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:10,代码来源:MassRowChange.java


注:本文中的com.google.refine.model.Project.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。