public int CompareTo(ICalories food) { double timeThis = this.getCalorieAbsorptionTime(); double timeAnother = food.getCalorieAbsorptionTime(); if (timeThis == timeAnother) { return(0); } return(timeThis > timeAnother ? 1 : -1); }
public int CompareTo(ICalories food) { double timeThis = this.getCalorieAbsorptionTime(); double timeAnother = food.getCalorieAbsorptionTime(); if (timeThis == timeAnother) { return(0); } return(timeThis > timeAnother ? 1 : -1); }