static int distance(GeneralNameInterface base,GeneralNameInterface test,int incomparable){
switch (base.constrains(test)) {
case GeneralNameInterface.NAME_DIFF_TYPE:
    if (debug != null) {
      debug.println("Builder.distance(): Names are different types");
    }
  return incomparable;
case GeneralNameInterface.NAME_SAME_TYPE:
if (debug != null) {
  debug.println("Builder.distance(): Names are same type but " + "in different subtrees");
}
return incomparable;
case GeneralNameInterface.NAME_MATCH:
return 0;
case GeneralNameInterface.NAME_WIDENS:
break;
case GeneralNameInterface.NAME_NARROWS:
break;
default :
return incomparable;
}
return test.subtreeDepth() - base.subtreeDepth();
}

static int distance ( GeneralNameInterface base , GeneralNameInterface test , int incomparable ) { switch ( base . constrains ( test ) ) { case GeneralNameInterface . NAME_DIFF_TYPE : if ( debug != null ) { debug . println ( "Builder.distance(): Names are different types" ) ; } return incomparable ; case GeneralNameInterface . NAME_SAME_TYPE : if ( debug != null ) { debug . println ( "Builder.distance(): Names are same type but " + "in different subtrees" ) ; } return incomparable ; case GeneralNameInterface . NAME_MATCH : return 0 ; case GeneralNameInterface . NAME_WIDENS : break ; case GeneralNameInterface . NAME_NARROWS : break ; default : return incomparable ; } return test . subtreeDepth ( ) - base . subtreeDepth ( ) ; }
get distance of one generalname from another
