org.openstreetmap.osmosis.core.customdb.v0_5.impl
Class WayTileAreaIndex

java.lang.Object
  extended by org.openstreetmap.osmosis.core.customdb.v0_5.impl.WayTileAreaIndex
All Implemented Interfaces:
Completable, Releasable

public class WayTileAreaIndex
extends java.lang.Object
implements Completable

A class for managing a way tile index of varying granularity allowing different sized tiles for different sized ways.


Constructor Summary
WayTileAreaIndex(DatasetStoreFileManager fileManager)
          Creates a new instance.
 
Method Summary
 void complete()
          Ensures that all information is fully persisted.
 WayTileAreaIndexReader createReader()
          Creates a new reader capable of accessing the contents of this index.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 void write(long wayId, int minimumTile, int maximumTile)
          Writes a new way tile entry to the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WayTileAreaIndex

public WayTileAreaIndex(DatasetStoreFileManager fileManager)
Creates a new instance.

Parameters:
fileManager - Manages and provides files for writing indexes to.
Method Detail

write

public void write(long wayId,
                  int minimumTile,
                  int maximumTile)
Writes a new way tile entry to the index.

Parameters:
wayId - The way to be added.
minimumTile - The minimum tile of the way.
maximumTile - The maximum tile of the way.

createReader

public WayTileAreaIndexReader createReader()
Creates a new reader capable of accessing the contents of this index. The reader must be explicitly released when no longer required. Readers must be released prior to this index.

Returns:
An index reader.

complete

public void complete()
Ensures that all information is fully persisted. This includes database commits, file buffer flushes, etc. Implementations must call complete on any nested Completable objects. Where the releasable method of a Releasable class should be called within a finally block, this method should typically be the final statement within the try block.

Specified by:
complete in interface Completable

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