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

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.DuplicateNode
All Implemented Interfaces:
Visitor

public class DuplicateNode
extends Test

Tests if there are duplicate nodes


Nested Class Summary
private static class DuplicateNode.NodeHash
           
 
Field Summary
protected static int DUPLICATE_NODE
           
protected static int DUPLICATE_NODE_BOUNDARY
           
protected static int DUPLICATE_NODE_BUILDING
           
protected static int DUPLICATE_NODE_HIGHWAY
           
protected static int DUPLICATE_NODE_LANDUSE
           
protected static int DUPLICATE_NODE_MIXED
           
protected static int DUPLICATE_NODE_NATURAL
           
protected static int DUPLICATE_NODE_OTHER
           
protected static int DUPLICATE_NODE_POWER
           
protected static int DUPLICATE_NODE_RAILWAY
           
protected static int DUPLICATE_NODE_UNCLOSED
           
protected static int DUPLICATE_NODE_WATERWAY
           
(package private)  Storage<java.lang.Object> potentialDuplicates
          The map of potential duplicates.
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
DuplicateNode()
          Constructor
 
Method Summary
 java.util.List<TestError> buildTestErrors(Test parentTest, java.util.List<Node> nodes)
           
 void endTest()
          Notification of the end of the test.
 Command fixError(TestError testError)
          Merge the nodes into one.
 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(Node n)
          Visiting call for points.
 
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_NODE

protected static final int DUPLICATE_NODE
See Also:
Constant Field Values

DUPLICATE_NODE_MIXED

protected static final int DUPLICATE_NODE_MIXED
See Also:
Constant Field Values

DUPLICATE_NODE_OTHER

protected static final int DUPLICATE_NODE_OTHER
See Also:
Constant Field Values

DUPLICATE_NODE_UNCLOSED

protected static final int DUPLICATE_NODE_UNCLOSED
See Also:
Constant Field Values

DUPLICATE_NODE_BUILDING

protected static final int DUPLICATE_NODE_BUILDING
See Also:
Constant Field Values

DUPLICATE_NODE_BOUNDARY

protected static final int DUPLICATE_NODE_BOUNDARY
See Also:
Constant Field Values

DUPLICATE_NODE_HIGHWAY

protected static final int DUPLICATE_NODE_HIGHWAY
See Also:
Constant Field Values

DUPLICATE_NODE_LANDUSE

protected static final int DUPLICATE_NODE_LANDUSE
See Also:
Constant Field Values

DUPLICATE_NODE_NATURAL

protected static final int DUPLICATE_NODE_NATURAL
See Also:
Constant Field Values

DUPLICATE_NODE_POWER

protected static final int DUPLICATE_NODE_POWER
See Also:
Constant Field Values

DUPLICATE_NODE_RAILWAY

protected static final int DUPLICATE_NODE_RAILWAY
See Also:
Constant Field Values

DUPLICATE_NODE_WATERWAY

protected static final int DUPLICATE_NODE_WATERWAY
See Also:
Constant Field Values

potentialDuplicates

Storage<java.lang.Object> potentialDuplicates
The map of potential duplicates. If there is exactly one node for a given pos, the map includes a pair . If there are multiple nodes for a given pos, the map includes a pair

Constructor Detail

DuplicateNode

public DuplicateNode()
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

buildTestErrors

public java.util.List<TestError> buildTestErrors(Test parentTest,
                                                 java.util.List<Node> nodes)

visit

public void visit(Node n)
Description copied from interface: Visitor
Visiting call for points.

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

fixError

public Command fixError(TestError testError)
Merge the nodes into one. Copied from UtilsPlugin.MergePointsAction

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