KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.*;
13
14 /**
15  * Implements the IDataElementList interface and represents a list of
16  * IDataElement elements.
17  *
18  * @author Klaus Meffert
19  * @since 2.0
20  */

21 public class DataElementList
22     implements IDataElementList {
23   /** String containing the CVS revision. Read out via reflection!*/
24   private final static String JavaDoc CVS_REVISION = "$Revision: 1.3 $";
25
26   private List m_list;
27
28   public DataElementList() {
29     m_list = new Vector();
30   }
31
32   public IDataElement item(final int a_index) {
33     return (IDataElement) m_list.get(a_index);
34   }
35
36   public int getLength() {
37     return m_list.size();
38   }
39
40   public void add(final IDataElement a_element) {
41     m_list.add(a_element);
42   }
43 }
44
Popular Tags