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 forCommand
s which manipulateConflict
s in addition toOsmPrimitive
s. A ConflictResolverCommand can remember a collection of conflicts it resolves. Upon undoing it reconstitutes them.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.command.Command
Command.OldNodeState
-
-
Field Summary
Fields Modifier and Type Field Description private ConflictCollection
resolvedConflicts
the list of resolved conflicts-
Fields inherited from class org.openstreetmap.josm.command.Command
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConflictResolveCommand(DataSet ds)
Constructs a newConflictResolveCommand
in the context of a given data set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
protected void
reconstituteConflicts()
reconstitutes all remembered conflicts.protected void
rememberConflict(Conflict<?> c)
remembers a conflict in the internal list of remembered conflictsvoid
undoCommand()
Undoes the command.-
Methods inherited from class org.openstreetmap.josm.command.Command
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, executeCommand, fillModifiedData, getAffectedDataSet, getOrig, getParticipatingPrimitives
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.command.PseudoCommand
getChildren, getDescriptionIcon, getDescriptionText
-
-
-
-
Field Detail
-
resolvedConflicts
private final ConflictCollection resolvedConflicts
the list of resolved conflicts
-
-
Constructor Detail
-
ConflictResolveCommand
protected ConflictResolveCommand(DataSet ds)
Constructs a newConflictResolveCommand
in the context of a given data set.- Parameters:
ds
- the data set. Must not be null.
-
-
Method Detail
-
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 theDataSet
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 classCommand
-
-