Sets the monoisotopic mass for this modification

@param float $mass
The monoisotopic mass to set
@throws \InvalidArgumentException If argument 1 is not of type float
504885
public function setMonoisotopicMass($mass)
    {
        if (! is_float($mass) && ! is_int($mass)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be a float or integer value. Valued passed is of type ' . gettype($mass));
        }
        
        $this->monoisotopicMass = $mass;
    }
215396
public function setMin($min)
    {
        if (is_int($min) || Format::isVariableRef($max)) {
            $this->min = $min;
        } else {
            $msg = "'Min' must be an integer, '" . gettype($min) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
897628
public function setSize($size)
    {
        if (!is_numeric($size) || $size < 1) {
            throw new \InvalidArgumentException(
                "An invalid identicon size was specified. ".
                "A numeric value >= 1 was expected. Specified value: $size.");
        }
        
        $this->size = (int)$size;
    }
431377
protected function setExchangeRate(float $exchangeRate): void
    {
        if ( ! is_float($exchangeRate)) {
            throw new \InvalidArgumentException(sprintf('ExchangeRate has to be a float. %s given.', gettype($exchangeRate)));
        }

        $this->exchangeRate = $exchangeRate;
    }
902053
public function setObject($object)
    {
        if (! is_object($object)) {
            throw new InvalidArgumentException(
                sprintf('The parameter given to setObject method of %s class is not an object', get_called_class())
            );
        }

        $this->object = $object;
        return $this;
    }
1156178
public function setMasteryValue($masteryValue)
    {
        if ((is_bool($masteryValue) && $masteryValue === false) || is_float($masteryValue) || is_double($masteryValue)) {
            $this->masteryValue = $masteryValue;
        } else {
            $msg = "The masteryValue argument must be a floating point value or false, '" . gettype($masteryValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
112979
public function setStability($stability)
    {
        if ($stability !== self::STABLE && $stability !== self::UNSTABLE && $stability !== self::ANY) {
            throw new InvalidArgumentException(
                'Invalid stability value. Must be one of "stable", "unstable" or "any".'
            );
        }
        $this->stability = $stability;
    }
734521
public function setShape($shape)
    {
        if (in_array($shape, QtiShape::asArray()) === true) {
            $this->shape = $shape;
        } else {
            $msg = "The 'shape' argument must be a value from the Shape enumeration, '" . $shape . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
76993
public function setMax($max) : self
    {
        if (null === $max || (!is_float($max) && !is_int($max))) {
            throw new \InvalidArgumentException('max must be either a float or an integer.');
        }

        $this->max = $max;

        return $this;
    }
945160
public function setType($type)
    {
        if (gettype($type) === 'string') {
            $this->type = $type;
        } else {
            $msg = "Type must be a string, '" . gettype($type) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
579139
public function setMethod($method)
    {
      if(!is_string($method) && strlen(trim($method)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid method, must be a non empty string');

      $this->method = $method;
    }
790155
public function setMin($min)
    {
        $min = (int) $min;

        if ($min < 0) {
            throw new \InvalidArgumentException('Error: Minimum cannot be smaller than zero');
        }
        if ($min > $this->max) {
            // We do not throw an exception but silently adjust the maximum.
            $this->max = $min;
        }

        $this->min = $min;
    }
203952
public function setCardinality($cardinality)
    {
        if (in_array($cardinality, Cardinality::asArray())) {
            $this->cardinality = $cardinality;
        } else {
            $msg = "The cardinality must be a value from the Cardinality enumeration.";
            throw new InvalidArgumentException($msg);
        }
    }
145699
protected function setMetadata($metadata)
    {
        if ($metadata !== null && !($metadata instanceof Metadata)) {
            throw new \InvalidArgumentException('$metadata must be instance of Metadata');
        }

        $this->metadata = $metadata;
    }
489701
protected function setPort($port)
    {
        if ((string)$port !== '' && !$this->isValidPort($port)) {
            throw new \InvalidArgumentException("Invalid port '$port'");
        }
        
        $this->port = $port ? (int)$port : null;
    }
993089
public function setSourceValue($sourceValue)
    {
        if (is_float($sourceValue)) {
            $this->sourceValue = $sourceValue;
        } else {
            $msg = "SourceValue must be a float value, '" . gettype($sourceValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
311853
public function setTarget($target)
    {
        if (!$target instanceof ModelInterface) {
            throw new Exception\InvalidArgumentException(sprintf(
                '"%s" works only with ModelInterface targets',
                __CLASS__
            ));
        }
        return parent::setTarget($target);
    }