當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractOperation類代碼示例

本文整理匯總了Java中com.google.refine.model.AbstractOperation的典型用法代碼示例。如果您正苦於以下問題:Java AbstractOperation類的具體用法?Java AbstractOperation怎麽用?Java AbstractOperation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AbstractOperation類屬於com.google.refine.model包,在下文中一共展示了AbstractOperation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyTransform

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
private void applyTransform(Project project, JSONArray transform)
        throws JSONException {

    for (int i = 0; i < transform.length(); i++) {
        AbstractOperation operation = OperationRegistry.reconstruct(
                project, transform.getJSONObject(i));

        if (operation != null) {
            try {
                Process process = operation.createProcess(project,
                        new Properties());

                project.processManager.queueProcess(process);
            } catch (Exception ex) {
                fLogger.error("Error applying operation.", ex);
            }
        } else {
            fLogger.warn("Skipping unknown operation " + operation);
        }
    }
}
 
開發者ID:fusepoolP3,項目名稱:p3-batchrefine,代碼行數:22,代碼來源:TransformEngineImpl.java

示例2: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception {
    final String columnName = request.getParameter("column");
    logger.debug("Starting createOperation");
    final String parametri = request.getParameter("services");
    final String prefisso = request.getParameter("prefix");
    final String country = request.getParameter("country");
    final Column column = project.columnModel.getColumnByName(columnName);


    try {
        return new EstrazOperation(column, parametri,prefisso,country, getEngineConfig(request));
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return null;
}
 
開發者ID:giTorto,項目名稱:extraCTU-plugin,代碼行數:18,代碼來源:ExtractionCommand.java

示例3: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String keyColumnName = request.getParameter("keyColumnName");
        String valueColumnName = request.getParameter("valueColumnName");
        String noteColumnName = request.getParameter("noteColumnName");
        
        AbstractOperation op = new KeyValueColumnizeOperation(
            keyColumnName, valueColumnName, noteColumnName);
        
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:22,代碼來源:KeyValueColumnizeCommand.java

示例4: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        String keyColumnName = request.getParameter("keyColumnName");
        String separator = request.getParameter("separator");
        String mode = request.getParameter("mode");
        
        AbstractOperation op = new MultiValuedCellSplitOperation(columnName, keyColumnName, separator, mode);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:21,代碼來源:SplitMultiValueCellsCommand.java

示例5: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        String keyColumnName = request.getParameter("keyColumnName");
        String separator = request.getParameter("separator");
        
        AbstractOperation op = new MultiValuedCellJoinOperation(columnName, keyColumnName, separator);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:20,代碼來源:JoinMultiValueCellsCommand.java

示例6: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        int rowCount = Integer.parseInt(request.getParameter("rowCount"));
        
        AbstractOperation op = new TransposeRowsIntoColumnsOperation(
                columnName, rowCount);
        
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:21,代碼來源:TransposeRowsIntoColumnsCommand.java

示例7: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {
    
    String columnName = request.getParameter("columnName");
    String expression = request.getParameter("expression");
    String onError = request.getParameter("onError");
    boolean repeat = "true".equals(request.getParameter("repeat"));
    
    int repeatCount = 10;
    String repeatCountString = request.getParameter("repeatCount");
    try {
        repeatCount = Math.max(Math.min(Integer.parseInt(repeatCountString), 10), 0);
    } catch (Exception e) {
    }
    
    return new TextTransformOperation(
        engineConfig, 
        columnName, 
        expression, 
        TextTransformOperation.stringToOnError(onError),
        repeat,
        repeatCount
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:26,代碼來源:TextTransformCommand.java

示例8: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {
    
    String starredString = request.getParameter("starred");
    if (starredString != null) {
        boolean starred = "true".endsWith(starredString);
        
        return new RowStarOperation(engineConfig, starred);
    }
    
    String flaggedString = request.getParameter("flagged");
    if (flaggedString != null) {
        boolean flagged = "true".endsWith(flaggedString);
        
        return new RowFlagOperation(engineConfig, flagged);
    }
    return null;
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:20,代碼來源:AnnotateRowsCommand.java

示例9: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {

    String mode = request.getParameter("mode");
    JSONObject sorting = null;

    try{
        String json = request.getParameter("sorting");

        sorting = (json == null) ? null : ParsingUtilities.evaluateJsonStringToObject(json);
    } catch (JSONException e) {
        // ignore
    }

    return new RowReorderOperation(Engine.stringToMode(mode), sorting);
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:18,代碼來源:ReorderRowsCommand.java

示例10: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {
    
    String baseColumnName = request.getParameter("baseColumnName");
    String expression = request.getParameter("expression");
    String newColumnName = request.getParameter("newColumnName");
    int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex"));
    String onError = request.getParameter("onError");
    
    return new ColumnAdditionOperation(
        engineConfig, 
        baseColumnName, 
        expression,
        TextTransformOperation.stringToOnError(onError),
        newColumnName,
        columnInsertIndex
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:20,代碼來源:AddColumnCommand.java

示例11: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        
        AbstractOperation op = new ColumnRemovalOperation(columnName);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:18,代碼來源:RemoveColumnCommand.java

示例12: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        int index = Integer.parseInt(request.getParameter("index"));
        
        AbstractOperation op = new ColumnMoveOperation(columnName, index);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:19,代碼來源:MoveColumnCommand.java

示例13: doPost

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String oldColumnName = request.getParameter("oldColumnName");
        String newColumnName = request.getParameter("newColumnName");
        
        AbstractOperation op = new ColumnRenameOperation(oldColumnName, newColumnName);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:19,代碼來源:RenameColumnCommand.java

示例14: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {
    
    String baseColumnName = request.getParameter("baseColumnName");
    String urlExpression = request.getParameter("urlExpression");
    String newColumnName = request.getParameter("newColumnName");
    int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex"));
    int delay = Integer.parseInt(request.getParameter("delay"));
    String onError = request.getParameter("onError");
    
    return new ColumnAdditionByFetchingURLsOperation(
        engineConfig, 
        baseColumnName, 
        urlExpression,
        TextTransformOperation.stringToOnError(onError),
        newColumnName,
        columnInsertIndex,
        delay
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:22,代碼來源:AddColumnByFetchingURLsCommand.java

示例15: createOperation

import com.google.refine.model.AbstractOperation; //導入依賴的package包/類
@Override
protected AbstractOperation createOperation(Project project,
        HttpServletRequest request, JSONObject engineConfig) throws Exception {
    
    String columnName = request.getParameter("columnName");
    ReconCandidate match = new ReconCandidate(
        request.getParameter("topicID"),
        request.getParameter("topicName"),
        request.getParameter("types").split(","),
        100
    );
    
    return new ReconMatchSpecificTopicOperation(
        engineConfig, 
        columnName, 
        match,
        request.getParameter("identifierSpace"),
        request.getParameter("schemaSpace")
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:21,代碼來源:ReconMatchSpecificTopicCommand.java


注:本文中的com.google.refine.model.AbstractOperation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。