package hh.dejsem.fm;

import android.widget.CheckBox;

/**
 * record of attributes of the file
 */
class FileAttrs {
	String name;
	long size;
	long date;
	CheckBox cb = null;
	boolean checked = false;
	boolean typeDir = true;

	FileAttrs(String name, long size, long date) {
		this.name = name;
		this.size = size;
		this.date = date;
		typeDir = (size < 0);
	}

	boolean isChecked() { return cb == null ? checked : cb.isChecked(); }

	FileAttrs setChecked(boolean checked) {
		if(cb == null) this.checked = checked; else cb.setChecked(checked);
		return this;
	}

	boolean isDir() { return typeDir; }

	boolean isFile() { return !typeDir; }
}
