View Javadoc
1   /*
2    * CSVeed (https://github.com/42BV/CSVeed)
3    *
4    * Copyright 2013-2023 CSVeed.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of The Apache Software License,
8    * Version 2.0 which accompanies this distribution, and is available at
9    * https://www.apache.org/licenses/LICENSE-2.0.txt
10   */
11  package org.csveed.row;
12  
13  import java.util.Collection;
14  
15  import org.csveed.api.Header;
16  import org.csveed.api.Row;
17  
18  /**
19   * The Interface RowWriter.
20   */
21  public interface RowWriter {
22  
23      /**
24       * Writes multiple rows with cells to the table.
25       *
26       * @param rows
27       *            two-dimensional string array with rows and cells within
28       */
29      void writeRows(String[][] rows);
30  
31      /**
32       * Writes multiples rows to the table.
33       *
34       * @param rows
35       *            collection of rows
36       */
37      void writeRows(Collection<Row> rows);
38  
39      /**
40       * Writes the cells of a table row as an individual row.
41       *
42       * @param cells
43       *            the individual cells of the row
44       *
45       * @return the row just written
46       */
47      Row writeRow(String[] cells);
48  
49      /**
50       * Writes a single row to the Writer.
51       *
52       * @param row
53       *            row to write to the Writer
54       */
55      void writeRow(Row row);
56  
57      /**
58       * Creates and sets the header of the table.
59       *
60       * @param headerNames
61       *            the individual cells of the header row
62       *
63       * @return the Header, created from the header names
64       */
65      Header writeHeader(String[] headerNames);
66  
67      /**
68       * Sets the header of the table.
69       *
70       * @param header
71       *            the header row
72       */
73      void writeHeader(Header header);
74  
75      /**
76       * The set of instructions for dealing with rows.
77       *
78       * @return row instructions
79       */
80      RowInstructions getRowInstructions();
81  
82  }