// Path: app/src/main/java/com/sjcqs/rawlauncher/items/Item.java
// public abstract class Item implements Shortcutable {
// 
//     public static final Comparator<? super Item> ALPHA_COMPARATOR = new Comparator<Item>() {
//         private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());
// 
//         @Override
//         public int compare(Item app1, Item app2) {
//             return (COLLATOR.compare(app1.getLabel(), app2.getLabel()));
//         }
//     };
//     public static final Comparator<? super Item> REVERSE_ALPHA_COMPARATOR = new Comparator<Item>() {
//         private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());
// 
//         @Override
//         public int compare(Item app1, Item app2) {
//             return -(COLLATOR.compare(app1.getLabel(), app2.getLabel()));
//         }
//     };
//     protected final Drawable icon;
//     protected final Intent intent;
//     protected CharSequence label;
// 
//     protected Item(String label, Drawable drawable, Intent intent){
//         this.label = label;
//         this.icon = drawable;
//         this.intent = intent;
//     }
// 
//     public String getLabel(){
//         return label.toString();
//     }
// 
//     public Drawable getIcon(){
//         return icon;
//     }
// 
//     public Intent getIntent() {
//         return intent;
//     }
// 
//     public String getInput() {
//         return label.toString();
//     }
// 
//     @Override
//     public String toString() {
//         return label + ": " + icon.toString();
//     }
// 
//     @Override
//     public boolean canBeAShortcut() {
//         return false;
//     }
// 
//     public String getDiscriminator() {
//         return getLabel();
//     }
// 
//     public boolean canBeUninstalled() {
//         return false;
//     }
// 
//     public Intent getUninstallIntent() {
//         return null;
//     }
// }


import com.sjcqs.rawlauncher.items.Item;
import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;
package com.sjcqs.rawlauncher.items.suggestions;



/**
 * Created by satyan on 8/25/17.
 */

public class Suggestion extends Item{
    static final Comparator<? super Suggestion> SUGGESTION_COMPARATOR =
            new Comparator<Suggestion>() {
                private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());

                @Override
                public int compare(Suggestion item1, Suggestion item2) {
                    double rate1 = item1.getRate(), rate2 = item2.getRate();
                    int rateCmp = Double.compare(rate1,rate2);
                    return (rateCmp != 0 ?
                            rateCmp : (COLLATOR.compare(item1.getLabel(), item2.getLabel())));
                }
            };
    private final Item item;
    private final double rate;


    public Suggestion(Item item, double rate) {
        super(item.getLabel(),item.getIcon(), item.getIntent());
        this.rate = rate;
        this.item = item;
    }

    public double getRate() {
        return rate;
    }

    public Item getItem() {
        return item;
    }

    @Override
    public String getDiscriminator() {
// Path: app/src/main/java/com/sjcqs/rawlauncher/items/Item.java
// public abstract class Item implements Shortcutable {
// 
//     public static final Comparator<? super Item> ALPHA_COMPARATOR = new Comparator<Item>() {
//         private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());
// 
//         @Override
//         public int compare(Item app1, Item app2) {
//             return (COLLATOR.compare(app1.getLabel(), app2.getLabel()));
//         }
//     };
//     public static final Comparator<? super Item> REVERSE_ALPHA_COMPARATOR = new Comparator<Item>() {
//         private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());
// 
//         @Override
//         public int compare(Item app1, Item app2) {
//             return -(COLLATOR.compare(app1.getLabel(), app2.getLabel()));
//         }
//     };
//     protected final Drawable icon;
//     protected final Intent intent;
//     protected CharSequence label;
// 
//     protected Item(String label, Drawable drawable, Intent intent){
//         this.label = label;
//         this.icon = drawable;
//         this.intent = intent;
//     }
// 
//     public String getLabel(){
//         return label.toString();
//     }
// 
//     public Drawable getIcon(){
//         return icon;
//     }
// 
//     public Intent getIntent() {
//         return intent;
//     }
// 
//     public String getInput() {
//         return label.toString();
//     }
// 
//     @Override
//     public String toString() {
//         return label + ": " + icon.toString();
//     }
// 
//     @Override
//     public boolean canBeAShortcut() {
//         return false;
//     }
// 
//     public String getDiscriminator() {
//         return getLabel();
//     }
// 
//     public boolean canBeUninstalled() {
//         return false;
//     }
// 
//     public Intent getUninstallIntent() {
//         return null;
//     }
// }


// Path: app/src/main/java/com/sjcqs/rawlauncher/items/suggestions/Suggestion.java
import com.sjcqs.rawlauncher.items.Item;
import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;

package com.sjcqs.rawlauncher.items.suggestions;



/**
 * Created by satyan on 8/25/17.
 */

public class Suggestion extends Item{
    static final Comparator<? super Suggestion> SUGGESTION_COMPARATOR =
            new Comparator<Suggestion>() {
                private final Collator COLLATOR = Collator.getInstance(Locale.getDefault());

                @Override
                public int compare(Suggestion item1, Suggestion item2) {
                    double rate1 = item1.getRate(), rate2 = item2.getRate();
                    int rateCmp = Double.compare(rate1,rate2);
                    return (rateCmp != 0 ?
                            rateCmp : (COLLATOR.compare(item1.getLabel(), item2.getLabel())));
                }
            };
    private final Item item;
    private final double rate;


    public Suggestion(Item item, double rate) {
        super(item.getLabel(),item.getIcon(), item.getIntent());
        this.rate = rate;
        this.item = item;
    }

    public double getRate() {
        return rate;
    }

    public Item getItem() {
        return item;
    }

    @Override
    public String getDiscriminator() {
        return item.getDiscriminator();