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; } }
public void addTrade(Drug drug) { if (trade == null) trade = new ArrayList<Drug>(); trade.add(drug); drug.setGeneric(this); }