Class ConflictResolveCommand

java.lang.Object
org.openstreetmap.josm.command.Command
org.openstreetmap.josm.command.conflict.ConflictResolveCommand
All Implemented Interfaces:
PseudoCommand
Direct Known Subclasses:
CoordinateConflictResolveCommand, DeletedStateConflictResolveCommand, ModifiedConflictResolveCommand, RelationMemberConflictResolverCommand, TagConflictResolveCommand, VersionConflictResolveCommand, WayNodesConflictResolverCommand

public abstract class ConflictResolveCommand extends Command
This is the common base class for Commands which manipulate Conflicts in addition to OsmPrimitives. A ConflictResolverCommand can remember a collection of conflicts it resolves. Upon undoing it reconstitutes them.
  • Field Details

  • Constructor Details

    • ConflictResolveCommand

      Constructs a new ConflictResolveCommand in the context of a given data set.
      Parameters:
      ds - the data set. Must not be null.
  • Method Details

    • rememberConflict

      protected void rememberConflict(Conflict<?> c)
      remembers a conflict in the internal list of remembered conflicts
      Parameters:
      c - the remembered conflict
    • reconstituteConflicts

      protected void reconstituteConflicts()
      reconstitutes all remembered conflicts. Add the remembered conflicts to the set of conflicts of the DataSet this command was applied to.
    • undoCommand

      public void undoCommand()
      Description copied from class: Command
      Undoes the command. It can be assumed that all objects are in the same state they were before. It can also be assumed that executeCommand was called exactly once before. This implementation undoes all objects stored by a former call to executeCommand.
      Overrides:
      undoCommand in class Command
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Command
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Command