01: package com.jeta.forms.store.jml.dom;
02:
03: import java.util.ArrayList;
04: import java.util.Collection;
05:
06: public class DefaultJMLNode extends AbstractJMLNode {
07:
08: private String m_nodeName;
09:
10: private ArrayList m_children;
11:
12: public DefaultJMLNode(String nodeName) {
13: m_nodeName = nodeName;
14: }
15:
16: public Collection getChildren() {
17: return m_children;
18: }
19:
20: public void appendChild(JMLNode childNode) {
21: if (m_children == null)
22: m_children = new ArrayList();
23: m_children.add(childNode);
24: }
25:
26: public String getNodeName() {
27: return m_nodeName;
28: }
29:
30: public int getChildCount() {
31: if (m_children == null)
32: return 0;
33: return m_children.size();
34: }
35:
36: public JMLNode getNode(int index) {
37: if (m_children == null)
38: throw new IndexOutOfBoundsException();
39:
40: return (JMLNode) m_children.get(index);
41: }
42:
43: }
|