@@ -0,0 +1,1106 @@
+package com.cse3310.phms.ui.utils.Comparators;%0A%0Aimport com.cse3310.phms.ui.cards.FoodCard;%0Aimport it.gmariotti.cardslib.library.internal.Card;%0A%0Aimport java.util.Comparator;%0A%0Apublic enum FoodCardComparator implements Comparator%3CCard%3E %7B%0A    TITLE_SORT %7B%0A        @Override%0A        public int compare(Card lhs, Card rhs) %7B%0A            return lhs.getTitle().compareTo(rhs.getTitle());%0A        %7D%0A    %7D,%0A%0A    CALORIES_SORT %7B%0A        @Override%0A        public int compare(Card lhs, Card rhs) %7B%0A            return ((FoodCard) lhs).getFood().getCalories() %3E ((FoodCard) rhs).getFood().getCalories() ? 1 : -1;%0A        %7D%0A    %7D;%0A%0A%0A    public static Comparator%3CCard%3E getComparator(final FoodCardComparator... multipleOptions) %7B%0A        return new Comparator%3CCard%3E() %7B%0A            public int compare(Card o1, Card o2) %7B%0A                for (FoodCardComparator option : multipleOptions) %7B%0A                    int result = option.compare(o1, o2);%0A                    if (result != 0) %7B%0A                        return result;%0A                    %7D%0A                %7D%0A                return 0;%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

add FoodCardComparator for sorting