use of org.opentripplanner.routing.services.notes.MatcherAndStreetNote in project OpenTripPlanner by opentripplanner.
the class WFSNotePollingGraphUpdater method buildMatcherAndStreetNote.
/**
* Create a MatcherAndStreetNote, 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 MatcherAndStreetNote buildMatcherAndStreetNote(NoteMatcher noteMatcher, StreetNote note) {
T2<NoteMatcher, StreetNote> key = new T2<>(noteMatcher, note);
MatcherAndStreetNote interned = uniqueMatchers.get(key);
if (interned != null) {
return interned;
}
MatcherAndStreetNote ret = new MatcherAndStreetNote(noteMatcher, note);
uniqueMatchers.put(key, ret);
return ret;
}
Aggregations