public function combine(SwatDBRange $range)
    {
        // find leftmost extent
        $offset = min($this->getOffset(), $range->getOffset());

        if ($this->getLimit() === null || $range->getLimit() === null) {
            // rightmost extent is infinite
            $limit = null;
        } else {
            // find rightmost extent and convert to limit with known offset
            $this_limit = $this->getOffset() + $this->getLimit();
            $range_limit = $range->getOffset() + $range->getLimit();
            $limit = max($this_limit, $range_limit) - $offset;
        }

        return new SwatDBRange($limit, $offset);
    }