use of org.opentripplanner.routing.services.notes.MatcherAndAlert in project OpenTripPlanner by opentripplanner.
the class WFSNotePollingGraphUpdater method buildMatcherAndAlert.
/**
* Create a MatcherAndAlert, interning it if the note and matcher pair is already created. Note:
* we use the default Object.equals() for matchers, as they are mostly already singleton
* instances.
*/
private MatcherAndAlert buildMatcherAndAlert(NoteMatcher noteMatcher, Alert note) {
T2<NoteMatcher, Alert> key = new T2<>(noteMatcher, note);
MatcherAndAlert interned = uniqueMatchers.get(key);
if (interned != null) {
return interned;
}
MatcherAndAlert ret = new MatcherAndAlert(noteMatcher, note);
uniqueMatchers.put(key, ret);
return ret;
}
Aggregations