package info.bukova.isspst.ui;

import java.util.List;

public class Check<T> {

	private T member;
	private List<T> list;
	private boolean checked;
	
	public Check(List<T> list, T member) {
		this.member = member;
		this.list = list;
		if (list.contains(member)) {
			checked = true;
		} else {
			checked = false;
		}
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		if (checked && !list.contains(member)) {
			list.add(member);
		} else {
			list.remove(member);
		}
		this.checked = checked;
	}

	public T getMember() {
		return member;
	}
	
	
	
}
