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); }
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); }
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); }