/** * {@inheritDoc} * When the bag has not enough space for all object nothing is added and false is returned. */ public function addAll(\blaze\collections\Collection $obj) { if ($obj->count() + $this->count() <= $this->maxCount) { return $this->bag->addAll($obj); } return false; }
/** * {@inheritDoc} * When the list has not enough space for all object nothing is added and false is returned. */ public function addAllAt(\int $index, \blaze\collections\Collection $obj) { if ($obj->count() + $this->count() <= $this->maxCount) { return $this->list->addAllAt($index, $c); } else { return false; } }
public function count() { return $this->collection->count(); }