示例#1
0
 /**
  * Inserts an item between two nodes
  *
  * @param mixed  $item The item
  * @param Bucket $prev The previous bucket
  * @param Bucket $next The next bucket
  *
  * @return void
  */
 protected function insertBetween($item, Bucket $prev, Bucket $next)
 {
     $bucket = new ItemBucket($item);
     $prev->setNext($bucket);
     $next->setPrev($bucket);
     $bucket->setPrev($prev);
     $bucket->setNext($next);
     $this->current = $bucket;
     $this->count++;
 }
示例#2
0
 /**
  * Inserts a key-value pair between two nodes
  *
  * @param mixed  $key   The key
  * @param mixed  $value The value
  * @param Bucket $prev  The previous bucket
  * @param Bucket $next  The next bucket
  *
  * @return void
  */
 protected function insertBetween($key, $value, Bucket $prev, Bucket $next)
 {
     $bucket = new KeyValueBucket($key, $value);
     $prev->setNext($bucket);
     $next->setPrev($bucket);
     $bucket->setPrev($prev);
     $bucket->setNext($next);
     $this->current = $bucket;
     $this->count++;
 }