This repository has been archived on 2025-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
aud-2021-h07-gruphi/src/main/java/de/oshgnacknak/gruphi/GruphiBuilder.java

42 lines
1.2 KiB
Java
Raw Normal View History

package de.oshgnacknak.gruphi;
import h07.graph.DirectedGraphFactory;
import java.util.function.BiPredicate;
public class GruphiBuilder {
private Long frameDelay;
private Double velocity;
private Double gridSpacing;
private BiPredicate<Node, Node> neighbourPredicate;
private DirectedGraphFactory<Node, Double> directedGraphFactory;
public GruphiBuilder setFrameDelay(Long frameDelay) {
this.frameDelay = frameDelay;
return this;
}
public GruphiBuilder setVelocity(Double velocity) {
this.velocity = velocity;
return this;
}
public GruphiBuilder setGridSpacing(Double gridSpacing) {
this.gridSpacing = gridSpacing;
return this;
}
public GruphiBuilder setNeighbourPredicate(BiPredicate<Node, Node> neighbourPredicate) {
this.neighbourPredicate = neighbourPredicate;
return this;
}
public GruphiBuilder setDirectedGraphFactory(DirectedGraphFactory<Node, Double> directedGraphFactory) {
this.directedGraphFactory = directedGraphFactory;
return this;
}
public GruphiImpl createGruphi() {
return new GruphiImpl(frameDelay, velocity, gridSpacing, neighbourPredicate, directedGraphFactory);
}
}