public static void registerMeasure(int measureType,String measureName,Class<? extends DistanceMeasure> measureClass){
  String[] newTypeNames=new String[MEASURE_ARRAYS[measureType].length + 1];
  System.arraycopy(MEASURE_ARRAYS[measureType],0,newTypeNames,0,MEASURE_ARRAYS[measureType].length);
  newTypeNames[newTypeNames.length - 1]=measureName;
  MEASURE_ARRAYS[measureType]=newTypeNames;
  Class[] newTypeClasses=new Class[MEASURE_CLASS_ARRAYS[measureType].length + 1];
  System.arraycopy(MEASURE_CLASS_ARRAYS[measureType],0,newTypeClasses,0,MEASURE_CLASS_ARRAYS[measureType].length);
  newTypeClasses[newTypeClasses.length - 1]=measureClass;
  MEASURE_CLASS_ARRAYS[measureType]=newTypeClasses;
}

public static void registerMeasure ( int measureType , String measureName , Class < ? extends DistanceMeasure > measureClass ) { String [ ] newTypeNames = new String [ MEASURE_ARRAYS [ measureType ] . length + 1 ] ; System . arraycopy ( MEASURE_ARRAYS [ measureType ] , 0 , newTypeNames , 0 , MEASURE_ARRAYS [ measureType ] . length ) ; newTypeNames [ newTypeNames . length - 1 ] = measureName ; MEASURE_ARRAYS [ measureType ] = newTypeNames ; Class [ ] newTypeClasses = new Class [ MEASURE_CLASS_ARRAYS [ measureType ] . length + 1 ] ; System . arraycopy ( MEASURE_CLASS_ARRAYS [ measureType ] , 0 , newTypeClasses , 0 , MEASURE_CLASS_ARRAYS [ measureType ] . length ) ; newTypeClasses [ newTypeClasses . length - 1 ] = measureClass ; MEASURE_CLASS_ARRAYS [ measureType ] = newTypeClasses ; }
this method allows registering distance or similarity measures defined in plugins . there are four different types of measures : mixed measures coping with examples containing nominal and numerical values . numerical and nominal measures work only on their respective type of attribute . divergences are a less restricted mathematical concept than distances but might be used for some algorithms not needing this restrictions . this type has to be specified using the first parameter .
