org.deidentifier.arx.io

## Class ImportAdapterCSV

- java.lang.Object
- - org.deidentifier.arx.io.ImportAdapter
  - - org.deidentifier.arx.io.ImportAdapterCSV

All Implemented Interfaces:
  java.util.Iterator<java.lang.String[]>

    public class ImportAdapterCSV
    extends ImportAdapter

Import adapter for CSV files This adapter can import data from a CSV file. The CSV file itself is described by an appropriate `ImportConfigurationCSV` object. Internally this class makes use of `CSVDataInput` to read the CSV file on a line by line basis. A counting input stream (@link CountingInputStream} is used in order for {@link #getProgress() to be able to return the percentage of data that has already been processed.

Author:
  Karol Babioch, Fabian Prasser

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Integer` `getLength()` Returns the number of records, if available, null otherwise
`int` `getProgress()` Returns the percentage of data that has already been returned This divides the amount of bytes that have already been read by the amount of total bytes and casts the result into a percentage.
`boolean` `hasNext()` Indicates whether there is another element to return This returns true when the CSV file has another line, which would be assigned to `row` during the last iteration of `next()`.
`java.lang.String[]` `next()` Returns the next row The returned element is sorted as defined by `ImportColumn#index` and contains as many elements as there are columns selected to import from `ImportAdapter.indexes`.
`void` `remove()` Dummy.

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

`create, getConfig, getHeader`

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

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

### Methods inherited from interface java.util.Iterator

`forEachRemaining`

### Method Detail

#### getLength

    public java.lang.Integer getLength()

Description copied from class: `ImportAdapter`
Returns the number of records, if available, null otherwise

Overrides:
  `getLength` in class `ImportAdapter`
Returns:

#### getProgress

    public int getProgress()

Returns the percentage of data that has already been returned This divides the amount of bytes that have already been read by the amount of total bytes and casts the result into a percentage.

Specified by:
  `getProgress` in class `ImportAdapter`
Returns:

#### hasNext

    public boolean hasNext()

Indicates whether there is another element to return This returns true when the CSV file has another line, which would be assigned to `row` during the last iteration of `next()`.

Returns:

#### next

    public java.lang.String[] next()

Returns the next row The returned element is sorted as defined by `ImportColumn#index` and contains as many elements as there are columns selected to import from `ImportAdapter.indexes`. The first row will always contain the names of the columns. `headerReturned` is used to keep track of that.

Returns:

#### remove

    public void remove()

Dummy.