KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > mathml > MathMLRadicalElementImpl


1 package JSci.mathml;
2
3 import org.w3c.dom.mathml.*;
4
5 /**
6  * Implements a MathML radical element.
7  * @version 1.0
8  * @author Mark Hale
9  */

10 public class MathMLRadicalElementImpl extends MathMLElementImpl implements MathMLRadicalElement {
11         /**
12          * Constructs a MathML radical element.
13          */

14         public MathMLRadicalElementImpl(MathMLDocumentImpl owner, String JavaDoc qualifiedName) {
15                 super(owner, qualifiedName);
16         }
17
18         public MathMLElement getRadicand() {
19                 return (MathMLElement) getFirstChild();
20         }
21         public void setRadicand(MathMLElement radicand) {
22                 replaceChild(radicand, getFirstChild());
23         }
24
25         public MathMLElement getIndex() {
26                 if (getLocalName().equals("msqrt")) {
27                         return null;
28                 }
29                 return (MathMLElement) item(1);
30         }
31         public void setIndex(MathMLElement index) {
32                 replaceChild(index, item(1));
33         }
34 }
35
36
Popular Tags