com.mapinfo.midev.dp.shape

## Class ShapeDataSource

- java.lang.Object
- - com.mapinfo.midev.dp.shape.ShapeDataSource

All Implemented Interfaces:
  IDataSource, Iterable

    public final class ShapeDataSource
    extends Object
    implements IDataSource

A datasource for ESRI shape files. Tables opened by this datasource will be cached until the disposal of this instance with `ShapeDataSource.close()`. Once a table is cached, subsequent calls to `ShapeDataSource.openTable(ITableDefinition)` with the same table definition will return the same datasource table instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Closes this datasource and frees up the datasource table cache.
`IDataSourceDefinition` `getDefinition()` Gets the datasource definition for this datasource.
`boolean` `isClosed()` Indicates if this datasource is closed.
`Iterator` `iterator()` Returns an iterator for the tables cached by this datasource.
`IDataSourceTable` `openTable(ITableDefinition tableDefinition)` Opens the datasource table for the given table definition.

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Method Detail

#### getDefinition

    public IDataSourceDefinition getDefinition()

Gets the datasource definition for this datasource.

Specified by:
  `getDefinition` in interface `IDataSource`
Returns:
  the definition for the datasource.

#### close

    public void close()

Closes this datasource and frees up the datasource table cache.

Specified by:
  `close` in interface `IDataSource`

#### isClosed

    public boolean isClosed()

Indicates if this datasource is closed.

Specified by:
  `isClosed` in interface `IDataSource`
Returns:
  `true` if the datasource is closed; `false` otherwise.

#### openTable

    public IDataSourceTable openTable(ITableDefinition tableDefinition)

Opens the datasource table for the given table definition.

Specified by:
  `openTable` in interface `IDataSource`
Parameters:
  `tableDefinition` - the information that defines the `IDataSourceTable` to instantiate. Must be an instance of `ShapeTableDefinition`.
Returns:
  a datasource table for the given table definition.

#### iterator

    public Iterator iterator()

Returns an iterator for the tables cached by this datasource.

Specified by:
  `iterator` in interface `Iterable`