Ejemplo n.º 1
0
 private function write($address, $key, $value = 1)
 {
     $position = $address * $this->fullLength;
     $key = $this->fix($key, $this->length);
     $value = $this->fix($value, $this->addressLength);
     $this->storage->write($position, $key . $value);
 }
Ejemplo n.º 2
0
 private function write($address, $key, $value = 1, $next = null)
 {
     $position = $address * $this->fullLength;
     $key = $this->fix($key, $this->length);
     $value = $this->fix($value, $this->addressLength);
     $next = $next === null ? '' : $this->fix($next, $this->addressLength);
     $this->storage->write($position, $key . $value . $next);
 }
Ejemplo n.º 3
0
 private function updateParent($address, $value)
 {
     $position = ($address + 1) * $this->fullLength - $this->addressLength * 3;
     if ($value < 0) {
         $this->topAddress = $address;
     }
     $value = $this->fix($value, $this->addressLength);
     $this->storage->write($position, $value);
 }