org.openstreetmap.osmosis.core.customdb.v0_6.impl
Class WayTileAreaIndexReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.customdb.v0_6.impl.WayTileAreaIndexReader
All Implemented Interfaces:
Releasable

public class WayTileAreaIndexReader
extends java.lang.Object
implements Releasable

Provides read-only access to a way tile area index store. Each thread accessing the store must create its own reader. The reader maintains all references to heavyweight resources such as file handles used to access the store eliminating the need for objects such as object iterators to be cleaned up explicitly.

Author:
Brett Henderson

Constructor Summary
WayTileAreaIndexReader(int[] masks, java.util.List<IndexStoreReader<java.lang.Integer,IntegerLongIndexElement>> indexReaders)
          Creates a new instance.
 
Method Summary
 java.util.Iterator<java.lang.Long> getRange(java.lang.Integer minimumTile, java.lang.Integer maximumTile)
          Returns all elements in the range specified by the minimum and maximum tiles.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WayTileAreaIndexReader

public WayTileAreaIndexReader(int[] masks,
                              java.util.List<IndexStoreReader<java.lang.Integer,IntegerLongIndexElement>> indexReaders)
Creates a new instance.

Parameters:
masks - The index masks.
indexReaders - The index readers.
Method Detail

getRange

public java.util.Iterator<java.lang.Long> getRange(java.lang.Integer minimumTile,
                                                   java.lang.Integer maximumTile)
Returns all elements in the range specified by the minimum and maximum tiles. All ways with tiles matching and lying between the two values will be returned.

Parameters:
minimumTile - The minimum tile in the range.
maximumTile - The maximum tile in the range.
Returns:
An iterator pointing to the requested range.

release

public void release()
Performs resource cleanup tasks such as closing files, or database connections. This must be called after all processing is complete and may be called multiple times. Implementations must call release on any nested Releasable objects. It should be called within a finally block to ensure it is called in exception scenarios.

Specified by:
release in interface Releasable