Changeset 6691 in josm
- Timestamp:
- 2014-01-15T20:29:33+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6670 r6691 16 16 import java.util.HashMap; 17 17 import java.util.Map; 18 import java.util.SortedMap; 19 import java.util.TreeMap; 18 20 import java.util.TreeSet; 19 21 … … 123 125 for (Class<Test> testClass : allAvailableTests) { 124 126 try { 125 allTestsMap.put(testClass.get SimpleName(), testClass.newInstance());127 allTestsMap.put(testClass.getName(), testClass.newInstance()); 126 128 } catch (Exception e) { 127 129 Main.error(e); … … 215 217 /** 216 218 * Gets a map from simple names to all tests. 217 * @return A map of all tests, indexed by the simple name of their Java class218 */ 219 public static Map<String, Test> getAllTestsMap() {219 * @return A map of all tests, indexed and sorted by the name of their Java class 220 */ 221 public static SortedMap<String, Test> getAllTestsMap() { 220 222 applyPrefs(allTestsMap, false); 221 223 applyPrefs(allTestsMap, true); 222 return new HashMap<String, Test>(allTestsMap);224 return new TreeMap<String, Test>(allTestsMap); 223 225 } 224 226 … … 234 236 return null; 235 237 } 236 return (T) allTestsMap.get(testClass.get SimpleName());238 return (T) allTestsMap.get(testClass.getName()); 237 239 } 238 240 -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r6648 r6691 45 45 private Map<List<Way>, List<WaySegment>> seenWays; 46 46 47 /** 48 * General crossing ways test. 49 */ 47 50 public static class Ways extends CrossingWays { 51 52 /** 53 * Constructs a new crossing {@code Ways} test. 54 */ 55 public Ways() { 56 super(tr("Crossing ways")); 57 } 48 58 49 59 @Override … … 98 108 } 99 109 110 /** 111 * Crossing boundaries ways test. 112 */ 100 113 public static class Boundaries extends CrossingWays { 114 115 /** 116 * Constructs a new crossing {@code Boundaries} test. 117 */ 118 public Boundaries() { 119 super(tr("Crossing boundaries")); 120 } 101 121 102 122 @Override … … 124 144 } 125 145 146 /** 147 * Crossing barriers ways test. 148 */ 126 149 public static class Barrier extends CrossingWays { 150 151 /** 152 * Constructs a new crossing {@code Barrier} test. 153 */ 154 public Barrier() { 155 super(tr("Crossing barriers")); 156 } 127 157 128 158 @Override … … 142 172 } 143 173 144 public CrossingWays() { 145 super(tr("Crossing ways"), 146 tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node.")); 174 /** 175 * Constructs a new {@code CrossingWays} test. 176 * @param title The test title 177 * @since 6691 178 */ 179 public CrossingWays(String title) { 180 super(title, tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node.")); 147 181 } 148 182 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r6667 r6691 23 23 import org.openstreetmap.josm.data.osm.Node; 24 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 25 import org.openstreetmap.josm.data.osm.OsmUtils;26 25 import org.openstreetmap.josm.data.osm.QuadBuckets; 27 26 import org.openstreetmap.josm.data.osm.Way; … … 43 42 public abstract class UnconnectedWays extends Test { 44 43 44 /** 45 * Unconnected highways test. 46 */ 45 47 public static class UnconnectedHighways extends UnconnectedWays { 46 48 49 /** 50 * Constructs a new {@code UnconnectedHighways} test. 51 */ 52 public UnconnectedHighways() { 53 super(tr("Unconnected highways")); 54 } 55 47 56 @Override 48 57 public boolean isPrimitiveUsable(OsmPrimitive p) { … … 51 60 } 52 61 62 /** 63 * Unconnected railways test. 64 */ 53 65 public static class UnconnectedRailways extends UnconnectedWays { 54 66 67 /** 68 * Constructs a new {@code UnconnectedRailways} test. 69 */ 70 public UnconnectedRailways() { 71 super(tr("Unconnected railways")); 72 } 73 55 74 @Override 56 75 public boolean isPrimitiveUsable(OsmPrimitive p) { … … 59 78 } 60 79 80 /** 81 * Unconnected waterways test. 82 */ 61 83 public static class UnconnectedWaterways extends UnconnectedWays { 62 84 85 /** 86 * Constructs a new {@code UnconnectedWaterways} test. 87 */ 88 public UnconnectedWaterways() { 89 super(tr("Unconnected waterways")); 90 } 91 63 92 @Override 64 93 public boolean isPrimitiveUsable(OsmPrimitive p) { … … 67 96 } 68 97 98 /** 99 * Unconnected natural/landuse test. 100 */ 69 101 public static class UnconnectedNaturalOrLanduse extends UnconnectedWays { 70 102 103 /** 104 * Constructs a new {@code UnconnectedNaturalOrLanduse} test. 105 */ 106 public UnconnectedNaturalOrLanduse() { 107 super(tr("Unconnected natural lands and landuses")); 108 } 109 71 110 @Override 72 111 public boolean isPrimitiveUsable(OsmPrimitive p) { … … 75 114 } 76 115 116 /** 117 * Unconnected power ways test. 118 */ 77 119 public static class UnconnectedPower extends UnconnectedWays { 78 120 121 /** 122 * Constructs a new {@code UnconnectedPower} test. 123 */ 124 public UnconnectedPower() { 125 super(tr("Unconnected power ways")); 126 } 127 79 128 @Override 80 129 public boolean isPrimitiveUsable(OsmPrimitive p) { … … 97 146 98 147 /** 99 * Constructor 100 */ 101 public UnconnectedWays() { 102 super(tr("Unconnected ways"), 103 tr("This test checks if a way has an endpoint very near to another way.")); 148 * Constructs a new {@code UnconnectedWays} test. 149 * @param title The test title 150 * @since 6691 151 */ 152 public UnconnectedWays(String title) { 153 super(title, tr("This test checks if a way has an endpoint very near to another way.")); 104 154 } 105 155
Note:
See TracChangeset
for help on using the changeset viewer.