org.apache.trevni

## Class ColumnFileReader

- java.lang.Object
- - org.apache.trevni.ColumnFileReader

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class ColumnFileReader
    extends Object
    implements Closeable

Reads data from a column file.

### Constructor Summary

Constructors
Constructor and Description
`ColumnFileReader(File file)` Construct reading from the named file.
`ColumnFileReader(Input file)` Construct reading from the provided input.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`long` `getColumnCount()` Return the number of columns in this file.
`ColumnMetaData[]` `getColumnMetaData()` Return all columns' metadata.
`ColumnMetaData` `getColumnMetaData(int number)` Return a column's metadata.
`ColumnMetaData` `getColumnMetaData(String name)` Return a column's metadata.
`ColumnFileMetaData` `getMetaData()` Return this file's metadata.
`List<ColumnMetaData>` `getRoots()` Return root columns' metadata.
`long` `getRowCount()` Return the number of rows in this file.
`<T extends Comparable> ColumnValues<T>` `getValues(int column)` Return an iterator over values in a column.
`<T extends Comparable> ColumnValues<T>` `getValues(String columnName)` Return an iterator over values in the named column.

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

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

### Constructor Detail

#### ColumnFileReader

    public ColumnFileReader(File file)
                     throws IOException

Construct reading from the named file.

Throws:
  `IOException`

#### ColumnFileReader

    public ColumnFileReader(Input file)
                     throws IOException

Construct reading from the provided input.

Throws:
  `IOException`

### Method Detail

#### getRowCount

    public long getRowCount()

Return the number of rows in this file.

#### getColumnCount

    public long getColumnCount()

Return the number of columns in this file.

#### getMetaData

    public ColumnFileMetaData getMetaData()

Return this file's metadata.

#### getColumnMetaData

    public ColumnMetaData[] getColumnMetaData()

Return all columns' metadata.

#### getRoots

    public List<ColumnMetaData> getRoots()

Return root columns' metadata. Roots are columns that have no parent.

#### getColumnMetaData

    public ColumnMetaData getColumnMetaData(int number)

Return a column's metadata.

#### getColumnMetaData

    public ColumnMetaData getColumnMetaData(String name)

Return a column's metadata.

#### getValues

    public <T extends Comparable> ColumnValues<T> getValues(String columnName)
                                                     throws IOException

Return an iterator over values in the named column.

Throws:
  `IOException`

#### getValues

    public <T extends Comparable> ColumnValues<T> getValues(int column)
                                                     throws IOException

Return an iterator over values in a column.

Throws:
  `IOException`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IOException`