public class MemorySortIterator extends Object implements OsmIterator
Constructor and Description |
---|
MemorySortIterator(OsmIterator input)
Sort the elements from a OSM input source by their id in memory and
provide them as a single OSM input source in that order.
|
MemorySortIterator(OsmIterator input,
Comparator<? super OsmNode> comparatorNodes,
Comparator<? super OsmWay> comparatorWays,
Comparator<? super OsmRelation> comparatorRelations)
Sort the elements from a OSM input source by their id in memory and
provide them as a single OSM input source in that order.
|
MemorySortIterator(OsmIterator input,
Comparator<OsmEntity> comparator)
Sort the elements from a OSM input source by their id in memory and
provide them as a single OSM input source in that order.
|
Modifier and Type | Method and Description |
---|---|
OsmBounds |
getBounds() |
boolean |
hasBounds() |
boolean |
hasNext() |
boolean |
isIgnoreDuplicates()
Whether objects that have the same type and id as a previously
encountered element will be discarded from output.
|
Iterator<EntityContainer> |
iterator() |
EntityContainer |
next() |
void |
remove() |
void |
setIgnoreDuplicates(boolean ignoreDuplicates)
When set to false, elements with the same id can appear multiple times in
the output.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
public MemorySortIterator(OsmIterator input)
input
- an OsmIterator to retrieve data from.public MemorySortIterator(OsmIterator input, Comparator<OsmEntity> comparator)
input
- an OsmIterator to retrieve data from.comparator
- a Comparator used to sort each list of elements.public MemorySortIterator(OsmIterator input, Comparator<? super OsmNode> comparatorNodes, Comparator<? super OsmWay> comparatorWays, Comparator<? super OsmRelation> comparatorRelations)
input
- an OsmIterator to retrieve data from.comparatorNodes
- a Comparator used to sort the list of nodes.comparatorWays
- a Comparator used to sort the list of ways.comparatorRelations
- a Comparator used to sort the list of relations.public boolean isIgnoreDuplicates()
public void setIgnoreDuplicates(boolean ignoreDuplicates)
public Iterator<EntityContainer> iterator()
iterator
in interface Iterable<EntityContainer>
public void remove()
remove
in interface Iterator<EntityContainer>
public boolean hasBounds()
hasBounds
in interface OsmIterator
public OsmBounds getBounds()
getBounds
in interface OsmIterator
public boolean hasNext()
hasNext
in interface Iterator<EntityContainer>
public EntityContainer next()
next
in interface Iterator<EntityContainer>