package epson.print;

import android.graphics.drawable.Drawable;

import java.util.Comparator;

public class IconifiedText implements Comparable<IconifiedText>, Comparator<IconifiedText> {
    private Drawable mIcon;
    private boolean mIsFolder = false;
    private boolean mSelectable = true;
    private String mText = "";

    public IconifiedText() {
    }

    public IconifiedText(String str, Drawable drawable, boolean z) {
        mIcon = drawable;
        mText = str;
        mIsFolder = z;
    }

    public boolean isSelectable() {
        return mSelectable;
    }

    public void setSelectable(boolean z) {
        mSelectable = z;
    }

    public boolean ismIsFolder() {
        return mIsFolder;
    }

    public String getText() {
        return mText;
    }

    public void setText(String str) {
        mText = str;
    }

    public void setIcon(Drawable drawable) {
        mIcon = drawable;
    }

    public Drawable getIcon() {
        return mIcon;
    }

    public int compareTo(IconifiedText iconifiedText) {
        String str = mText;
        if (str != null) {
            return str.compareTo(iconifiedText.getText());
        }
        throw new IllegalArgumentException();
    }

    public int compare(IconifiedText iconifiedText, IconifiedText iconifiedText2) {
        if (iconifiedText == null || iconifiedText2 == null) {
            return 0;
        }
        if (iconifiedText.mText.equalsIgnoreCase(CommonDefine.DOT)) {
            return -1;
        }
        if (iconifiedText2.mText.equalsIgnoreCase(CommonDefine.DOT)) {
            return 1;
        }
        return iconifiedText.mText.compareToIgnoreCase(iconifiedText2.mText);
    }
}
