org.openstreetmap.osmosis.core.container.v0_6
Class WayContainer

java.lang.Object
  extended by org.openstreetmap.osmosis.core.container.v0_6.EntityContainer
      extended by org.openstreetmap.osmosis.core.container.v0_6.WayContainer
All Implemented Interfaces:
Storeable

public class WayContainer
extends EntityContainer

Entity container implementation for ways.

Author:
Brett Henderson

Constructor Summary
WayContainer(StoreReader sr, StoreClassRegister scr)
          Creates a new instance.
WayContainer(Way way)
          Creates a new instance.
 
Method Summary
 Way getEntity()
          Returns the contained entity.
 WayContainer getWriteableInstance()
          Returns an instance containing a writeable entity.
 void process(EntityProcessor processor)
          Calls the appropriate process method with the contained entity.
 void store(StoreWriter sw, StoreClassRegister scr)
          Stores all state to the specified store writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WayContainer

public WayContainer(Way way)
Creates a new instance.

Parameters:
way - The way to wrap.

WayContainer

public WayContainer(StoreReader sr,
                    StoreClassRegister scr)
Creates a new instance.

Parameters:
sr - The store to read state from.
scr - Maintains the mapping between classes and their identifiers within the store.
Method Detail

store

public void store(StoreWriter sw,
                  StoreClassRegister scr)
Stores all state to the specified store writer.

Parameters:
sw - The writer that persists data to an underlying store.
scr - Maintains the mapping between classes and their identifiers within the store.

process

public void process(EntityProcessor processor)
Calls the appropriate process method with the contained entity.

Specified by:
process in class EntityContainer
Parameters:
processor - The processor to invoke.

getEntity

public Way getEntity()
Returns the contained entity.

Specified by:
getEntity in class EntityContainer
Returns:
The entity.

getWriteableInstance

public WayContainer getWriteableInstance()
Returns an instance containing a writeable entity. If the entity within this instance is already writeable then "this" will be returned, otherwise a cloned entity and container will be created.

Specified by:
getWriteableInstance in class EntityContainer
Returns:
A container holding a writeable entity.