| java.lang.Object org.geotools.data.store.DataFeatureCollection
All known Subclasses: org.geotools.data.DefaultFeatureResults, org.geotools.renderer.lite.IndexedFeatureResults, org.geotools.data.gml.GMLFeatureCollection, org.geotools.data.store.EmptyFeatureCollection,
DataFeatureCollection | abstract public class DataFeatureCollection implements FeatureCollection(Code) | | A starting point for implementing FeatureCollection's backed
by real data.
The API you are required to implement is *identical* the the barebones
FeatureResults interface:
|
Method Summary | |
public void | accepts(FeatureVisitor visitor, ProgressListener progress) Accepts a visitor, which then visits each feature in the collection. | public boolean | add(Object arg0) | public boolean | addAll(Collection arg0) Optimized implementation of addAll that recognizes the
use of collections obtained with subCollection( filter ). | public void | addListener(CollectionListener listener) Adds a listener for collection events. | public void | clear() | final public void | close(Iterator close) | public void | close(FeatureIterator iterator) | protected void | closeIterator(Iterator close) | public boolean | contains(Object o) | public boolean | containsAll(Collection arg0) | public FeatureIterator | features() FeatureIterator is entirely based on iterator(). | protected void | fireChange(Feature[] features, int type) To let listeners know that something has changed. | protected void | fireChange(Feature feature, int type) | protected void | fireChange(Collection coll, int type) | public Object | getAttribute(String xPath) Not really interested yet .. | public Object | getAttribute(int index) | public Object[] | getAttributes(Object[] attributes) | abstract public ReferencedEnvelope | getBounds() | abstract public int | getCount() | public Geometry | getDefaultGeometry() | public synchronized FeatureType | getFeatureType() FeatureType of this FeatureCollection. | public String | getID() | public int | getNumberOfAttributes() | public FeatureCollection | getParent() | abstract public FeatureType | getSchema() | public boolean | isEmpty() Default implementation based on creating an reader, testing hasNext, and closing. | final public Iterator | iterator() Iterator may (or may) not support modification. | protected Iterator | openIterator() Returns a FeatureWriterIterator, or FeatureReaderIterator over content. | public void | purge() | public FeatureReader | reader() | public boolean | remove(Object arg0) | public boolean | removeAll(Collection arg0) | public void | removeListener(CollectionListener listener) Removes a listener for collection events. | public boolean | retainAll(Collection arg0) | public void | setAttribute(int position, Object val) | public void | setAttribute(String xPath, Object attribute) | public void | setDefaultGeometry(Geometry geometry) | public void | setParent(FeatureCollection collection) | public int | size() | public FeatureList | sort(SortBy order) Construct a sorted view of this content. | public FeatureList | sort(SortBy2 order) Allows for "Advanced" sort capabilities specific to the
GeoTools platform!
Advanced in this case really means making use of a generic
Expression, rather then being limited to PropertyName. | public FeatureCollection | subCollection(Filter filter) Will return an optimized subCollection based on access
to the origional FeatureSource. | public Object[] | toArray() | public Object[] | toArray(Object[] array) | protected FeatureWriter | writer() Subclass may provide an implementation of this method to indicate
that read/write support is provided. |
DataFeatureCollection | protected DataFeatureCollection()(Code) | | Collection based on a generic collection
|
DataFeatureCollection | protected DataFeatureCollection(String id)(Code) | | Collection based on a generic collection
|
DataFeatureCollection | protected DataFeatureCollection(String id, FeatureType featureType)(Code) | | Subclass must think about what consitructors it needs.
|
addAll | public boolean addAll(Collection arg0)(Code) | | Optimized implementation of addAll that recognizes the
use of collections obtained with subCollection( filter ).
This method is constructed by either:
- Filter OR
- Removing an extact match of Filter AND
|
addListener | public void addListener(CollectionListener listener)(Code) | | Adds a listener for collection events.
Parameters: listener - The listener to add |
clear | public void clear()(Code) | | |
features | public FeatureIterator features()(Code) | | FeatureIterator is entirely based on iterator().
So when we implement FeatureCollection.iterator() this will work
out of the box.
|
fireChange | protected void fireChange(Feature[] features, int type)(Code) | | To let listeners know that something has changed.
|
fireChange | protected void fireChange(Feature feature, int type)(Code) | | |
getDefaultGeometry | public Geometry getDefaultGeometry()(Code) | | |
getFeatureType | public synchronized FeatureType getFeatureType()(Code) | | FeatureType of this FeatureCollection.
Unless a FeatureType was provided during consturction (or this method is
overriden) a FeatureType will be generated based on getSchmea according
to the following assumptions:
- FeatureType is gml:AbstractFeatureCollectionType
- first attribute is getSchema.typeName
- the attribute FeatureType the same as returned by getSchema()
|
getNumberOfAttributes | public int getNumberOfAttributes()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | Default implementation based on creating an reader, testing hasNext, and closing.
For once the Collections API does not give us an escape route, we *have* to check the data.
|
iterator | final public Iterator iterator()(Code) | | Iterator may (or may) not support modification.
|
openIterator | protected Iterator openIterator() throws IOException(Code) | | Returns a FeatureWriterIterator, or FeatureReaderIterator over content.
If you have a way to tell that you are readonly please subclass with
a less hardcore check - this implementations catches a
UnsupportedOpperationsException from wrtier()!
Iterator, should be closed closeIterator |
purge | public void purge()(Code) | | |
removeListener | public void removeListener(CollectionListener listener)(Code) | | Removes a listener for collection events.
Parameters: listener - The listener to remove |
size | public int size()(Code) | | Default implementation based on getCount() - this may be expensive
|
sort | public FeatureList sort(SortBy order)(Code) | | Construct a sorted view of this content.
Sorts may be combined togther in a stable fashion, in congruence
with the Filter 1.1 specification.
This method should also be able to handle GeoTools specific
sorting through detecting order as a SortBy2 instance.
Parameters: order - since: GeoTools 2.2, Filter 1.1 FeatureList sorted according to provided order |
sort | public FeatureList sort(SortBy2 order)(Code) | | Allows for "Advanced" sort capabilities specific to the
GeoTools platform!
Advanced in this case really means making use of a generic
Expression, rather then being limited to PropertyName.
Parameters: order - GeoTools SortBy FeatureList sorted according to provided order |
subCollection | public FeatureCollection subCollection(Filter filter)(Code) | | Will return an optimized subCollection based on access
to the origional FeatureSource.
The subCollection is constructed by using an AND Filter.
For the converse of this opperation please see
collection.addAll( Collection ), it has been optimized
to be aware of these filter based SubCollections.
This method is intended in a manner similar to subList,
example use:
collection.subCollection( myFilter ).clear()
Parameters: filter - Filter used to determine sub collection. since: GeoTools 2.2, Filter 1.1 |
writer | protected FeatureWriter writer() throws IOException(Code) | | Subclass may provide an implementation of this method to indicate
that read/write support is provided.
All operations that attempt to modify the "data" will
use this method, allowing them to throw an "UnsupportedOperationException"
in the same manner as Collections.unmodifiableCollection(Collection c)
throws: UnsupportedOperationException - To indicate that write support is not avaiable |
|
|