Back to project page MVC.
The source code is released under:
Apache License
If you think the Android project MVC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.musselwhizzle.mvc.models; // w w w . j a v a 2 s .c o m import com.musselwhizzle.mvc.events.EventDispatcher; import com.musselwhizzle.mvc.events.SimpleEvent; public class AppModel extends EventDispatcher { public static class ChangeEvent extends SimpleEvent { public static final String ELAPSED_TIME_CHANGED = "elapsedTimeChanged"; public ChangeEvent(String type) { super(type); } } private static AppModel instance; private long elapsedTime = 0; public long getElapsedTime() { return elapsedTime; } public void setElapsedTime(long elapsedTime) { this.elapsedTime = elapsedTime; notifyChange(ChangeEvent.ELAPSED_TIME_CHANGED); } private AppModel() { super(); } public static AppModel getInstance() { if (instance == null) instance = new AppModel(); return instance; } private void notifyChange(String type) { dispatchEvent(new ChangeEvent(type)); } }