org.openstreetmap.osmosis.core.change.v0_5
Class ChangeApplier

java.lang.Object
  extended by org.openstreetmap.osmosis.core.change.v0_5.ChangeApplier
All Implemented Interfaces:
java.lang.Runnable, Task, MultiChangeSink, MultiSink, MultiSinkMultiChangeSinkRunnableSource, RunnableSource, Source

public class ChangeApplier
extends java.lang.Object
implements MultiSinkMultiChangeSinkRunnableSource

Applies a change set to an input source and produces an updated data set.

Author:
Brett Henderson

Constructor Summary
ChangeApplier(int inputBufferCapacity)
          Creates a new instance.
 
Method Summary
 ChangeSink getChangeSink(int instance)
          Obtains one of the change sinks exposed by the task.
 int getChangeSinkCount()
          This implementation always returns 1.
 Sink getSink(int instance)
          Obtains one of the sinks exposed by the task.
 int getSinkCount()
          This implementation always returns 1.
 void run()
          Processes the input sources and sends the updated data stream to the sink.
 void setSink(Sink sink)
          Sets the osm sink to send data to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeApplier

public ChangeApplier(int inputBufferCapacity)
Creates a new instance.

Parameters:
inputBufferCapacity - The size of the buffers to use for input sources.
Method Detail

getSink

public Sink getSink(int instance)
Obtains one of the sinks exposed by the task.

Specified by:
getSink in interface MultiSink
Parameters:
instance - The index of the sink to be returned.
Returns:
The sink.

getSinkCount

public int getSinkCount()
This implementation always returns 1.

Specified by:
getSinkCount in interface MultiSink
Returns:
1

getChangeSink

public ChangeSink getChangeSink(int instance)
Obtains one of the change sinks exposed by the task.

Specified by:
getChangeSink in interface MultiChangeSink
Parameters:
instance - The index of the change sink to be returned.
Returns:
The change sink.

getChangeSinkCount

public int getChangeSinkCount()
This implementation always returns 1.

Specified by:
getChangeSinkCount in interface MultiChangeSink
Returns:
1

setSink

public void setSink(Sink sink)
Sets the osm sink to send data to.

Specified by:
setSink in interface Source
Parameters:
sink - The sink for receiving all produced data.

run

public void run()
Processes the input sources and sends the updated data stream to the sink.

Specified by:
run in interface java.lang.Runnable