public function setOperands(OperandsCollection $operands)
    {
        // Check minimal operand count.
        $min = $this->getExpression()->getMinOperands();
        $given = count($operands);

        if ($given < $min) {
            $msg = "The Operator to be processed '" . get_class($this) . "' requires at least ${min} operand(s). ";
            $msg.= "${given} operand(s) given.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::NOT_ENOUGH_OPERANDS);
        }

        // Check maximal operand count.
        $max = $this->getExpression()->getMaxOperands();
        $given = count($operands);

        if ($max !== -1 && $given > $max) {
            $msg = "The Operator to be processed '" . get_class($this) . "' requires at most ${max} operand(s). ";
            $msg.= "${given} operand(s) given.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::TOO_MUCH_OPERANDS);
        }

        $this->operands = $operands;
    }
public function setOperands(OperandsCollection $operands)
    {
        // Check minimal operand count.
        $min = $this->getExpression()->getMinOperands();
        $given = count($operands);

        if ($given < $min) {
            $msg = "The Operator to be processed '" . get_class($this) . "' requires at least ${min} operand(s). ";
            $msg.= "${given} operand(s) given.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::NOT_ENOUGH_OPERANDS);
        }

        // Check maximal operand count.
        $max = $this->getExpression()->getMaxOperands();
        $given = count($operands);

        if ($max !== -1 && $given > $max) {
            $msg = "The Operator to be processed '" . get_class($this) . "' requires at most ${max} operand(s). ";
            $msg.= "${given} operand(s) given.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::TOO_MUCH_OPERANDS);
        }

        $this->operands = $operands;
    }
public function setOperands ( OperandsCollection $ operands ) { // Check minimal operand count. $ min = $ this -> getExpression ( ) -> getMinOperands ( ) ; $ given = count ( $ operands ) ; if ( $ given < $ min ) { $ msg = "The Operator to be processed '" . get_class ( $ this ) . "' requires at least ${min} operand(s). " ; $ msg .= "${given} operand(s) given." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: NOT_ENOUGH_OPERANDS ) ; } // Check maximal operand count. $ max = $ this -> getExpression ( ) -> getMaxOperands ( ) ; $ given = count ( $ operands ) ; if ( $ max !== - 1 && $ given > $ max ) { $ msg = "The Operator to be processed '" . get_class ( $ this ) . "' requires at most ${max} operand(s). " ; $ msg .= "${given} operand(s) given." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: TOO_MUCH_OPERANDS ) ; } $ this -> operands = $ operands ; }
Set the collection of QTI Runtime compliant values
to be used as the operands of the Operator to be processed.

@param \qtism\runtime\expressions\operators\OperandsCollection $operands A collection of QTI Runtime compliant values.
@throws \qtism\runtime\expressions\operators\OperatorProcessingException If The operands are not compliant with minimum or maximum amount of operands the operator can take.
Set the collection of QTI Runtime compliant values to be used as the operands of the Operator to be processed .