/**
  * Initializes a new instance of that class.
  *
  * @param IEnumerable $sequence The base sequence.
  * @param callable $selector The selector for the sort values to use.
  * @param bool $preventKeys Prevent keys or not.
  */
 public function __construct(IEnumerable $sequence, callable $selector, callable $comparer)
 {
     $this->_comparer = $comparer;
     $this->_selector = $selector;
     $this->_sequence = $sequence;
     parent::__construct($sequence);
     $this->resetMe(false);
 }
Beispiel #2
0
 /**
  * Initializes a new instance of that class.
  *
  * @param IEnumerable $grps The sequence of groupings.
  *
  * @throws \System\ArgumentException
  */
 public function __construct($grps)
 {
     $grps = static::asIterator($grps, true);
     $dict = new Dictionary(null, null, null, \sprintf('$x => $x instanceof %s', IGrouping::class));
     while ($grps->valid()) {
         /* @var IGrouping $curGrouping */
         $curGrouping = $grps->current();
         $dict->add($curGrouping->key(), $curGrouping);
         $grps->next();
     }
     parent::__construct($dict);
 }
Beispiel #3
0
 /**
  * Initializes a new instance of that class.
  *
  * @param mixed $value The value to wrap (as string).
  */
 public function __construct($value = '')
 {
     $this->_wrappedValue = static::valueToString($value);
     parent::__construct($this->createStringIterator());
 }