|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectBaseFeatureCollection<T,F>
public abstract class BaseFeatureCollection<T extends FeatureType,F extends Feature>
Implement a feature collection just based on provision of a FeatureIterator
.
This implementation asks you to implement:
features()
AbstractFeatureCollection
and represents the easiest way to package your content as a FeatureCollection.
As this class provides no optimization, it is strongly recommended that you implement the following methods (which require a whole collection traversal):
size()
Field Summary | |
---|---|
protected String |
id
id used when serialized to gml |
protected T |
schema
|
Constructor Summary | |
---|---|
protected |
BaseFeatureCollection()
|
protected |
BaseFeatureCollection(T schema)
|
protected |
BaseFeatureCollection(T schema,
String id)
|
Method Summary | ||
---|---|---|
void |
accepts(FeatureVisitor visitor,
ProgressListener progress)
Visit the contents of a feature collection. |
|
boolean |
contains(Object o)
Returns true if this collection contains the specified element. |
|
boolean |
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements in the specified collection. |
|
abstract FeatureIterator<F> |
features()
Subclasses required to implement this method to traverse FeatureCollection contents. |
|
ReferencedEnvelope |
getBounds()
Full collection traversal to obtain bounds of FeatureCollection. |
|
String |
getID()
ID used when serializing to GML |
|
T |
getSchema()
The schema for the child feature members of this collection. |
|
boolean |
isEmpty()
Returns true if this feature collection contains no features. |
|
int |
size()
Returns the number of elements in this collection. |
|
FeatureCollection<T,F> |
sort(SortBy order)
Obtained sorted contents, only implemented for SimpleFeature at present. |
|
FeatureCollection<T,F> |
subCollection(Filter filter)
Convenience implementation that just wraps this collection into a FilteringFeatureCollection . |
|
Object[] |
toArray()
Array of all the elements. |
|
|
toArray(O[] a)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String id
protected T extends FeatureType schema
Constructor Detail |
---|
protected BaseFeatureCollection()
protected BaseFeatureCollection(T schema)
protected BaseFeatureCollection(T schema, String id)
Method Detail |
---|
public String getID()
FeatureCollection
getID
in interface FeatureCollection<T extends FeatureType,F extends Feature>
public T getSchema()
FeatureCollection
Represents the most general FeatureType in common to all the features in this collection.
getSchema
in interface FeatureCollection<T extends FeatureType,F extends Feature>
public abstract FeatureIterator<F> features()
Note that FeatureIterator
is available to clean up
after any resource use required during traversal.
features
in interface FeatureCollection<T extends FeatureType,F extends Feature>
public boolean contains(Object o)
This implementation iterates over the elements in the collection, checking each element in turn for equality with the specified element.
contains
in interface FeatureCollection<T extends FeatureType,F extends Feature>
o
- object to be checked for containment in this collection.
Collection.contains(Object)
public boolean containsAll(Collection<?> c)
containsAll
in interface FeatureCollection<T extends FeatureType,F extends Feature>
c
- collection to be checked for containment in this collection.
NullPointerException
- if the specified collection is null.contains(Object)
public boolean isEmpty()
FeatureCollection
isEmpty
in interface FeatureCollection<T extends FeatureType,F extends Feature>
public Object[] toArray()
toArray
in interface FeatureCollection<T extends FeatureType,F extends Feature>
Collection.toArray()
public <O> O[] toArray(O[] a)
toArray
in interface FeatureCollection<T extends FeatureType,F extends Feature>
Collection.toArray(Object[])
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException
FeatureCollection
The order of traversal is dependent on the FeatureCollection implementation; some collections are able to make efficient use of an internal index in order to quickly visit features located in the same region.
accepts
in interface FeatureCollection<T extends FeatureType,F extends Feature>
visitor
- Closure applied to each feature in turn.progress
- Used to report progress, may be used to interrupt the operation
IOException
public FeatureCollection<T,F> subCollection(Filter filter)
FilteringFeatureCollection
. Subclasses might want to override this in case the filter
can be cascaded to their data sources.
subCollection
in interface FeatureCollection<T extends FeatureType,F extends Feature>
filter
-
FeatureList
public FeatureCollection<T,F> sort(SortBy order)
This method only supports SimpleFeature at present, consider use of FeatureSource.features( Query ).
sort
in interface FeatureCollection<T extends FeatureType,F extends Feature>
order
- Sort order
public int size()
size
in interface FeatureCollection<T extends FeatureType,F extends Feature>
Collection.size()
public ReferencedEnvelope getBounds()
getBounds
in interface FeatureCollection<T extends FeatureType,F extends Feature>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |