Skip to content
Snippets Groups Projects
Commit a43d8d6d authored by guyslain.naves's avatar guyslain.naves
Browse files

remove some warnings and inspection problems

parent 640fad68
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,6 @@ package fr.univamu.graph; ...@@ -3,8 +3,6 @@ package fr.univamu.graph;
import fr.univamu.helpers.Iterations; import fr.univamu.helpers.Iterations;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -15,7 +13,7 @@ public class UndirectedGraph { ...@@ -15,7 +13,7 @@ public class UndirectedGraph {
private int order; private int order;
private int edgeCardinality; private int edgeCardinality;
List<List<Edge>> adjacencies; final List<List<Edge>> adjacencies;
public boolean isVertex(int index) { public boolean isVertex(int index) {
......
...@@ -4,9 +4,7 @@ import fr.univamu.graph.EmbeddedGraph; ...@@ -4,9 +4,7 @@ import fr.univamu.graph.EmbeddedGraph;
import fr.univamu.graph.UndirectedGraph; import fr.univamu.graph.UndirectedGraph;
import fr.univamu.helpers.Point; import fr.univamu.helpers.Point;
import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import java.util.function.Supplier;
public class ErdosRenyi implements EmbeddedGraph { public class ErdosRenyi implements EmbeddedGraph {
......
...@@ -24,7 +24,6 @@ public class NodeStats { ...@@ -24,7 +24,6 @@ public class NodeStats {
public NodeStats(RootedTree tree) { public NodeStats(RootedTree tree) {
this.tree = tree;
int maxVertex = tree.maxNode(); int maxVertex = tree.maxNode();
for (int vertex = 0; vertex < maxVertex + 1; vertex++) { for (int vertex = 0; vertex < maxVertex + 1; vertex++) {
stats.add(null); stats.add(null);
...@@ -33,8 +32,6 @@ public class NodeStats { ...@@ -33,8 +32,6 @@ public class NodeStats {
} }
private final RootedTree tree;
private final List<Stats> stats = new ArrayList<>(); private final List<Stats> stats = new ArrayList<>();
private record Stats(int height, int depth, int degree, int size) { private record Stats(int height, int depth, int degree, int size) {
......
...@@ -27,7 +27,7 @@ public record RootedTree(int root, List<RootedTree> children) ...@@ -27,7 +27,7 @@ public record RootedTree(int root, List<RootedTree> children)
} }
public Iterable<RootedTree> bfsIterable() { public Iterable<RootedTree> bfsIterable() {
return this::iterator; return this;
} }
public Iterable<RootedTree> dfsIterable() { public Iterable<RootedTree> dfsIterable() {
...@@ -77,7 +77,6 @@ public record RootedTree(int root, List<RootedTree> children) ...@@ -77,7 +77,6 @@ public record RootedTree(int root, List<RootedTree> children)
.filter(v -> !rootParent.equals(Optional.of(v))) .filter(v -> !rootParent.equals(Optional.of(v)))
.map(v -> getNode(v,graph,toParent)) .map(v -> getNode(v,graph,toParent))
.toList(); .toList();
;
return new RootedTree(root, children); return new RootedTree(root, children);
} }
......
...@@ -66,9 +66,9 @@ public class Search { ...@@ -66,9 +66,9 @@ public class Search {
} }
private final UndirectedGraph graph; private final UndirectedGraph graph;
Frontier frontier; final Frontier frontier;
BitSet reached; final BitSet reached;
List<Path> paths; final List<Path> paths;
private void process(Path path) { private void process(Path path) {
......
package fr.univamu.helpers; package fr.univamu.helpers;
import fr.univamu.graph.rootedtrees.RootedTree;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
...@@ -91,7 +89,7 @@ public class Iterations { ...@@ -91,7 +89,7 @@ public class Iterations {
public static <T> Iterable<T> concat(Iterable<? extends Iterable<T>> iterables) { public static <T> Iterable<T> concat(Iterable<? extends Iterable<T>> iterables) {
return () -> new Iterator<T>() { return () -> new Iterator<T>() {
private Iterator<? extends Iterable<T>> futureIterators = iterables.iterator(); private final Iterator<? extends Iterable<T>> futureIterators = iterables.iterator();
private Iterator<T> currentIterator; private Iterator<T> currentIterator;
{ prepareNext(); } { prepareNext(); }
......
...@@ -52,7 +52,6 @@ public class RainbowDrawingParameters implements DrawingParameters { ...@@ -52,7 +52,6 @@ public class RainbowDrawingParameters implements DrawingParameters {
double saturation = 0.7; double saturation = 0.7;
double brightness = double brightness =
Math.min(100.0, params.brightnessSlope * height + params.minBrightness) / 100.0; Math.min(100.0, params.brightnessSlope * height + params.minBrightness) / 100.0;
Color col = Color.hsb(hue, saturation, brightness); return Color.hsb(hue, saturation, brightness);
return col;
} }
} }
module fr.univamu.randomtree { module fr.univamu.randomtree {
requires javafx.controls; requires javafx.graphics;
requires javafx.fxml; requires javafx.fxml;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment