Package com.jgaap.generics

Examples of com.jgaap.generics.DistanceFunction


    }
    return builder.build();
  }
 
  public static DistanceFunction getDistanceFunction(String action) throws Exception{
    DistanceFunction distanceFunction;
    String[] tmp = action.split("\\|", 2);
    action = tmp[0].trim().toLowerCase();
    if(distanceFunctions.containsKey(action)){
      distanceFunction= distanceFunctions.get(action).getClass().newInstance();
    }else{
      throw new Exception("Distance Function "+action+" was not found!");
    }
    if(tmp.length > 1) {
      distanceFunction.setParameters(tmp[1]);
    }
    return distanceFunction;
  }
View Full Code Here


   * @return - a reference to the generated DistanceFunction
   * @throws Exception - if the AnalysisDriver does not extend NeighborAnalysisDriver or if the DistanceFunction cannot be found the DistanceFunction cannot be instanced
   */
  public DistanceFunction addDistanceFunction(String action,
      AnalysisDriver analysisDriver) throws Exception {
    DistanceFunction distanceFunction = DistanceFunctions
        .getDistanceFunction(action);
    return addDistanceFunction(distanceFunction, analysisDriver);
  }
View Full Code Here

TOP

Related Classes of com.jgaap.generics.DistanceFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.