org.deidentifier.arx.io

## Class ImportConfigurationExcel

- java.lang.Object
- - org.deidentifier.arx.io.ImportConfiguration
  - - org.deidentifier.arx.io.ImportConfigurationFile
    - - org.deidentifier.arx.io.ImportConfigurationExcel

    public class ImportConfigurationExcel
    extends ImportConfigurationFile

Configuration describing an Excel file This is used to describe Excel files. Both file types (XLS and XLSX) are supported. The file type can either be detected automatically by the file extension, or alternatively can be set manually. Furthermore there is a sheet index `sheetIndex`, which describes which sheet within the file should be used.

Author:
  Karol Babioch, Fabian Prasser

### Nested Class Summary

Nested Classes
`static class` `ImportConfigurationExcel.ExcelFileTypes` Valid file types for Excel files XLS is the "old" Excel file type, XLSX is the "new" Excel file type.

### Constructor Summary

Constructors
Constructor and Description
`ImportConfigurationExcel(java.lang.String fileLocation, ImportConfigurationExcel.ExcelFileTypes excelFileType, int sheetIndex, boolean containsHeader)` Creates a new instance of this object.
`ImportConfigurationExcel(java.lang.String fileLocation, int sheetIndex, boolean containsHeader)` Creates a new instance of this object without specifying the file type The file type will be detected automatically using the file extension.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addColumn(ImportColumn column)` Adds a single column to import from This makes sure that only `ImportColumnExcel` can be added, otherwise an `IllegalArgumentException` will be thrown.
`boolean` `getContainsHeader()` Indicates whether there actually is a header A header is not necessarily mandatory.
`ImportConfigurationExcel.ExcelFileTypes` `getExcelFileType()`
`int` `getSheetIndex()`
`void` `setContainsHeader(boolean containsHeader)`
`void` `setExcelFileType(ImportConfigurationExcel.ExcelFileTypes excelFileType)`
`void` `setSheetIndex(int sheetIndex)`

### Methods inherited from class org.deidentifier.arx.io.ImportConfigurationFile

`getFileLocation, setFileLocation`

### Methods inherited from class org.deidentifier.arx.io.ImportConfiguration

`getColumns, isOptimizedLoading, setOptimizedLoading`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ImportConfigurationExcel

    public ImportConfigurationExcel(java.lang.String fileLocation,
                                    ImportConfigurationExcel.ExcelFileTypes excelFileType,
                                    int sheetIndex,
                                    boolean containsHeader)

Creates a new instance of this object.

Parameters:
  `fileLocation` - `ImportConfigurationFile.setFileLocation(String)`
  `excelFileType` - `setExcelFileType(ExcelFileTypes)`
  `sheetIndex` - `setSheetIndex(int)`
  `containsHeader` - `setContainsHeader(boolean)`

#### ImportConfigurationExcel

    public ImportConfigurationExcel(java.lang.String fileLocation,
                                    int sheetIndex,
                                    boolean containsHeader)

Creates a new instance of this object without specifying the file type The file type will be detected automatically using the file extension. By default "xlsx" is assumed. In case the file extension is "xls" the file type will be set to `ImportConfigurationExcel.ExcelFileTypes.XLS`.

Parameters:
  `fileLocation` - `ImportConfigurationFile.setFileLocation(String)`
  `sheetIndex` - `sheetIndex`
  `containsHeader` - `containsHeader`

### Method Detail

#### addColumn

    public void addColumn(ImportColumn column)

Adds a single column to import from This makes sure that only `ImportColumnExcel` can be added, otherwise an `IllegalArgumentException` will be thrown.

Specified by:
  `addColumn` in class `ImportConfiguration`
Parameters:
  `column` - A single column to import from, `ImportColumnExcel`

#### getContainsHeader

    public boolean getContainsHeader()

Indicates whether there actually is a header A header is not necessarily mandatory. This returns a boolean value that describes whether or not the configuration actually contains a header or not.

Returns:
  `containsHeader`

#### getExcelFileType

    public ImportConfigurationExcel.ExcelFileTypes getExcelFileType()

Returns:
  `#ExcelFileTypes`

#### getSheetIndex

    public int getSheetIndex()

Returns:
  `sheetIndex`

#### setContainsHeader

    public void setContainsHeader(boolean containsHeader)

Parameters:
  `containsHeader` - `containsHeader`

#### setExcelFileType

    public void setExcelFileType(ImportConfigurationExcel.ExcelFileTypes excelFileType)

Parameters:
  `excelFileType` - `#ExcelFileTypes`

#### setSheetIndex

    public void setSheetIndex(int sheetIndex)

Parameters:
  `sheetIndex` - `sheetIndex`