public function setLimits($offset, $limit, $max = 0, $cutoff = 0)
    {
        assert(is_int($offset));
        assert(is_int($limit));
        assert(is_int($max));
        assert(is_int($cutoff));
        assert($offset >= 0);
        assert($limit > 0);
        assert($max >= 0);
        assert($cutoff >= 0);

        $this->_offset = $offset;
        $this->_limit = $limit;
        if ($max > 0) {
            $this->_maxmatches = $max;
        }
        if ($cutoff > 0) {
            $this->_cutoff = $cutoff;
        }

        return $this;
    }