yeah568

Untitled

Jul 11th, 2014
178
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // EFFECTS: returns a list of todo items whose title and/or description
  2.     // contains the search parameter
  3.     // Note: String comparisons are case sensitive
  4.     public List<TodoItem> filterTodoItemsBySearchTerm(String searchString) {
  5.         ArrayList<TodoItem> temp = new ArrayList<TodoItem>();
  6.         for (TodoItem item : todoItems) {
  7.             if (item.getDescription().toLowerCase().contains(searchString.toLowerCase()) || item.getTitle().toLowerCase().contains(searchString.toLowerCase())) {
  8.                 temp.add(item);
  9.             }
  10.         }
  11.         return temp;
  12.     }
RAW Paste Data