Commit 1745865f authored by Riegel's avatar Riegel
Browse files

Code cleaning Ref #69

parent 5a6f4b46
...@@ -23,21 +23,11 @@ import de.hft.stuttgart.citydoctor2.datastructure.FeatureType; ...@@ -23,21 +23,11 @@ import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
/** /**
* Filters the feature type of features * Filters the feature type of features
*
* @author Matthias Betz
* *
* @author Matthias Betz
*/ */
public class TypeFilter implements Filter { public record TypeFilter(FeatureType type) implements Filter {
private FeatureType type;
public TypeFilter(FeatureType type) {
this.type = type;
}
public FeatureType getType() {
return type;
}
@Override @Override
public boolean matches(CityObject co) { public boolean matches(CityObject co) {
......
...@@ -18,14 +18,7 @@ ...@@ -18,14 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.BufferedWriter; import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -56,6 +49,7 @@ public class ValidationConfiguration implements Serializable { ...@@ -56,6 +49,7 @@ public class ValidationConfiguration implements Serializable {
public static final String CHECK_FOR_SOLID_XML = "checkForSolid.xml"; public static final String CHECK_FOR_SOLID_XML = "checkForSolid.xml";
private static final String NUMBER_OF_ROUNDING_PLACES_DEFAULT = "8"; private static final String NUMBER_OF_ROUNDING_PLACES_DEFAULT = "8";
private static final String MIN_VERTEX_DISTANCE_DEFAULT = "0.0001"; private static final String MIN_VERTEX_DISTANCE_DEFAULT = "0.0001";
@Serial
private static final long serialVersionUID = -8020055032177740646L; private static final long serialVersionUID = -8020055032177740646L;
private static final Logger logger = LogManager.getLogger(ValidationConfiguration.class); private static final Logger logger = LogManager.getLogger(ValidationConfiguration.class);
...@@ -179,9 +173,9 @@ public class ValidationConfiguration implements Serializable { ...@@ -179,9 +173,9 @@ public class ValidationConfiguration implements Serializable {
return cConfig; return cConfig;
}); });
} }
globalParameters.computeIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, k -> MIN_VERTEX_DISTANCE_DEFAULT); globalParameters.putIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, MIN_VERTEX_DISTANCE_DEFAULT);
globalParameters.computeIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES, globalParameters.putIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES,
k -> NUMBER_OF_ROUNDING_PLACES_DEFAULT); NUMBER_OF_ROUNDING_PLACES_DEFAULT);
} }
public int getNumberOfRoundingPlaces() { public int getNumberOfRoundingPlaces() {
......
...@@ -93,7 +93,7 @@ public class SelfIntersectionUtil { ...@@ -93,7 +93,7 @@ public class SelfIntersectionUtil {
List<PolygonIntersection> intersections = new ArrayList<>(); List<PolygonIntersection> intersections = new ArrayList<>();
MeshSurface meshSurface = MeshSurface.of(g); MeshSurface meshSurface = MeshSurface.of(g);
Map<Polygon, EdgePolygon> edgePolyMap = new IdentityHashMap<>(); Map<Polygon, EdgePolygon> edgePolyMap = new IdentityHashMap<>();
for (EdgePolygon poly : meshSurface.getPolygons()) { for (EdgePolygon poly : meshSurface.polygons()) {
edgePolyMap.put(poly.getOriginal(), poly); edgePolyMap.put(poly.getOriginal(), poly);
} }
for (int i = 0; i < polygons.size() - 1; i++) { for (int i = 0; i < polygons.size() - 1; i++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment