Package org.geotools.data.geojson
Class PagingFeatureCollection
- Object
-
- BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
-
- BaseSimpleFeatureCollection
-
- PagingFeatureCollection
-
- All Implemented Interfaces:
SimpleFeatureCollection,FeatureCollection<SimpleFeatureType,SimpleFeature>
public class PagingFeatureCollection extends BaseSimpleFeatureCollection
A GeoJSON specific feature collection that can follow "next" links in order to retrieve all data
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPagingFeatureCollection.PagingFeatureIterator
-
Field Summary
Fields Modifier and Type Field Description protected static LoggerLOGGER-
Fields inherited from class BaseFeatureCollection
id, schema
-
-
Constructor Summary
Constructors Constructor Description PagingFeatureCollection(SimpleFeatureCollection first, ObjectNode next, Integer matched)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureIteratorfeatures()Subclasses required to implement this method to traverse FeatureCollection contents.protected SimpleFeatureCollectiongetFirstCollection()IntegergetMatched()Matched header from the GeoJSON feature collection, if found, or null otherwise.protected ObjectNodegetNext()protected SimpleFeatureCollectionreadNext(ObjectNode next)Reads the next feature collection, or return null if there is none.intsize()Returns the number of elements in this collection.-
Methods inherited from class BaseSimpleFeatureCollection
sort, subCollection
-
Methods inherited from class BaseFeatureCollection
accepts, contains, containsAll, getBounds, getID, 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, toArray, toArray
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
-
Constructor Detail
-
PagingFeatureCollection
public PagingFeatureCollection(SimpleFeatureCollection first, ObjectNode next, Integer matched)
-
-
Method Detail
-
getMatched
public Integer getMatched()
Matched header from the GeoJSON feature collection, if found, or null otherwise.
-
size
public int size()
Description copied from class:BaseFeatureCollectionReturns the number of elements in this collection.- Specified by:
sizein interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>- Overrides:
sizein classBaseFeatureCollection<SimpleFeatureType,SimpleFeature>- Returns:
- Number of items, or Interger.MAX_VALUE
- See Also:
Collection.size()
-
features
public SimpleFeatureIterator features()
Description copied from class:BaseSimpleFeatureCollectionSubclasses required to implement this method to traverse FeatureCollection contents.Note that
FeatureIterator.close()is available to clean up after any resource use required during traversal.- Specified by:
featuresin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>- Specified by:
featuresin interfaceSimpleFeatureCollection- Specified by:
featuresin classBaseSimpleFeatureCollection- Returns:
- A FeatureIterator.
-
getFirstCollection
protected SimpleFeatureCollection getFirstCollection()
-
getNext
protected ObjectNode getNext()
-
readNext
protected SimpleFeatureCollection readNext(ObjectNode next) throws IOException
Reads the next feature collection, or return null if there is none. Subclasses can override if they need a different logic for fetching the next page.- Throws:
IOException
-
-