public function init()
{
$collector = new RouteCollector(new StdRouteParser(), new GroupCountBasedDataGenerator());
foreach ($this->routes as $route) {
foreach ($route->definition($this->container) as list($method, $route_name, $handler_name)) {
$collector->addRoute($method, $route_name, $handler_name);
}
}
$this->dispatcher = new GroupCountBasedDispatcher($collector->getData());
}