public class SortedFeatureIterator extends Object implements SimpleFeatureIterator
Constructor and Description |
---|
SortedFeatureIterator(SimpleFeatureIterator iterator,
SimpleFeatureType schema,
SortBy[] sortBy,
int maxFeatures)
Builds a new sorting feature iterator
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canSort(SimpleFeatureType schema,
SortBy[] sortBy)
Checks if the schema and the sortBy are suitable for merge/sort.
|
void |
close()
Closes this iterator and releases any system resources associated with it.
|
boolean |
hasNext()
Does another Feature exist in this Iteration.
|
SimpleFeature |
next()
Get the next Feature in this iteration.
|
public SortedFeatureIterator(SimpleFeatureIterator iterator, SimpleFeatureType schema, SortBy[] sortBy, int maxFeatures) throws IOException
iterator
- The iterator to be sortedschema
- The iterator schemasortBy
- The sorting directivesmaxFeatures
- The maximum number of features to keep in memory, or a negative number to
use the system defaultIOException
public static final boolean canSort(SimpleFeatureType schema, SortBy[] sortBy)
Serializable
, all sorting attributes need to be Comparable
public boolean hasNext()
FeatureIterator
Iterator defin: Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
hasNext
in interface FeatureIterator<SimpleFeature>
public SimpleFeature next() throws NoSuchElementException
FeatureIterator
next
in interface FeatureIterator<SimpleFeature>
NoSuchElementException
- If no more Features exist.public void close()
FeatureIterator
close
in interface Closeable
close
in interface AutoCloseable
close
in interface FeatureIterator<SimpleFeature>
Copyright © 1996–2021 Geotools. All rights reserved.