Get wether or not the current cell ends a row (is the last one on the row)

@param integer $position Optional. Forced position.
@return boolean
768065
public function cellEndsRow($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }

        $cellNum = $this->cellRowIndex($position);
        $numCells = $this->rowNumCells($position);

        return ($cellNum >= ($numCells-1));
    }
630399
protected function decrementPositionsOfItemsBelow($position = null)
    {
        if ($this->isNotInList()) return;

        if (null === $position) {
            $position = $this->getListifyPosition();
        }

        $this->listifyScopedQuery()
            ->where($this->positionColumn(), '>', $position)
            ->decrement($this->positionColumn());
    }
289159
public function cellRowIndex($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }
        $first = $this->rowFirstCellIndex($position);

        return ($position - $first);
    }
1150369
public function setPosition($position)
    {
        $oldPosition = $this->owner->{$this->positionAttribute};
        $transaction = $this->owner->getDb()->beginTransaction();
        try {
            $isUp = ($position - $oldPosition) > 0;
            $counters = [$this->positionAttribute => $isUp ? -1 : 1];
            $condition = [
                'between',
                $this->positionAttribute,
                $isUp ? $oldPosition : $position,
                $isUp ? $position : $oldPosition,
            ];
            $this->owner->updateAllCounters($counters, $condition);

            $this->owner->{$this->positionAttribute} = $position;
            $this->owner->save();

            $transaction->commit();

            return true;
        } catch (\Exception $e) {
            $transaction->rollBack();
            Yii::error($e);

            return false;
        }
    }
281651
public function getNodeAt($position) {
        if (0 <= $position && $position <= count($this->nodes) - 1) {
            return $this->nodes[$position];
        }
        return null;
    }
1083013
public function last(?string $key = null)
    {
        $value = $this->get($key);

        if (is_array($value)) {
            return end($value);
        }

        return $value;
    }
1058360
public function setPosition($position = self::POSITION_RIGHT) {
		if (!in_array($position,self::$_positionXLref)) {
			return false;
		}

		$this->_position = $position;
		return true;
	}
366749
public function offsetGet($offset)
    {
        if (is_int($offset)) {
            return $this->contents[$offset];
        } elseif ($offset == ':last') {
            // Shortcut for fetching the last item in the Collection:
            return $this->contents[count($this->contents) - 1];
        } else {
            return $this->callSelector($offset);
        }
    }
82629
public function setPosition($position)
    {
        if (in_array($position, [self::ADDON_LEFT, self::ADDON_RIGHT])) {
            $this->position = $position;
        }

        return $this;
    }
291843
public function getPositionAfter(TablePosition $position, $offset = 1)
    {
        $cellsToMove = $offset;
        $newRow = $position->getRow();
        $newCell = $position->getCell();

        while ($cellsToMove > 0 && $newRow < count($this->rows)) {
            $cellCount = count($this->getRow($newRow)->getCells());

            $cellsLeft = $cellCount - $newCell - 1;

            if ($cellsToMove > $cellsLeft) {
                ++$newRow;
                $cellsToMove -= $cellsLeft - 1;
                $newCell = 0;
            } else {
                $newCell = $newCell + $cellsToMove;
                $cellsToMove -= $cellsLeft;
            }
        }

        if ($newRow >= 0 && $newCell >= 0) {
            return new TablePosition($newRow, $newCell);
        }

        return;
    }
1132941
public function isEmptyLine($position = self::CURRENT_POSITION)
    {
        $line = $this->getCurrentLine($position);
        return (0 === strlen(trim($line)));
    }
310975
public function getNextAfterLastPosition($parentId = false)
    {
        $position = $this->getLastPosition($parentId);
        return $position === null ? 0 : $position + 1;
    }
851997
public function charAt($position)
    {
        if (isset($this->stringVar[$position])) {
            return $this->stringVar[$position];
        }
        return false;
    }
519908
protected static function handleColumnPosition($position)
    {
        $query = static::getQuery();

        if (!$position) {
            return null;
        }

        $posColumn = '';

        $position = trim($position);

        if (strpos(strtoupper($position), 'AFTER') !== false) {
            list($position, $posColumn) = explode(' ', $position, 2);

            $posColumn = $query->quoteName($posColumn);
        }

        return $position . ' ' . $posColumn;
    }
1196549
protected function getLastChildPosition()
    {
        $lastChild = $this->getLastChild([$this->getPositionColumn()]);

        return (is_null($lastChild) ? 0 : $lastChild->position);
    }
37485
public function cellStartsRow($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }

        return ($this->cellRowIndex($position) === 0);
    }
1079245
private function delete(int $position)
    {
        $pair  = $this->pairs[$position];
        $value = $pair->value;

        array_splice($this->pairs, $position, 1, null);
        $this->checkCapacity();

        return $value;
    }