nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.distance
Class DistanceFactory

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.distance.DistanceFactory

public class DistanceFactory
extends java.lang.Object

Class for creating a distance function. The Functions are created by creating new static DistanceFactory and then submitting a java.util.Properties object where the 'DistanceFunction' parameter is the simple name of the desired distance function's simple class name.


Method Summary
 DistanceFunction create(java.util.Properties props)
          Create a distance function using the 'DistanceFunction' parameter.
static DistanceFactory newInstance()
          Return a singleton DistanceFactory, creating it if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static DistanceFactory newInstance()
Return a singleton DistanceFactory, creating it if necessary.

Returns:
DistanceFactory

create

public DistanceFunction create(java.util.Properties props)
Create a distance function using the 'DistanceFunction' parameter. Each distance function can be modified using class-specific parameters. Returns null if no distance function is found of the given name. Returns null if the property object either doesn't contain a 'DistanceFunction' property or is null.

Parameters:
props - map of parameters for creating a distance function
Returns:
newly created distance function