Package org.geotools.feature.collection
Class SubFeatureList
-
- All Implemented Interfaces:
SimpleFeatureCollection
,RandomFeatureAccess
,FeatureCollection<SimpleFeatureType,SimpleFeature>
public class SubFeatureList extends SubFeatureCollection implements RandomFeatureAccess
Default implementation ofFeatureCollection.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.
-
-
Field Summary
-
Fields inherited from class SubFeatureCollection
collection, ff, filter
-
Fields inherited from class BaseFeatureCollection
id, schema
-
-
Constructor Summary
Constructors Constructor Description SubFeatureList(SimpleFeatureCollection list, List<FeatureId> order)
SubFeatureList(SimpleFeatureCollection list, Filter filter)
SubFeatureList(SimpleFeatureCollection list, Filter filter, SortBy subSort)
Create a simple SubFeatureList with the provided filter.SubFeatureList(SimpleFeatureCollection list, SortBy sort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Filter
createFilter()
Lazy create a filter based on indexprotected List<FeatureId>
createIndex()
Put this SubFeatureList in touch with its inner indexSimpleFeature
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 MethodSimpleFeatureCollection
subList(Filter subfilter)
Sublist of this sublist!-
Methods inherited from class SubFeatureCollection
features, filter, getBounds, getID, size, sort, subCollection
-
Methods inherited from class BaseFeatureCollection
accepts, contains, containsAll, getSchema, isEmpty, toArray, toArray
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface FeatureCollection
accepts, contains, containsAll, getBounds, getID, getSchema, isEmpty, size, toArray, toArray
-
Methods inherited from interface SimpleFeatureCollection
features, sort, subCollection
-
-
-
-
Constructor Detail
-
SubFeatureList
public SubFeatureList(SimpleFeatureCollection list, Filter filter)
-
SubFeatureList
public SubFeatureList(SimpleFeatureCollection list, SortBy sort)
-
SubFeatureList
public SubFeatureList(SimpleFeatureCollection list, Filter filter, SortBy subSort)
Create a simple SubFeatureList with the provided filter.
-
SubFeatureList
public SubFeatureList(SimpleFeatureCollection list, List<FeatureId> order)
-
-
Method Detail
-
get
public SimpleFeature get(int position)
item at the specified index.- Parameters:
position
- index of item- Returns:
- the item at the specified index.
- Throws:
IndexOutOfBoundsException
- if index is not between 0 and size
-
createFilter
protected Filter createFilter()
Lazy create a filter based on index- Overrides:
createFilter
in classSubFeatureCollection
-
createIndex
protected List<FeatureId> createIndex()
Put this SubFeatureList in touch with its inner index
-
indexOf
public int indexOf(SimpleFeature feature)
-
lastIndexOf
public int lastIndexOf(SimpleFeature feature)
-
subList
public SimpleFeatureCollection subList(Filter subfilter)
Sublist of this sublist!Implementation will ensure this does not get out of hand, order is maintained and only indexed once.
-
getFeatureMember
public SimpleFeature getFeatureMember(String id) throws NoSuchElementException
Description copied from interface:RandomFeatureAccess
Access Feature content by feature id.- Specified by:
getFeatureMember
in interfaceRandomFeatureAccess
- Returns:
- Feature with the indicated or id
- Throws:
NoSuchElementException
- if a Feature with the indicated id is not present
-
openIterator
public Iterator<SimpleFeature> openIterator()
Returns a quick iterator that uses get and size methods.As with all resource collections it is assumed that the iterator will be closed after use.
- Returns:
- an iterator over the elements in this list in proper sequence.
- See Also:
#modCount
-
removeFeatureMember
public SimpleFeature removeFeatureMember(String id)
Description copied from interface:RandomFeatureAccess
Optional Method- Specified by:
removeFeatureMember
in interfaceRandomFeatureAccess
-
-