public function __construct(ICollection &$collection) { $this->collection = $collection; $this->buildIndex(); }