Exemplo n.º 1
0
 int compareTo(HostingUnit h)//Comparison of hosting units by total occupied days per year.
 {
     if (this.GetAnnualBusyDays() > h.GetAnnualBusyDays())
     {
         return(1);
     }
     if (this.GetAnnualBusyDays() < h.GetAnnualBusyDays())
     {
         return(-1);
     }
     if (this.GetAnnualBusyDays() == h.GetAnnualBusyDays())
     {
         return(-1);
     }
     return(0);
 }
Exemplo n.º 2
0
        public int CompareTo(object obj)//Comparison of accommodation units by total occupied days per year.
        {
            HostingUnit hu = (HostingUnit)obj;

            if (this.GetAnnualBusyDays() > hu.GetAnnualBusyDays())
            {
                return(1);
            }
            else if (this.GetAnnualBusyDays() == hu.GetAnnualBusyDays())
            {
                return(0);
            }
            else
            {
                return(-1);
            }
        }