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

Code cleaning Ref #69

parent 5a6f4b46
......@@ -25,19 +25,9 @@ import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
* Filters the feature type of features
*
* @author Matthias Betz
*
*/
public class TypeFilter implements Filter {
private FeatureType type;
public record TypeFilter(FeatureType type) implements Filter {
public TypeFilter(FeatureType type) {
this.type = type;
}
public FeatureType getType() {
return type;
}
@Override
public boolean matches(CityObject co) {
......
......@@ -18,14 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import java.io.BufferedWriter;
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.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
......@@ -56,6 +49,7 @@ public class ValidationConfiguration implements Serializable {
public static final String CHECK_FOR_SOLID_XML = "checkForSolid.xml";
private static final String NUMBER_OF_ROUNDING_PLACES_DEFAULT = "8";
private static final String MIN_VERTEX_DISTANCE_DEFAULT = "0.0001";
@Serial
private static final long serialVersionUID = -8020055032177740646L;
private static final Logger logger = LogManager.getLogger(ValidationConfiguration.class);
......@@ -179,9 +173,9 @@ public class ValidationConfiguration implements Serializable {
return cConfig;
});
}
globalParameters.computeIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, k -> MIN_VERTEX_DISTANCE_DEFAULT);
globalParameters.computeIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES,
k -> NUMBER_OF_ROUNDING_PLACES_DEFAULT);
globalParameters.putIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, MIN_VERTEX_DISTANCE_DEFAULT);
globalParameters.putIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES,
NUMBER_OF_ROUNDING_PLACES_DEFAULT);
}
public int getNumberOfRoundingPlaces() {
......
......@@ -93,7 +93,7 @@ public class SelfIntersectionUtil {
List<PolygonIntersection> intersections = new ArrayList<>();
MeshSurface meshSurface = MeshSurface.of(g);
Map<Polygon, EdgePolygon> edgePolyMap = new IdentityHashMap<>();
for (EdgePolygon poly : meshSurface.getPolygons()) {
for (EdgePolygon poly : meshSurface.polygons()) {
edgePolyMap.put(poly.getOriginal(), poly);
}
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