1 package JSci.mathml; 2 3 import org.w3c.dom.mathml.*; 4 5 10 public class MathMLCnElementImpl extends MathMLContentTokenImpl implements MathMLCnElement { 11 14 public MathMLCnElementImpl(MathMLDocumentImpl owner, String qualifiedName) { 15 super(owner, qualifiedName); 16 } 17 18 public String getType() { 19 String type = getAttribute("type"); 20 if(type.length() == 0) 21 type = "real"; 22 return type; 23 } 24 public void setType(String type) { 25 setAttribute("type", type); 26 } 27 28 public String getBase() { 29 String base = getAttribute("base"); 30 if(base.length() == 0) 31 base = "10"; 32 return base; 33 } 34 public void setBase(String base) { 35 setAttribute("base", base); 36 } 37 38 public int getNargs() { 39 final int length = getLength(); 40 int numArgs = 1; 41 42 for (int i = 0; i < length; i++) { 43 String localName = item(i).getLocalName(); 44 if (localName != null && localName.equals("sep")) { 45 numArgs++; 46 } 47 } 48 return numArgs; 49 } 50 } 51 52 | Popular Tags |