org.geotools.data.store
Class ArrayDataStore

Object
  extended by AbstractDataStore
      extended by ArrayDataStore
All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>, DataStore

public final class ArrayDataStore
extends AbstractDataStore

Simple example of an AbstractDataStore built around the provided array of features.

Please note that this is a simple example and all the features must be of the same FeatureType.

This class is used by DataUtilities.source(SimpleFeature[]).

Since:
8.0
Author:
Jody Garnett

Field Summary
 
Fields inherited from class AbstractDataStore
isWriteable, listenerManager, LOGGER
 
Constructor Summary
ArrayDataStore(SimpleFeature[] featureArray)
          Create a read-only DataStore wrapped around the provided feature array.
 
Method Summary
protected  FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(String typeName)
          Subclass must implement.
 SimpleFeatureType getSchema(String typeName)
          Retrive schema information for typeName
 String[] getTypeNames()
          helper method for retrieving all the names.
 
Methods inherited from class AbstractDataStore
createFeatureWriter, createLockingManager, createMetadata, createSchema, dispose, getBounds, getCount, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getInfo, getLockingManager, getNames, getSchema, getSupportedHints, getUnsupportedFilter, removeSchema, removeSchema, state, updateSchema, updateSchema
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayDataStore

public ArrayDataStore(SimpleFeature[] featureArray)
Create a read-only DataStore wrapped around the provided feature array.

Parameters:
featureArray - SimpleFeature array, if empty FeatureTypes.EMPTY is used
Method Detail

getTypeNames

public String[] getTypeNames()
Description copied from class: AbstractDataStore
helper method for retrieving all the names.

Specified by:
getTypeNames in interface DataStore
Specified by:
getTypeNames in class AbstractDataStore
Returns:
names of feature types available in this DataStore

getSchema

public SimpleFeatureType getSchema(String typeName)
                            throws IOException
Description copied from class: AbstractDataStore
Retrive schema information for typeName

Specified by:
getSchema in interface DataStore
Specified by:
getSchema in class AbstractDataStore
Parameters:
typeName - the feature type name
Returns:
the requested feature type
Throws:
IOException - if typeName is not available

getFeatureReader

protected FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(String typeName)
                                                                   throws IOException
Description copied from class: AbstractDataStore
Subclass must implement.

Specified by:
getFeatureReader in class AbstractDataStore
Returns:
FeatureReader over contents of typeName
Throws:
IOException


Copyright © 1996-2014 Geotools. All Rights Reserved.