org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class DbFeature<T extends Storeable>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.DbFeature<T>
Type Parameters:
T - The feature type to be encapsulated.
All Implemented Interfaces:
Storeable
Direct Known Subclasses:
DbOrderedFeature

public class DbFeature<T extends Storeable>
extends java.lang.Object
implements Storeable

A data class for representing a database record for an entity feature. This aggregates a standard entity feature type with a field relating it to the owning entity.

Author:
Brett Henderson

Constructor Summary
DbFeature(long entityId, T feature)
          Creates a new instance.
DbFeature(StoreReader sr, StoreClassRegister scr)
          Creates a new instance.
 
Method Summary
 long getEntityId()
           
 T getFeature()
           
 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

DbFeature

public DbFeature(long entityId,
                 T feature)
Creates a new instance.

Parameters:
entityId - The owning entity id.
feature - The feature being referenced.

DbFeature

public DbFeature(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.

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

getEntityId

public long getEntityId()
Returns:
The entity id.

getFeature

public T getFeature()
Returns:
The entity feature.