package epson.print;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

public class ImageItem implements Parcelable {
    public static final Creator CREATOR = new Creator() {
        public ImageItem createFromParcel(Parcel parcel) {
            return new ImageItem(parcel);
        }

        public ImageItem[] newArray(int i) {
            return new ImageItem[i];
        }
    };
    private Bitmap bitmap;
    private long databaseId;
    private String path;
    private int selected;

    public int describeContents() {
        return 0;
    }

    public ImageItem() {
        bitmap = null;
        selected = 0;
        path = null;
        databaseId = -1;
    }

    public ImageItem(Bitmap bitmap2, int i, String str, long j) {
        bitmap = bitmap2;
        selected = i;
        path = str;
        databaseId = j;
    }

    public ImageItem(Parcel parcel) {
        readFromParcel(parcel);
    }

    public Bitmap getBitmap() {
        return bitmap;
    }

    public void setBitmap(Bitmap bitmap2) {
        bitmap = bitmap2;
    }

    public int getSelected() {
        return selected;
    }

    public void setSelected(int i) {
        selected = i;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String str) {
        path = str;
    }

    public long getDatabaseId() {
        return databaseId;
    }

    public void setDatabaseId(long j) {
        databaseId = j;
    }

    public static Creator getCREATOR() {
        return CREATOR;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(this.bitmap, 0);
        parcel.writeInt(this.selected);
        parcel.writeString(this.path);
        parcel.writeLong(this.databaseId);
    }

    public void readFromParcel(Parcel parcel) {
        bitmap = (Bitmap) parcel.readParcelable(getClass().getClassLoader());
        selected = parcel.readInt();
        path = parcel.readString();
        databaseId = parcel.readLong();
    }

    public void release() {
        Bitmap bitmap2 = bitmap;
        if (bitmap2 != null) {
            bitmap2.recycle();
            bitmap = null;
        }
    }

    public boolean equals(Object obj) {
        if ((obj instanceof ImageItem) && getDatabaseId() == ((ImageItem) obj).getDatabaseId()) {
            return true;
        }
        return false;
    }
}
