public boolean hasAppointments(Day day) {
return !getIdsForDay(day).isEmpty();
}
public Occurrence searchItem(String searchName, boolean findAgain) {
Occurrence occurrence = null;
searchName = searchName.toLowerCase();
if (searchDay.toInt() >= lastSearchDay.toInt()) {
searchDay = new Day(0);
}
else if (!findAgain) {
searchDay = Day.today();
}
Day currentSearchDay;
for (currentSearchDay = searchDay;
currentSearchDay.toInt() < lastSearchDay.toInt() && occurrence == null;
currentSearchDay = currentSearchDay.add(1)) {
Vector ids = getIdsForDay(currentSearchDay);
for (int i = 0; i < ids.size() && occurrence == null; i++) {
String id = (String)ids.elementAt(i);
String title = ((String)idToTitleMap.get(id)).toLowerCase();
if (title.indexOf(searchName) != -1) {
occurrence = new Occurrence(id, currentSearchDay);
}
}
}
if (occurrence == null) {
DisplayController.playSound(AlertType.WARNING);