add java examples

This commit is contained in:
hpid91 2020-06-25 16:00:13 +02:00 committed by nojhan
commit d345f67212
19 changed files with 1208 additions and 0 deletions

View file

@ -0,0 +1,19 @@
package patterns.strategy;
import java.util.List;
import java.util.Map;
import patterns.Point;
/**
*
* @author pouyllau
*
*/
public abstract class Transit {
public abstract double transit(Point p, List<Point> neighbors, Map<Point, Double> costs);
public static boolean hasCost(Point p ,Map<Point, Double> costs) {
return (costs.get(p) != null && costs.get(p) != Double.POSITIVE_INFINITY);
}
}