org.openstreetmap.osmosis.core.container.v0_6
Interface EntityManager<T extends Entity>

Type Parameters:
T - The entity type to be supported.
All Known Implementing Classes:
NodeManager, PostgresSqlEntityManager, RelationManager, WayManager

public interface EntityManager<T extends Entity>

Defines the dataset methods available for manipulating entities.

Author:
Brett Henderson

Method Summary
 void addEntity(T entity)
          Adds the specified entity to the database.
 boolean exists(long id)
          Indicates if the specified entity exists in the database.
 T getEntity(long id)
          Retrieves an entity by its identifier.
 ReleasableIterator<T> iterate()
          Returns an iterator providing access to all entities in the database.
 void modifyEntity(T entity)
          Updates the specified entity details in the database.
 void removeEntity(long entityId)
          Removes the specified entity from the database.
 

Method Detail

getEntity

T getEntity(long id)
Retrieves an entity by its identifier.

Parameters:
id - The id of the entity.
Returns:
The entity.

iterate

ReleasableIterator<T> iterate()
Returns an iterator providing access to all entities in the database.

Returns:
The entity iterator.

exists

boolean exists(long id)
Indicates if the specified entity exists in the database.

Parameters:
id - The id of the entity.
Returns:
True if the entity exists, false otherwise.

addEntity

void addEntity(T entity)
Adds the specified entity to the database.

Parameters:
entity - The entity to add.

modifyEntity

void modifyEntity(T entity)
Updates the specified entity details in the database.

Parameters:
entity - The entity to update.

removeEntity

void removeEntity(long entityId)
Removes the specified entity from the database.

Parameters:
entityId - The id of the entity to remove.