Search in sources :

Example 1 with NoteMatcher

use of org.opentripplanner.routing.services.notes.NoteMatcher 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;
}
Also used : NoteMatcher(org.opentripplanner.routing.services.notes.NoteMatcher) MatcherAndAlert(org.opentripplanner.routing.services.notes.MatcherAndAlert) Alert(org.opentripplanner.routing.alertpatch.Alert) MatcherAndAlert(org.opentripplanner.routing.services.notes.MatcherAndAlert) T2(org.opentripplanner.common.model.T2)

Aggregations

T2 (org.opentripplanner.common.model.T2)1 Alert (org.opentripplanner.routing.alertpatch.Alert)1 MatcherAndAlert (org.opentripplanner.routing.services.notes.MatcherAndAlert)1 NoteMatcher (org.opentripplanner.routing.services.notes.NoteMatcher)1