KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > data > DataElementsDocument


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

10 package org.jgap.data;
11
12 /**
13  * The IDataCreators interface represents an entity comparable to
14  * org.w3c.dom.Document
15  *
16  * @author Klaus Meffert
17  * @since 2.0
18  */

19 public class DataElementsDocument
20     implements IDataCreators {
21   /** String containing the CVS revision. Read out via reflection!*/
22   private final static String JavaDoc CVS_REVISION = "$Revision: 1.5 $";
23
24   private IDataElementList m_tree;
25
26
27   public void setTree(final IDataElementList a_tree) {
28     m_tree = a_tree;
29   }
30
31   /**
32    * @return the tree (of elements) held by this class
33    *
34    * @author Klaus Meffert
35    * @since 2.0
36    */

37   public IDataElementList getTree() {
38     return m_tree;
39   }
40
41   public DataElementsDocument()
42       throws Exception JavaDoc {
43     m_tree = new DataElementList();
44   }
45
46   public IDataCreators newDocument()
47       throws Exception JavaDoc {
48     return new DataElementsDocument();
49   }
50
51   /**
52    * Appends a child element to the tree
53    * @param a_newChild the child to be added to the tree
54    * @throws Exception
55    *
56    * @author Klaus Meffert
57    * @since 2.0
58    */

59   public void appendChild(final IDataElement a_newChild)
60       throws Exception JavaDoc {
61     m_tree.add(a_newChild);
62   }
63 }
64
Popular Tags