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

java.lang.Object
  extended by org.openstreetmap.osmosis.core.container.v0_6.EntityContainer
All Implemented Interfaces:
Storeable
Direct Known Subclasses:
BoundContainer, NodeContainer, RelationContainer, WayContainer

public abstract class EntityContainer
extends java.lang.Object
implements Storeable

Implementations of this class allow data entities to be processed without the caller knowing their type.

Author:
Brett Henderson

Constructor Summary
EntityContainer()
           
 
Method Summary
abstract  Entity getEntity()
          Returns the contained entity.
abstract  EntityContainer getWriteableInstance()
          Returns an instance containing a writeable entity.
abstract  void process(EntityProcessor processor)
          Calls the appropriate process method with the contained entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.osmosis.core.store.Storeable
store
 

Constructor Detail

EntityContainer

public EntityContainer()
Method Detail

process

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

Parameters:
processor - The processor to invoke.

getEntity

public abstract Entity getEntity()
Returns the contained entity.

Returns:
The entity.

getWriteableInstance

public abstract EntityContainer 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.

Returns:
A container holding a writeable entity.