View Javadoc
1   package org.csveed.row;
2   
3   import java.util.Collection;
4   
5   import org.csveed.api.Header;
6   import org.csveed.api.Row;
7   
8   public interface RowWriter {
9   
10      /**
11      * Writes multiple rows with cells to the table
12      * @param rows two-dimensional string array with rows and cells within
13      */
14      void writeRows(String[][] rows);
15  
16      /**
17      * Writes multiples rows to the table
18      * @param rows collection of rows
19      */
20      void writeRows(Collection<Row> rows);
21  
22      /**
23      * Writes the cells of a table row as an individual row
24      * @param cells the individual cells of the row
25      * @return the row just written
26      */
27      Row writeRow(String[] cells);
28  
29      /**
30      * Writes a single row to the Writer.
31      * @param row row to write to the Writer
32      */
33      void writeRow(Row row);
34  
35      /**
36      * Creates and sets the header of the table
37      * @param headerNames the individual cells of the header row
38      * @return the Header, created from the header names
39      */
40      Header writeHeader(String[] headerNames);
41  
42      /**
43      * Sets the header of the table
44      * @param header the header row
45      */
46      void writeHeader(Header header);
47  
48      /**
49      * The set of instructions for dealing with rows
50      * @return row instructions
51      */
52      RowInstructions getRowInstructions();
53  
54  }