1 19 20 package org.netbeans.modules.xml.xpath.impl; 21 22 import java.util.ArrayList ; 23 import java.util.Collection ; 24 import java.util.Collections ; 25 import java.util.List ; 26 27 import org.netbeans.modules.xml.xpath.XPathExpression; 28 import org.netbeans.modules.xml.xpath.XPathOperationOrFuntion; 29 30 31 36 public abstract class XPathOperatorOrFunctionImpl extends XPathExpressionImpl implements XPathOperationOrFuntion { 37 38 39 protected List mChildren; 40 41 42 43 protected XPathOperatorOrFunctionImpl() { 44 mChildren = new ArrayList (); 45 } 46 47 51 public Collection getChildren() { 52 return Collections.unmodifiableCollection(mChildren); 53 } 54 55 56 60 public int getChildCount() { 61 return mChildren.size(); 62 } 63 64 65 71 public XPathExpression getChild(int index) 72 throws IndexOutOfBoundsException { 73 return (XPathExpression) mChildren.get(index); 74 } 75 76 77 81 public void addChild(XPathExpression child) { 82 mChildren.add(child); 83 } 84 85 86 91 public boolean removeChild(XPathExpression child) { 92 return mChildren.remove(child); 93 } 94 95 96 99 public void clearChildren() { 100 mChildren.clear(); 101 } 102 103 } 104 | Popular Tags |