|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractFeatureCollection
MemoryFeatureCollection
public class MemoryFeatureCollection
Implement a SimpleFeatureCollection by burning memory!
Contents are maintained in a sorted TreeMap by FID, this serves as a reference implementation when exploring the SimpleFeatureCollection 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.
| Field Summary |
|---|
| Fields inherited from class AbstractFeatureCollection |
|---|
id, listeners, open, schema |
| Constructor Summary | |
|---|---|
MemoryFeatureCollection(SimpleFeatureType schema)
|
|
| Method Summary | |
|---|---|
boolean |
add(SimpleFeature o)
Implement to support modification. |
void |
closeIterator(Iterator close)
Please override to cleanup after your own iterators, and any used resources. |
ReferencedEnvelope |
getBounds()
Calculates the bounds of the features without caching. |
SimpleFeature |
getFeatureMember(String id)
Access Feature content by feature id. |
Iterator |
openIterator()
Open a resource based Iterator, we will call close( iterator ). |
SimpleFeature |
removeFeatureMember(String id)
Optional Method |
int |
size()
Returns the number of elements in this collection. |
| Methods inherited from class AbstractFeatureCollection |
|---|
accepts, addAll, addAll, addListener, clear, close, close, contains, containsAll, features, getID, getOpenIterators, getSchema, isEmpty, iterator, purge, remove, removeAll, removeListener, retainAll, sort, subCollection, subList, toArray, toArray |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface SimpleFeatureCollection |
|---|
features, sort, subCollection |
| Methods inherited from interface FeatureCollection |
|---|
accepts, addAll, addAll, addListener, clear, close, close, contains, containsAll, getID, getSchema, isEmpty, iterator, purge, remove, removeAll, removeListener, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public MemoryFeatureCollection(SimpleFeatureType schema)
| Method Detail |
|---|
public boolean add(SimpleFeature o)
AbstractFeatureCollection
add in interface FeatureCollection<SimpleFeatureType,SimpleFeature>add in class AbstractFeatureCollectiono - element whose presence in this collection is to be ensured.
Collection.add(Object)public int size()
AbstractFeatureCollection
size in interface FeatureCollection<SimpleFeatureType,SimpleFeature>size in class AbstractFeatureCollectionCollection.size()public Iterator openIterator()
AbstractFeatureCollection
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 AbstractFeatureCollectionpublic void closeIterator(Iterator close)
AbstractFeatureCollectionAs 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 AbstractFeatureCollectionclose - Iterator, will not be null
public SimpleFeature getFeatureMember(String id)
throws NoSuchElementException
RandomFeatureAccess
getFeatureMember in interface RandomFeatureAccessNoSuchElementException - if a Feature with the indicated id is not presentpublic SimpleFeature removeFeatureMember(String id)
RandomFeatureAccess
removeFeatureMember in interface RandomFeatureAccesspublic ReferencedEnvelope getBounds()
getBounds in interface FeatureCollection<SimpleFeatureType,SimpleFeature>getBounds in class AbstractFeatureCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||