org.openstreetmap.josm.data.validation.tests
Class DuplicateRelation

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.Test
          extended by org.openstreetmap.josm.data.validation.tests.DuplicateRelation
All Implemented Interfaces:
Visitor

public class DuplicateRelation
extends Test

Tests if there are duplicate relations


Nested Class Summary
private  class DuplicateRelation.RelationMembers
           
private  class DuplicateRelation.RelationPair
           
static class DuplicateRelation.RelMember
           
 
Field Summary
protected static int DUPLICATE_RELATION
           
(package private)  MultiMap<DuplicateRelation.RelationPair,OsmPrimitive> relations
          MultiMap of all relations
(package private)  MultiMap<java.util.List<RelationMember>,OsmPrimitive> relations_nokeys
          MultiMap of all relations, regardless of keys
protected static int SAME_RELATION
           
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
DuplicateRelation()
          Constructor
 
Method Summary
 void endTest()
          Notification of the end of the test.
 Command fixError(TestError testError)
          Fix the error by removing all but one instance of duplicate relations
 boolean isFixable(TestError testError)
          Returns true if the given error can be fixed automatically
 void startTest(ProgressMonitor monitor)
          Start the test using a given progress monitor
 void visit(Relation r)
          Visiting call for relations.
 
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, deletePrimitivesIfNeeded, getErrors, getName, initialize, isBuilding, isCanceled, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit, visit
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUPLICATE_RELATION

protected static final int DUPLICATE_RELATION
See Also:
Constant Field Values

SAME_RELATION

protected static final int SAME_RELATION
See Also:
Constant Field Values

relations

MultiMap<DuplicateRelation.RelationPair,OsmPrimitive> relations
MultiMap of all relations


relations_nokeys

MultiMap<java.util.List<RelationMember>,OsmPrimitive> relations_nokeys
MultiMap of all relations, regardless of keys

Constructor Detail

DuplicateRelation

public DuplicateRelation()
Constructor

Method Detail

startTest

public void startTest(ProgressMonitor monitor)
Description copied from class: Test
Start the test using a given progress monitor

Overrides:
startTest in class Test
Parameters:
monitor - the progress monitor

endTest

public void endTest()
Description copied from class: Test
Notification of the end of the test. The tester may perform additional actions and destroy the used structures.

If you override this method, don't forget to cleanup Test.progressMonitor (most overrides call super.endTest() to do this).

Overrides:
endTest in class Test

visit

public void visit(Relation r)
Description copied from interface: Visitor
Visiting call for relations.

Specified by:
visit in interface Visitor
Overrides:
visit in class Test
Parameters:
r - The relation to inspect.

fixError

public Command fixError(TestError testError)
Fix the error by removing all but one instance of duplicate relations

Overrides:
fixError in class Test
Returns:
The command to fix the error

isFixable

public boolean isFixable(TestError testError)
Description copied from class: Test
Returns true if the given error can be fixed automatically

Overrides:
isFixable in class Test
Parameters:
testError - The error to check if can be fixed
Returns:
true if the error can be fixed


JOSM