public function setMax($max)
    {
        if (null === $max) {
            $this->_max = null;
        } else if ($max < $this->_min) {
            /**
             * @see Zend_Validate_Exception
             */
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception(
                "The maximum must be greater than or equal to the minimum length, but "
                . "$max < $this->_min"
            );
        } else {
            $this->_max = (integer) $max;
        }

        return $this;
    }