Package com.google.refine.model

Examples of com.google.refine.model.Row


            _oldColumn = project.columnModel.columns.remove(_oldColumnIndex);
            _oldCells = new CellAtRow[project.rows.size()];
            int cellIndex = _oldColumn.getCellIndex();
            for (int i = 0; i < _oldCells.length; i++) {
                Row row = project.rows.get(i);
               
                Cell oldCell = null;
                if (cellIndex < row.cells.size()) {
                    oldCell = row.cells.get(cellIndex);
                }
                _oldCells[i] = new CellAtRow(i, oldCell);
               
                row.setCell(cellIndex, null);
            }
           
            project.update();
        }
    }
View Full Code Here


    }
   
    protected void switchRecons(Project project, Map<Long, Recon> reconMap) {
        synchronized (project) {
            for (int r = 0; r < project.rows.size(); r++) {
                Row row = project.rows.get(r);
               
                for (int c = 0; c < row.cells.size(); c++) {
                    Cell cell = row.cells.get(c);
                    if (cell != null && cell.recon != null) {
                        Recon recon = cell.recon;
                       
                        if (reconMap.containsKey(recon.id)) {
                            row.setCell(c, new Cell(cell.value, reconMap.get(recon.id)));
                        }
                    }
                }
            }
        }
View Full Code Here

    model = exporter.buildModel(project, engine, schema);
   
    assertEquals(project.rows.size(),3);
    assertEquals(project.columnModel.getColumnIndexByName("Advisor"),5);
   
    Row row = project.rows.get(0);
    assertEquals(row.cells.get(5).value,"");
    row = project.rows.get(1);
    assertEquals(row.cells.get(5).value,"Tim Finin");
    row = project.rows.get(2);
    assertEquals(row.cells.get(5).value,"Anupam Joshi");
View Full Code Here

  }
 
  static Project buildTheSampleProject(RdfSchema schema)throws Exception{
    Project project = new Project();
    buildColumnModel(project);
    Row row1= new Row(6);
    row1.cells.add(new Cell("Tim Finin",null));
    row1.cells.add(new Cell("finin@umbc.edu",null));
    row1.cells.add(new Cell("329",null));
    row1.cells.add(new Cell("Yes",null));
    row1.cells.add(new Cell("$10",null));
    row1.cells.add(new Cell("",null));
    project.rows.add(row1);
   
    Row row2= new Row(6);
    row2.cells.add(new Cell("Lushan Han",null));
    row2.cells.add(new Cell("lushan@umbc.edu",null));
    row2.cells.add(new Cell("377",null));
    row2.cells.add(new Cell("No",null));
    row2.cells.add(new Cell("",null));
    row2.cells.add(new Cell("Tim Finin",null));
    project.rows.add(row2);
   
    Row row3= new Row(6);
    row3.cells.add(new Cell("Wenjia Li",null));
    row3.cells.add(new Cell("wenjia@umbc.edu",null));
    row3.cells.add(new Cell("377",null));
    row3.cells.add(new Cell("No",null));
    row3.cells.add(new Cell("",null));
View Full Code Here

    model = exporter.buildModel(project, engine, schema);
   
    assertEquals(project.rows.size(),3);
    assertEquals(project.columnModel.getColumnIndexByName("Advisor"),5);
   
    Row row = project.rows.get(0);
    assertEquals(row.cells.get(5).value,"");
    row = project.rows.get(1);
    assertEquals(row.cells.get(5).value,"Tim Finin");
    row = project.rows.get(2);
    assertEquals(row.cells.get(5).value,"Anupam Joshi");
View Full Code Here

    project.columnModel.addColumn(17, new Column(17,"Grade OK"), true);
  }
  void buildTheSampleProject()throws Exception{
    project = new Project();
    buildColumnModel();
    Row row1 = new Row(17);
    row1.cells.add(new Cell("101198", null));
    row1.cells.add(new Cell("Paula Freedman", null));
    row1.cells.add(new Cell("G5", null));
    row1.cells.add(new Cell("Deputy Director - International Group", null));
    row1.cells.add(new Cell("tbc", null));
    row1.cells.add(new Cell("BIS", null));
    row1.cells.add(new Cell("BIS", null));
    row1.cells.add(new Cell("UK Trade and Investment", null));
    row1.cells.add(new Cell("020 7215 4320", null));
    row1.cells.add(new Cell("paula.freedman@ukti.gsi.gov.uk", null));
    row1.cells.add(new Cell("127460", null));
    row1.cells.add(new Cell("Susan Haird", null));
    row1.cells.add(new Cell("Senior Civil Service.Pay Band 1", null));
    row1.cells.add(new Cell("Active Assignment", null));
    row1.cells.add(new Cell(null,null));
    row1.cells.add(new Cell(true, null));
    row1.cells.add(new Cell(true, null));
    row1.cells.add(new Cell(false, null));
   
    project.rows.add(row1);
   
    /*
     * 111912|  Bryan Welch|  G5|  Deputy Director - Legal Services Directorate B|  tbc|  BIS|  BIS|  Legal Services Group|  020 7215 3181|  bryan.welch@bis.gsi.gov.uk|  901575|  Stephen Braviner-Roman|  Senior Civil Service.Pay Band 1|  Active Assignment    TRUE  TRUE  FALSE
     */
    Row row2 = new Row(17);
    row2.cells.add(new Cell("111912", null));
    row2.cells.add(new Cell("Bryan Welch", null));
    row2.cells.add(new Cell("G5", null));
    row2.cells.add(new Cell("Deputy Director - Legal Services Directorate B", null));
    row2.cells.add(new Cell("tbc", null));
View Full Code Here

            for (int i = 0; i < length; i++) {
                Object result = null;
                absolutes[i] = null;
                int rowIndex = rowIndices.getInt(i);
                if (rowIndex >= 0 && rowIndex < project.rows.size()) {
                    Row row = project.rows.get(rowIndex);
                    result = Util.evaluateExpression(project, expression, columnName, row, rowIndex);
                }
               
                if (result == null) {
                    writer.value(null);
View Full Code Here

            writer.key("results"); writer.array();
            for (int i = 0; i < length; i++) {
                Object result = null;
                int rowIndex = rowIndices.getInt(i);
                if (rowIndex >= 0 && rowIndex < project.rows.size()) {
                    Row row = project.rows.get(rowIndex);
                    result = Util.evaluateExpression(project, expression, columnName, row, rowIndex);
                }
               
                if (result == null) {
                    writer.value(null);
View Full Code Here

TOP

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

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.