|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.feature.collection.AbstractResourceCollection org.geotools.feature.collection.AbstractFeatureCollection org.geotools.data.memory.MemoryFeatureCollection
Implement a FeatureCollection by burning memory!
Contents are maintained in a sorted TreeMap by FID, this serves as a reference implementation when exploring the FeatureCollection api.
This is similar to DefaultFeatureCollection, although additional methods are supported and test cases have been written. Unlike DefaultFeatureCollection the type information must be known at construction time.
Nested Class Summary |
Nested classes inherited from class org.geotools.feature.Feature |
Feature.NULL |
Field Summary |
Fields inherited from class org.geotools.feature.collection.AbstractResourceCollection |
open |
Constructor Summary | |
MemoryFeatureCollection(FeatureType schema)
|
Method Summary | |
boolean |
add(java.lang.Object o)
Implement to support modification. |
protected void |
closeIterator(java.util.Iterator close)
Please override to cleanup after your own iterators, and any used resources. |
Feature |
getFeatureMember(java.lang.String id)
Access Feature content by feature id. |
protected java.util.Iterator |
openIterator()
Open a resource based Iterator, we will call close( iterator ). |
Feature |
removeFeatureMember(java.lang.String id)
Optional Method |
int |
size()
Returns the number of elements in this collection. |
Methods inherited from class org.geotools.feature.collection.AbstractFeatureCollection |
accepts, addListener, close, closeIterator, collection, features, getAttribute, getAttribute, getAttributes, getBounds, getCount, getDefaultGeometry, getFeatureType, getID, getNumberOfAttributes, getParent, getSchema, purge, reader, removeListener, setAttribute, setAttribute, setDefaultGeometry, setParent, sort, subCollection, subList |
Methods inherited from class org.geotools.feature.collection.AbstractResourceCollection |
addAll, clear, close, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.geotools.feature.FeatureCollection |
accepts, addListener, close, close, features, getFeatureType, getSchema, removeListener, sort, subCollection |
Methods inherited from interface org.geotools.data.collection.ResourceCollection |
iterator, purge |
Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from interface org.geotools.data.FeatureResults |
collection, getBounds, getCount, reader |
Methods inherited from interface org.geotools.feature.Feature |
getAttribute, getAttribute, getAttributes, getBounds, getDefaultGeometry, getID, getNumberOfAttributes, getParent, setAttribute, setAttribute, setDefaultGeometry, setParent |
Constructor Detail |
public MemoryFeatureCollection(FeatureType schema)
Method Detail |
public int size()
AbstractResourceCollection
size
in interface java.util.Collection
size
in class AbstractResourceCollection
protected java.util.Iterator openIterator()
AbstractResourceCollection
Please subclass to provide your own iterator for the the ResourceCollection,
note iterator()
is implemented to call open()
and track the results in for later purge()
.
openIterator
in class AbstractResourceCollection
protected void closeIterator(java.util.Iterator close)
AbstractResourceCollection
As an example if the iterator was working off a File then the inputstream should be closed.
Subclass must call super.close( close ) to allow the list of open iterators to be adjusted.
closeIterator
in class AbstractResourceCollection
close
- Iterator, will not be null
public boolean add(java.lang.Object o)
AbstractResourceCollection
add
in interface java.util.Collection
add
in class AbstractResourceCollection
o
- element whose presence in this collection is to be ensured.
public Feature getFeatureMember(java.lang.String id) throws java.util.NoSuchElementException
RandomFeatureAccess
getFeatureMember
in interface RandomFeatureAccess
id
-
java.util.NoSuchElementException
- if a Feature with the indicated id is not presentpublic Feature removeFeatureMember(java.lang.String id)
RandomFeatureAccess
removeFeatureMember
in interface RandomFeatureAccess
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |