@Override public int compareTo(ComponentDescription o){
  int myPos=0;
  int oPos=0;
  if (this instanceof LanguageComponentDescription) {
    myPos=5;
  }
 else   if (this instanceof VoiceComponentDescription) {
    myPos=10;
  }
  if (o instanceof LanguageComponentDescription) {
    oPos=5;
  }
 else   if (o instanceof VoiceComponentDescription) {
    oPos=10;
  }
  if (oPos - myPos != 0) {
    return (oPos - myPos);
  }
  return name.compareTo(o.name);
}

@ Override public int compareTo ( ComponentDescription o ) { int myPos = 0 ; int oPos = 0 ; if ( this instanceof LanguageComponentDescription ) { myPos = 5 ; } else if ( this instanceof VoiceComponentDescription ) { myPos = 10 ; } if ( o instanceof LanguageComponentDescription ) { oPos = 5 ; } else if ( o instanceof VoiceComponentDescription ) { oPos = 10 ; } if ( oPos - myPos != 0 ) { return ( oPos - myPos ) ; } return name . compareTo ( o . name ) ; }
define a natural ordering for component descriptions . languages first , in alphabetic order , then voices , in alphabetic order .
