org.w3c.dom.mathml
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.


Field Summary
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 void deleteCase(int index)
          A convenience method to delete the child piece at the position referenced by index.
 MathMLCaseElement getCase(int index)
          A convenience method to retrieve the child piece at the position referenced by index.
 MathMLContentElement getCaseCondition(int index)
          A convenience method to retrieve the child of the piece at the position referenced by index which gives the condition for this case.
 MathMLContentElement getCaseValue(int index)
          A convenience method to retrieve the child of the indexth piece in this element which specifies the function value for that case.
 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.
 MathMLNodeList getPieces()
          A MathMLNodeList containing one MathMLCaseElement representing each of the piece element children of this MathMLPiecewiseElement.
 MathMLCaseElement insertCase(int index, MathMLCaseElement newCase)
          A convenience method to insert a new piece child into this element.
 MathMLCaseElement removeCase(int index)
          A convenience method to remove the child piece at the position referenced by index and return it to the caller.
 MathMLCaseElement setCase(int index, MathMLCaseElement caseElement)
          A convenience method to set the value of the child piece at the position referenced by index to the value of case.
 MathMLContentElement setCaseCondition(int index, MathMLContentElement condition)
          A convenience method to set the condition for the indexth piece in this element.
 MathMLContentElement setCaseValue(int index, MathMLContentElement value)
          A convenience method to set the function value for the indexth piece in this element.
 void setOtherwise(MathMLContentElement otherwise)
          setter for the otherwise attribute.
 
Methods inherited from interface org.w3c.dom.mathml.MathMLElement
getClassName, getHref, getId, getMathElementStyle, getOwnerMathElement, getXref, setClassName, setHref, setId, setMathElementStyle, setXref
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Method Detail

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:
getOtherwise()

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.


Copyright © 2002-2010 The JEuclid project. All Rights Reserved.