Package com.google.refine.model

Examples of com.google.refine.model.Cell


    }

    @Test
    public void saveRowWithRecordIndex() {
        Row row = new Row(5);
        row.setCell(0, new Cell("I'm not empty", null));
        when(options.containsKey("rowIndex")).thenReturn(true);
        when(options.get("rowIndex")).thenReturn(0);
        when(options.containsKey("recordIndex")).thenReturn(true);
        when(options.get("recordIndex")).thenReturn(1);
        row.save(writer, options);
View Full Code Here


    }

    @Test
    public void toStringTest() {
        Row row = new Row(5);
        row.setCell(0, new Cell(1, null));
        row.setCell(1, new Cell(2, null));
        row.setCell(2, new Cell(3, null));
        row.setCell(3, new Cell(4, null));
        row.setCell(4, new Cell(5, null));
        Assert.assertEquals(row.toString(), "1,2,3,4,5,");
    }
View Full Code Here

    }

    @Test
    public void nonBlankCell() {
        Row row = new Row(5);
        row.setCell(0, new Cell("I'm not empty", null));
        Assert.assertFalse(row.isCellBlank(0));
        row.setCell(3, new Cell("I'm not empty", null));
        Assert.assertFalse(row.isCellBlank(3));
    }
View Full Code Here

        CreateColumns(noOfColumns);

        for(int i = 0; i < noOfRows; i++){
            Row row = new Row(noOfColumns);
            for(int j = 0; j < noOfColumns; j++){
                row.cells.add(new Cell("row" + i + "cell" + j, null));
            }
            project.rows.add(row);
        }
    }
View Full Code Here

    @Test
    public void exportCsvWithLineBreaks(){
        CreateGrid(3,3);

        project.rows.get(1).cells.set(1, new Cell("line\n\n\nbreak", null));
        try {
            SUT.export(project, options, engine, writer);
        } catch (IOException e) {
            Assert.fail();
        }
View Full Code Here

    @Test
    public void exportCsvWithComma(){
        CreateGrid(3,3);

        project.rows.get(1).cells.set(1, new Cell("with, comma", null));
        try {
            SUT.export(project, options, engine, writer);
        } catch (IOException e) {
            Assert.fail();
        }
View Full Code Here

    @Test
    public void exportCsvWithQuote(){
        CreateGrid(3,3);

        project.rows.get(1).cells.set(1, new Cell("line has \"quote\"", null));
        try {
            SUT.export(project, options, engine, writer);
        } catch (IOException e) {
            Assert.fail();
        }
View Full Code Here

        CreateGrid(1,2);
        Calendar calendar = Calendar.getInstance();
        Date date = new Date();

        when(options.getProperty("printColumnHeader")).thenReturn("false");
        project.rows.get(0).cells.set(0, new Cell(calendar, null));
        project.rows.get(0).cells.set(1, new Cell(date, null));

        try {
            SUT.export(project, options, engine, writer);
        } catch (IOException e) {
            Assert.fail();
View Full Code Here

        CreateColumns(noOfColumns);

        for(int i = 0; i < noOfRows; i++){
            Row row = new Row(noOfColumns);
            for(int j = 0; j < noOfColumns; j++){
                row.cells.add(new Cell("row" + i + "cell" + j, null));
            }
            project.rows.add(row);
        }
    }
View Full Code Here

                                        ImporterUtilities.parseCellValue((String) value) : (String) value;
                                } else {
                                    storedValue = ExpressionUtils.wrapStorable(value);
                                }
                               
                                row.setCell(column.getCellIndex(), new Cell(storedValue, null));
                                rowHasData = true;
                            } else if (!storeBlankCellsAsNulls) {
                                row.setCell(column.getCellIndex(), new Cell("", null));
                            } else {
                                row.setCell(column.getCellIndex(), null);
                            }
                        }
                       
                        if (rowHasData || storeBlankRows) {
                            if (includeFileSources) {
                                row.setCell(
                                    project.columnModel.getColumnByName(fileNameColumnName).getCellIndex(),
                                    new Cell(fileSource, null));
                            }
                            project.rows.add(row);
                        }
                       
                        if (limit2 > 0 && project.rows.size() >= limit2) {
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.