A search in ArrayList for an existing element will lead you to O (n) in the case of a sorted ArrayList (for example, you will sort records), this will take O (logn) time. Therefore, to achieve the desired functionality, I would use the map structure, indexing by title, and then by date. Something like that:
Map<String, Map<Date, Record>> records = new HashMap<>();
Map<Date, Record> subRecords = new HashMap<>();
subRecords.put(recordDate, new Record(id, title, time, duration));
records.put(recordId, subRecords)
sub = records.get(someTitle);
if (sub != null) {
record = sub.get(someDate);
if (record != null) {
record.updateTime(newTime);
}
}
Map of Map equals hashCode, , Map<String, Map<Date, Record>>
. O (1) . , , Title Date, , .