public class SubFeatureList extends SubFeatureCollection implements RandomFeatureAccess
FeatureCollection.sort(SortBy)
.
This implementation is not suitable for working with large content as it makes use of memory both when eastablishing an initial sort order, and subsequently to hold a list of FeatureId.
collection, ff, filter
id, schema
Constructor and Description |
---|
SubFeatureList(SimpleFeatureCollection list,
Filter filter) |
SubFeatureList(SimpleFeatureCollection list,
Filter filter,
SortBy subSort)
Create a simple SubFeatureList with the provided filter.
|
SubFeatureList(SimpleFeatureCollection list,
List order) |
SubFeatureList(SimpleFeatureCollection list,
SortBy sort) |
Modifier and Type | Method and Description |
---|---|
protected Filter |
createFilter()
Lazy create a filter based on index
|
protected List<FeatureId> |
createIndex()
Put this SubFeatureList in touch with its inner index
|
SimpleFeature |
get(int position)
item at the specified index.
|
SimpleFeature |
getFeatureMember(String id)
Access Feature content by feature id.
|
int |
indexOf(SimpleFeature feature) |
int |
lastIndexOf(SimpleFeature feature) |
Iterator<SimpleFeature> |
openIterator()
Returns a quick iterator that uses get and size methods.
|
SimpleFeature |
removeFeatureMember(String id)
Optional Method
|
SimpleFeatureCollection |
subList(Filter subfilter)
Sublist of this sublist!
|
features, filter, getBounds, getID, size, sort, subCollection
accepts, contains, containsAll, getSchema, isEmpty, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
features, sort, subCollection
public SubFeatureList(SimpleFeatureCollection list, Filter filter)
public SubFeatureList(SimpleFeatureCollection list, SortBy sort)
public SubFeatureList(SimpleFeatureCollection list, Filter filter, SortBy subSort)
filter
- public SubFeatureList(SimpleFeatureCollection list, List order)
public SimpleFeature get(int position)
index
- index of itemIndexOutOfBoundsException
- if index is not between 0 and sizeprotected Filter createFilter()
createFilter
in class SubFeatureCollection
protected List<FeatureId> createIndex()
public int indexOf(SimpleFeature feature)
public int lastIndexOf(SimpleFeature feature)
public SimpleFeatureCollection subList(Filter subfilter)
Implementation will ensure this does not get out of hand, order is maintained and only indexed once.
public SimpleFeature getFeatureMember(String id) throws NoSuchElementException
RandomFeatureAccess
getFeatureMember
in interface RandomFeatureAccess
NoSuchElementException
- if a Feature with the indicated id is not presentpublic Iterator<SimpleFeature> openIterator()
As with all resource collections it is assumed that the iterator will be closed after use.
#modCount
public SimpleFeature removeFeatureMember(String id)
RandomFeatureAccess
removeFeatureMember
in interface RandomFeatureAccess
Copyright © 1996–2019 Geotools. All rights reserved.