コード例 #1
0
 @Override
 public boolean equals(Object o) {
   if (!(o instanceof DriverInfo)) return false;
   DriverInfo a = (DriverInfo) o;
   if (!this.getShortName().equals(a.getShortName())) return false;
   return a.getDriver() == this.getDriver();
 }
コード例 #2
0
 public int compareTo(DriverInfo o) {
   int c = this.getShortName().compareTo(o.getShortName());
   if (c != 0) {
     return c;
   } else {
     String cn1 = this.getClassName();
     String cn2 = o.getClassName();
     if ((cn1 != null) && (cn2 != null)) {
       return cn1.compareTo(cn2);
     } else {
       if (cn1 == null) {
         return 1;
       } else {
         return -1;
       }
     }
   }
 }