Class SortStationByLeastOccupied

  • All Implemented Interfaces:
    java.util.Comparator<Station>

    public class SortStationByLeastOccupied
    extends java.lang.Object
    implements java.util.Comparator<Station>
    The SortStationByLeastOccupied class : this class implements an algorithm to sort the stations by the its rate of least occupied
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Station o1, Station o2)
      This method is used to compare two stations
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • SortStationByLeastOccupied

        public SortStationByLeastOccupied()
    • Method Detail

      • compare

        public int compare​(Station o1,
                           Station o2)
        This method is used to compare two stations
        Specified by:
        compare in interface java.util.Comparator<Station>
        Parameters:
        o1 - the station o1
        o2 - the station o2
        Returns:
        an integer that represents whether or not the o1 station is less occupied than the o2 station