Пример #1
0
 private int copmareDrug(Drug d) {
   if (!hasDrug()) return d.hasDrug() ? 1 : 0;
   else if (!d.hasDrug()) return -1;
   else {
     int c = drug.compareTo(d.getDrug());
     return c;
   }
 }
Пример #2
0
 public void addTrade(Drug drug) {
   if (trade == null) trade = new ArrayList<Drug>();
   trade.add(drug);
   drug.setGeneric(this);
 }