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.api;
12  
13  import org.csveed.report.RowReport;
14  
15  /**
16   * The original header of the CSV file.
17   */
18  public interface Header extends Iterable<String> {
19  
20      /**
21       * Number of columns.
22       *
23       * @return the number of columns
24       */
25      int size();
26  
27      /**
28       * Gets the name of the header column with passed index.
29       *
30       * @param indexColumn
31       *            column index to find the name for
32       *
33       * @return name of the header column
34       */
35      String getName(int indexColumn);
36  
37      /**
38       * Gets the index column of the first column with a certain name.
39       *
40       * @param columnName
41       *            column name to find the index for
42       *
43       * @return index of the header column
44       */
45      int getIndex(String columnName);
46  
47      /**
48       * Generate an error report on the header row.
49       *
50       * @return error report on the header row
51       */
52      RowReport reportOnEndOfLine();
53  
54  }