|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.AbstractDataStore org.geotools.data.memory.MemoryDataStore
This is an example implementation of a DataStore used for testing.
It serves as an example implementation of:
This class will also illustrate the use of In-Process locking when the time comes.
Field Summary | |
protected java.util.Map |
memory
Memory holds Map of Feature by fid by typeName. |
protected java.util.Map |
schema
Schema holds FeatureType by typeName |
Fields inherited from class org.geotools.data.AbstractDataStore |
isWriteable, listenerManager |
Constructor Summary | |
MemoryDataStore()
|
|
MemoryDataStore(Feature[] array)
|
|
MemoryDataStore(FeatureCollection collection)
|
|
MemoryDataStore(FeatureReader reader)
|
Method Summary | |
void |
addFeature(Feature feature)
Adds a single Feature to the correct typeName entry. |
void |
addFeatures(java.util.Collection collection)
Configures MemoryDataStore with Collection. |
void |
addFeatures(Feature[] features)
Configures MemoryDataStore with feature array. |
void |
addFeatures(FeatureReader reader)
Configures MemoryDataStore with FeatureReader. |
void |
createSchema(FeatureType featureType)
Adds support for a new featureType to MemoryDataStore. |
protected java.util.Map |
features(java.lang.String typeName)
Access featureMap for typeName. |
FeatureReader |
getFeatureReader(java.lang.String typeName)
Provides FeatureReader over the entire contents of typeName . |
FeatureWriter |
getFeatureWriter(java.lang.String typeName)
Provides FeatureWriter over the entire contents of typeName . |
FeatureType |
getSchema(java.lang.String typeName)
FeatureType access by typeName . |
java.lang.String[] |
getTypeNames()
List of available types provided by this DataStore. |
Methods inherited from class org.geotools.data.AbstractDataStore |
createLockingManager, fireAdded, fireChanged, fireRemoved, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getView, updateSchema |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map memory
protected java.util.Map schema
Constructor Detail |
public MemoryDataStore()
public MemoryDataStore(FeatureCollection collection)
public MemoryDataStore(Feature[] array) throws java.io.IOException
public MemoryDataStore(FeatureReader reader) throws java.io.IOException
Method Detail |
public void addFeatures(FeatureReader reader) throws java.io.IOException
reader
- New contents to add
java.io.IOException
- If problems are encountered while adding
DataSourceException
- See IOExceptionpublic void addFeatures(java.util.Collection collection)
You may use this to create a MemoryDataStore from a FeatureCollection.
collection
- Collection of features to add
java.lang.IllegalArgumentException
- If provided collection is emptypublic void addFeatures(Feature[] features)
features
- Array of features to add
java.lang.IllegalArgumentException
- If provided feature array is emptypublic void addFeature(Feature feature)
This is an internal opperation used for setting up MemoryDataStore - please use FeatureWriter for generatl use.
This method is willing to create new FeatureTypes for MemoryDataStore.
feature
- Individual feature to add
java.lang.IllegalArgumentException
- If provided feature is emptyprotected java.util.Map features(java.lang.String typeName) throws java.io.IOException
typeName
-
java.io.IOException
- If typeName cannot be foundpublic java.lang.String[] getTypeNames()
getTypeNames
in interface DataStore
getTypeNames
in class AbstractDataStore
org.geotools.data.AbstractDataStore#getFeatureTypes()
public FeatureType getSchema(java.lang.String typeName) throws java.io.IOException
typeName
.
getSchema
in interface DataStore
getSchema
in class AbstractDataStore
typeName
-
typeName
java.io.IOException
AbstractDataStore.getSchema(java.lang.String)
public void createSchema(FeatureType featureType) throws java.io.IOException
FeatureTypes are stored by typeName, an IOException will be thrown if the requested typeName is already in use.
createSchema
in interface DataStore
createSchema
in class AbstractDataStore
featureType
- FeatureType to be added
java.io.IOException
- If featureType already existsDataStore.createSchema(org.geotools.feature.FeatureType)
public FeatureReader getFeatureReader(java.lang.String typeName) throws java.io.IOException
typeName
.
Implements getFeatureReader contract for AbstractDataStore.
getFeatureReader
in class AbstractDataStore
typeName
-
java.io.IOException
- If typeName could not be found
DataSourceException
- See IOExceptionAbstractDataStore.getFeatureSource(java.lang.String)
public FeatureWriter getFeatureWriter(java.lang.String typeName) throws java.io.IOException
typeName
.
Implements getFeatureWriter contract for AbstractDataStore.
getFeatureWriter
in class AbstractDataStore
typeName
- name of FeatureType we wish to modify
java.io.IOException
- If writer cannot be obtained for typeName
DataSourceException
- See IOExceptionAbstractDataStore.getFeatureSource(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |