{@inheritDoc}

@throws OutOfRangeException If the offset is invalid.
775041
public function offsetGet($offset)
    {
        if (null === ($token = $this->getToken($offset))) {
            throw OutOfRangeException::create(
                'No value is set at offset %d.',
                $offset
            );
        }

        return $token;
    }
767292
public function indexOf(self $str, $offset = 0, MStringComparison $cmp = null){
		
		if(!$this->offsetExists($offset)){
			throw new \OutOfRangeException('$offset is invalid');
		}
		
		if($cmp === null || $cmp->Value === MStringComparison::CASE_SENSITIVE){
			$index = \mb_strpos($this->_Value, $str->_Value, $offset, $this->_Encoding);
		}
		else{
			$index = \mb_stripos($this->_Value, $str->_Value, $offset, $this->_Encoding);
		}
		
		return $index !== false ? $index : static::NO_INDEX;
		
	}
1278675
protected function calculateOffset()
    {
        if (empty($this->page) || empty($this->perPage)) {
            throw new \RuntimeException('Cannot calculate offset. Insufficient data');
        }

        $this->offset = ($this->page - 1) * $this->perPage;
    }
1058348
public function offsetGet($offset)
    {
        if (isset($this->source[$offset])) {
            return $this->source[$offset];
        }
        throw new OutOfRangeException("Index $offset not in list");
    }
1077719
@Override
    public boolean isBoundary(int offset) {
        checkOffset(offset, fText);

        // the beginning index of the iterator is always a boundary position by definition
        if (offset == fText.getBeginIndex()) {
            first();       // For side effects on current position, tag values.
            return true;
        }

        if (offset == fText.getEndIndex()) {
            last();       // For side effects on current position, tag values.
            return true;
        }

        // otherwise, we can use following() on the position before the specified
        // one and return true if the position we get back is the one the user
        // specified

        // return following(offset - 1) == offset;
        // TODO:  check whether it is safe to revert to the simpler offset-1 code
        //         The safe rules may take care of unpaired surrogates ok.
        fText.setIndex(offset);
        previous32(fText);
        int  pos = fText.getIndex();
        boolean result = following(pos) == offset;
        return result;
    }
547519
public function offsetGet($offset)
    {
        $offset = $this->sanitizeOffset($offset);

        if (!$this->offsetExists($offset)) {
            throw new \OutOfBoundsException($offset);
        }

        return $this->data[$offset];
    }
787102
int lastZeroInRange(int from, int to) {
		if (from < 0) throw new IllegalArgumentException();
		if (to < from) throw new IllegalArgumentException();
		from += start;
		to += start;
		if (to > finish) throw new IllegalArgumentException();
		return lastZeroInRangeAdj(from, to) - start;
	}
267501
public function current(): Logger
    {
        if (null === ($id = key($this->keys))) {
            throw new \OutOfRangeException('Current position of pointer is out of range.');
        }
        return $this->offsetGet($id);
    }
956044
protected void checkOffset(long offset) {
    if (offset(offset) < this.offset) {
      throw new IndexOutOfBoundsException();
    } else if (limit == -1) {
      if (offset > maxCapacity)
        throw new IndexOutOfBoundsException();
    } else {
      if (offset > limit)
        throw new IndexOutOfBoundsException();
    }
  }
373931
protected function validateOffset(): void
    {
        $offset = $this->getArrayValue($this->joryArray, ['ofs', 'offset']);

        // No offset set, that's ok. return.
        if ($offset === null) {
            return;
        }

        if (! is_int($offset)) {
            throw new JoryException('The offset parameter should be an integer value. (Location: '.$this->address.'offset)');
        }
    }
163993
public function popField()
    {
        if ($this->getCount() > 0) {
            $fields = $this->removeFieldAtIndex($this->getCount() - 1);
            return $fields[0];
        }

        throw new \OutOfRangeException("Can't call popField when the field count is 0");
    }
1154757
public function move($offset_from, $offset_to)
	{
		if
		(
			   $this->offsetExists($offset_from)
			&& $this->offsetExists($offset_to)
		)
		{
			$this->add($offset_to, $this->remove($offset_from));
		}
		else
		{
			throw new OutOfRangeException('Offset invalid or out of range');
		}
	}
267290
public function setHorizontalPrecision(float $horizontalPrecision): void
    {
        if ($horizontalPrecision < 0 || $horizontalPrecision > 90000000.0) {
            throw new \OutOfRangeException('The horizontal precision must be on [0, 90000000.0].');
        }

        $this->horizontalPrecision = (float) $horizontalPrecision;
    }
633732
public function offsetUnset($offset)
    {
        !is_int($offset) and trigger_error(
            __CLASS__ . '::' . __FUNCTION__ . '() : Only accepts integer offsets',
            E_USER_WARNING
        );
        if (is_int($offset) and isset($this->_elements[$offset])) {
            unset($this->_elements[$offset]);
            $this->_count = count($this->_elements);
        }
    }
1369403
public JBBPNumericField findForFieldOffset(final int offset) {
    JBBPNumericField result = null;
    for (final Map.Entry<JBBPNamedFieldInfo, JBBPNumericField> f : fieldMap.entrySet()) {
      if (f.getKey().getFieldOffsetInCompiledBlock() == offset) {
        result = f.getValue();
        break;
      }
    }
    return result;
  }
458603
private function calculateOffset()
    {
        // When no limit is provided, all items are on one page, so the offset is unreasonable
        if (! $this->hasLimit()) {
            $this->setOffset(0);
            return;
        }

        $offset = ($this->getPage() * $this->getLimit()) - $this->getLimit();

        $this->setOffset((int)$offset);
    }
234069
public function setVerticalPrecision(float $verticalPrecision): void
    {
        if ($verticalPrecision < 0 || $verticalPrecision > 90000000.0) {
            throw new \OutOfRangeException('The vertical precision must be on [0, 90000000.0].');
        }

        $this->verticalPrecision = $verticalPrecision;
    }