Class EntityMerger

java.lang.Object
org.openstreetmap.osmosis.set.v0_6.EntityMerger
All Implemented Interfaces:
Runnable, org.openstreetmap.osmosis.core.task.common.Task, org.openstreetmap.osmosis.core.task.v0_6.MultiSink, org.openstreetmap.osmosis.core.task.v0_6.MultiSinkRunnableSource, org.openstreetmap.osmosis.core.task.v0_6.RunnableSource, org.openstreetmap.osmosis.core.task.v0_6.Source

public class EntityMerger extends Object implements org.openstreetmap.osmosis.core.task.v0_6.MultiSinkRunnableSource
Merges two sources into a single data set. Conflicting elements are resolved by using either the latest timestamp (default) or always selecting the second source.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityMerger(org.openstreetmap.osmosis.core.merge.common.ConflictResolutionMethod conflictResolutionMethod, int inputBufferCapacity, BoundRemovedAction boundRemovedAction)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openstreetmap.osmosis.core.task.v0_6.Sink
    getSink(int instance)
    int
    This implementation always returns 2.
    void
    run()
    void
    setSink(org.openstreetmap.osmosis.core.task.v0_6.Sink sink)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityMerger

      public EntityMerger(org.openstreetmap.osmosis.core.merge.common.ConflictResolutionMethod conflictResolutionMethod, int inputBufferCapacity, BoundRemovedAction boundRemovedAction)
      Creates a new instance.
      Parameters:
      conflictResolutionMethod - The method to used to resolve conflict when two sources contain the same entity.
      inputBufferCapacity - The size of the buffers to use for input sources.
      boundRemovedAction - The action to take if the merge operation removes a bound entity.
  • Method Details

    • getSink

      public org.openstreetmap.osmosis.core.task.v0_6.Sink getSink(int instance)
      Specified by:
      getSink in interface org.openstreetmap.osmosis.core.task.v0_6.MultiSink
    • getSinkCount

      public int getSinkCount()
      This implementation always returns 2.
      Specified by:
      getSinkCount in interface org.openstreetmap.osmosis.core.task.v0_6.MultiSink
      Returns:
      2
    • setSink

      public void setSink(org.openstreetmap.osmosis.core.task.v0_6.Sink sink)
      Specified by:
      setSink in interface org.openstreetmap.osmosis.core.task.v0_6.Source
    • run

      public void run()
      Specified by:
      run in interface Runnable