merge the formfield patch from ooo-build
[ooovba.git] / toolkit / test / accessibility / VectorNode.java
blob6277cfaefe57b79593f039479ce679f9fbedba4e
1 import com.sun.star.lang.IndexOutOfBoundsException;
2 import java.util.Vector;
4 /** The VectorNode class is a simple container whose list of children is
5 managed entirely by its owner.
6 */
7 class VectorNode
8 extends StringNode
10 private Vector maChildren;
12 public VectorNode (String sDisplayObject, AccessibleTreeNode aParent)
14 super (sDisplayObject, aParent);
16 maChildren = new Vector ();
19 public void addChild (AccessibleTreeNode aChild)
21 maChildren.add (aChild);
24 public int getChildCount ()
26 return maChildren.size();
29 public AccessibleTreeNode getChild (int nIndex)
30 throws IndexOutOfBoundsException
32 return (AccessibleTreeNode)maChildren.elementAt (nIndex);
35 public boolean removeChild (int nIndex)
36 throws IndexOutOfBoundsException
38 return maChildren.remove (nIndex) != null;
41 public int indexOf (AccessibleTreeNode aNode)
43 return maChildren.indexOf (aNode);
46 public boolean isLeaf()
48 return maChildren.isEmpty();