import java.util.*;
public class Model {
	private String state;
	private List views = new ArrayList();
	public Model() {
		state = "Desligado";
	}
	public void addListener(View v) {
		views.add(v);
	}
	public void setEstado(String s) {
		state = s;
		notificar();
	}
	public String getEstado() {
		return state;
	}
	
	private void notificar() {
		Iterator it = views.iterator();
		while(it.hasNext()) {
			View v = (View)it.next();
			v.processar();
		}
	}
}
