constructor(
      parentContainer, name, onChange, canBeDecimal, canBeZero, canBeUnset) {
    super(parentContainer, name, onChange, /* isTextArea= */ false);
    const error = document.createElement('span');
    error.classList.add('mdl-textfield__error');
    this.container_.appendChild(error);

    if (canBeZero && canBeDecimal) {
      error.textContent = 'Must be a positive number.';
    } else if (canBeZero) {
      error.textContent = 'Must be a positive integer.';
    } else if (canBeDecimal) {
      error.textContent = 'Must be a positive, nonzero number.';
    } else {
      error.textContent = 'Must be a positive, nonzero integer.';
    }

    this.input_.pattern = '(Infinity|';

    if (canBeZero) {
      this.input_.pattern += '0+|';
    }

    this.input_.pattern += '([0-9]*[1-9][0-9]*)';

    if (canBeDecimal) {
      // strictly allow for 0.xxxx decimals
      this.input_.pattern += '?(0(?=.))?';
      // TODO: Handle commas as decimal delimiters, for appropriate regions?
      this.input_.pattern += '(.[0-9]+)?';
    }


    this.input_.pattern += ')';
    if (canBeUnset) {
      this.input_.pattern += '?';
    }
  }
@param {!shakaDemo.InputContainer} parentContainer
@param {string} name
@param {function(!HTMLInputElement, !shakaDemo.Input)} onChange
@param {boolean} canBeDecimal
@param {boolean} canBeZero
@param {boolean} canBeUnset