(earliest==null||it.cur().date.after(earliest));
case ARRIVAL: return (latest == null || it.cur().arrival.before(latest)) &&
(earliest == null || it.cur().arrival.after(earliest));
- case SIZE: return it.cur().size() >= min && it.cur().size() <= max;
- case HEADER: return it.cur().headers.gets(key) != null &&
- ((String)it.cur().headers.gets(key)).toLowerCase().indexOf(text.toLowerCase()) != -1;
- case BODY: return it.cur().body.toLowerCase().indexOf(text.toLowerCase()) != -1;
- case FULL: return it.cur().body.toLowerCase().indexOf(text.toLowerCase()) != -1 ||
- it.cur().headers.raw.indexOf(text) != -1;
+ case HEADER: return it.cur().headers.get(key) != null &&
+ ((String)it.cur().headers.get(key)).toLowerCase().indexOf(text.toLowerCase()) != -1;
case DELETED: return it.deleted();
case SEEN: return it.seen();
case FLAGGED: return it.flagged();
case DRAFT: return it.draft();
case ANSWERED: return it.answered();
case RECENT: return it.recent();
+
+ // FIXME: super inefficient
+ case BODY: throw new RuntimeException("BODY searches are not supported because they are slow");
+ case FULL: throw new RuntimeException("FULL searches are not supported because they are slow");
+ case SIZE: throw new RuntimeException("SIZE searches are not supported because Adam is lame");
+ //return it.cur().size() >= min && it.cur().size() <= max;
+
default: throw new Error("this should not happen");
}
}