Interface MathMLPiecewiseElement

All Superinterfaces:
Element, MathMLContentElement, MathMLElement, Node

public interface MathMLPiecewiseElement extends MathMLContentElement
The piecewise element represents the piecewise definition of a function. It contains child piece elements, each represented by a MathMLCaseElement, giving the various conditions and associated function value specifications in the function definition, and an optional otherwise child element, represented by a MathMLContentElement, giving the default value of the function - that is, the value to be assigned when none of the conditions specified in the piece child elements hold.
  • Method Details

    • getPieces

      MathMLNodeList getPieces()
      A MathMLNodeList containing one MathMLCaseElement representing each of the piece element children of this MathMLPiecewiseElement. The otherwise child (if present) is not contained in this MathMLNodeList.
      Returns:
      value of the pieces attribute.
    • getOtherwise

      MathMLContentElement getOtherwise()
      Returns a MathMLContentElement representing the value to be taken by the piecewise function when none of the conditions described in the piece children is true.
      Returns:
      value of the otherwise attribute.
    • setOtherwise

      void setOtherwise(MathMLContentElement otherwise)
      setter for the otherwise attribute.
      Parameters:
      otherwise - new value for otherwise.
      See Also:
    • getCase

      MathMLCaseElement getCase(int index)
      A convenience method to retrieve the child piece at the position referenced by index.
      Parameters:
      index - Position of desired case in the list of cases. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position. If index is greater than the number of pieces, a null MathMLCaseElement is returned; no error is generated.
      Returns:
      The MathMLCaseElement retrieved.
    • setCase

      MathMLCaseElement setCase(int index, MathMLCaseElement caseElement) throws DOMException
      A convenience method to set the value of the child piece at the position referenced by index to the value of case.
      Parameters:
      index - Position of the piece to be set to case. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position. If there is currently a piece at this position, it will be replaced by case. If index is one more than the number of piece child elements, a new one will be appended.
      case - A MathMLCaseElement representing the new value of the indexth piece child.
      Returns:
      The new MathMLCaseElement created.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than one more than the number of pieces in this element.
    • deleteCase

      void deleteCase(int index) throws DOMException
      A convenience method to delete the child piece at the position referenced by index. The deletion changes the indices of the following pieces.
      Parameters:
      index - Position of the piece to be deleted. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.
    • removeCase

      MathMLCaseElement removeCase(int index) throws DOMException
      A convenience method to remove the child piece at the position referenced by index and return it to the caller. The removal changes the indices of the following pieces.
      Parameters:
      index - Position of the piece to be removed. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      Returns:
      The MathMLCaseElement removed.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.
    • insertCase

      MathMLCaseElement insertCase(int index, MathMLCaseElement newCase) throws DOMException
      A convenience method to insert a new piece child into this element.
      Parameters:
      index - Position before which case is to be inserted. If index is 0, newCase is appended as the last piece child of this element. The otherwise child (if present) is not counted, regardless of its position.
      newCase - A MathMLCaseElement representing the piece to be inserted.
      Returns:
      The new MathMLCaseElement inserted. This is the actual Element in the DOM.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater one more than the number of pieces in this element.
    • getCaseValue

      MathMLContentElement getCaseValue(int index) throws DOMException
      A convenience method to retrieve the child of the indexth piece in this element which specifies the function value for that case.
      Parameters:
      index - Position of the piece whose value is being requested in the list of pieces. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      Returns:
      The MathMLContentElement representing the value to be taken by the function in the indexth case.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.
    • setCaseValue

      MathMLContentElement setCaseValue(int index, MathMLContentElement value) throws DOMException
      A convenience method to set the function value for the indexth piece in this element.
      Parameters:
      index - Position of the piece whose value is being set in the list of pieces. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      value - A MathMLContentElement representing the function value to be assigned in the indexth case.
      Returns:
      The MathMLContentElement representing the value to be taken by the function in the indexth case.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.
    • getCaseCondition

      MathMLContentElement getCaseCondition(int index) throws DOMException
      A convenience method to retrieve the child of the piece at the position referenced by index which gives the condition for this case.
      Parameters:
      index - Position of the piece whose condition is being requested in the list of pieces. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      Returns:
      The MathMLContentElement representing the condition to be satisfied for the indexth case.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.
    • setCaseCondition

      MathMLContentElement setCaseCondition(int index, MathMLContentElement condition) throws DOMException
      A convenience method to set the condition for the indexth piece in this element.
      Parameters:
      index - Position of the piece whose condition is being set in the list of pieces. The first piece is numbered 1; the otherwise child (if present) is not counted, regardless of its position.
      condition - A MathMLContentElement representing the condition to be associated to the indexth case.
      Returns:
      The MathMLContentElement which is inserted as the condition child of the indexth piece.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the number of pieces in this element.