private static final DatabaseFacade m_instance = new DatabaseFacade();
private final LinkedList m_tasks = new LinkedList();
final String[] title = new String[]{"Design DB interface", "Load test data", "User interface design", "Usability test", "Market acceptance study", "Investors demo", "Public press release", "TV interview", "Local radio interview", "Location shooting for promo video", "Government group demo", "Test users screening", "Promo video casting", "Promo video editing", "Audio sweetening", "Sound design", "Games rules evaluation"};
final String[] name = new String[]{"Donald Duck", "Miles Davis", "Leonardo DaVinci", "Rodney Curtis", "Foad Zee"};
final String[] commentText = new String[]{"Revised with management", "Checked budget", "Called Mr.Smith about it, he's ok with the current state", "Asked Fred Flintstone for a budget extension", "Looked at the planning, logistics says we won't make it"};
private DatabaseFacade() {
this.loadTestData();
}
public static DatabaseFacade getInstance() {
return m_instance;
}
public List getTasks() {
return this.m_tasks;
}
public TaskBean getTaskBeanById(int id) throws Exception {
TaskBean result = null;
for(TaskBean tb : this.m_tasks) {
if (tb.getId() == id) {
result = tb;
break;
}
}
if (result == null) {
throw new Exception("Not found: TaskBean having id=" + id);