KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > util > LongList


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.mapper.util;
24
25
26 import java.util.ArrayList JavaDoc;
27
28 /**
29  * Long list.
30  */

31 public class LongList extends BaseTypedList
32 {
33 private static final String JavaDoc RCSRevision = "$Revision: 1.1 $";
34 private static final String JavaDoc RCSName = "$Name: $";
35     
36     public LongList() {}
37     
38     public LongList(int size)
39     {
40         super(size);
41     }
42     
43     public LongList(ArrayList JavaDoc list)
44     {
45         super(list);
46     }
47     
48     public void add(long element)
49     {
50         list.add(new Long JavaDoc(element));
51     }
52     
53     public LongList append(long element)
54     {
55         list.add(new Long JavaDoc(element));
56         return this;
57     }
58     
59     public LongList append(Long JavaDoc element)
60     {
61         list.add(element);
62         return this;
63     }
64     
65     public void add(Long JavaDoc element)
66     {
67         list.add(element);
68     }
69     
70     public void add(int index, long element)
71     {
72         list.add(index, new Long JavaDoc(element));
73     }
74     
75     public void add(int index, Long JavaDoc element)
76     {
77         list.add(index, element);
78     }
79     
80     public void remove(Long JavaDoc element)
81     {
82         list.remove(element);
83     }
84     
85     public long getValue(int index)
86     {
87         return ((Long JavaDoc)list.get(index)).longValue();
88     }
89     
90     public Long JavaDoc get(int index)
91     {
92         return (Long JavaDoc) list.get(index);
93     }
94 }
95
Popular Tags