public function __construct(TMap $map, $startIndex, $count)
{
$this->_map = $map;
$this->_index = 0;
$this->_startIndex = $startIndex;
if ($startIndex + $count > $map->getCount()) {
$this->_count = $map->getCount() - $startIndex;
} else {
$this->_count = $count;
}
$this->_iterator = $map->getIterator();
}