Ejemplo n.º 1
0
 /** @return First best (practical) matching type */
 public Type best() {
   Type[] list = this.list;
   if (null == list) return null;
   else {
     int count = list.length;
     if (1 == count) return list[0];
     else {
       Type best = null;
       for (int cc = 0; cc < count; cc++) {
         Type test = list[cc];
         if (null == best) best = test;
         else if (test.getQ() > best.getQ()) // (in-order preference when eq(q))
         best = test;
         else if (test.isPractical() && best.isNotPractical()) best = test;
       }
       if (best.isPractical()) return best;
       else return null;
     }
   }
 }