org.opentripplanner.transit.raptor.rangeraptor.debug.ParetoSetDebugHandlerAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.transit.raptor.rangeraptor.debug;
import org.opentripplanner.transit.raptor.rangeraptor.view.DebugHandler;
import org.opentripplanner.transit.raptor.util.paretoset.ParetoSet;
import org.opentripplanner.transit.raptor.util.paretoset.ParetoSetEventListener;
/**
* Use this class to attach a debugHandler to a pareto set. The handler will
* be notified about all changes in the set.
*
* @param The {@link ParetoSet} type.
*/
final class ParetoSetDebugHandlerAdapter implements ParetoSetEventListener {
private final DebugHandler debugHandler;
ParetoSetDebugHandlerAdapter(DebugHandler debugHandler) {
this.debugHandler = debugHandler;
}
@Override
public void notifyElementAccepted(T newElement) {
debugHandler.accept(newElement);
}
@Override
public void notifyElementDropped(T element, T droppedByElement) {
debugHandler.drop(element, droppedByElement, null);
}
@Override
public void notifyElementRejected(T element, T droppedByElement) {
debugHandler.reject(element, droppedByElement, null);
}
}