com.github.TKnudsen.ComplexDataObject.model.distanceMeasure.Double.DoubleDistanceMeasureTools Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of complex-data-object Show documentation
Show all versions of complex-data-object Show documentation
A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.
The newest version!
package com.github.TKnudsen.ComplexDataObject.model.distanceMeasure.Double;
import java.util.Arrays;
import java.util.List;
/**
*
* Title: DoubleDistanceMeasureTools
*
*
*
* Description:
*
*
*
* Copyright: Copyright (c) 2018
*
*
* @author Juergen Bernard
* @version 1.01
*/
public class DoubleDistanceMeasureTools {
public static DoubleDistanceMeasure getDistFunction(String distanceFunctionName) {
DoubleDistanceMeasure distFunction = null;
switch (distanceFunctionName) {
case "EuclideanDistance":
distFunction = new EuclideanDistanceMeasure();
break;
case "ManhattanDistance":
distFunction = new ManhattanDistanceMeasure();
break;
case "ChebyshevDistance":
distFunction = new ChebyshevDistance();
break;
default:
System.err.println(
"DoubleDistanceMeasureTools: unknown distance function name. returning Euclidean Distance.");
distFunction = new EuclideanDistanceMeasure();
break;
}
return distFunction;
}
public static List distanceMeasures() {
return Arrays.asList(new String[] { "EuclideanDistance", "ChebyShevDistanceMeasure", "ManhattanDistance" });
}
}