Esempio n. 1
0
 /**
  * {@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;
 }
Esempio n. 2
0
 /**
  * {@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();
 }