JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / javajs / util / Lst.java
1 /* $RCSfile$\r
2  * $Author: hansonr $\r
3  * $Date: 2007-04-26 16:57:51 -0500 (Thu, 26 Apr 2007) $\r
4  * $Revision: 7502 $\r
5  *\r
6  * Copyright (C) 2005  The Jmol Development Team\r
7  *\r
8  * Contact: jmol-developers@lists.sf.net\r
9  *\r
10  *  This library is free software; you can redistribute it and/or\r
11  *  modify it under the terms of the GNU Lesser General Public\r
12  *  License as published by the Free Software Foundation; either\r
13  *  version 2.1 of the License, or (at your option) any later version.\r
14  *\r
15  *  This library is distributed in the hope that it will be useful,\r
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
18  *  Lesser General Public License for more details.\r
19  *\r
20  *  You should have received a copy of the GNU Lesser General Public\r
21  *  License along with this library; if not, write to the Free Software\r
22  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\r
23  */\r
24 \r
25 package javajs.util;\r
26 \r
27 import java.util.ArrayList;\r
28 \r
29 /**\r
30  * created to remove ambiguities in add and remove\r
31  * \r
32  * @param <V>\r
33  */\r
34 public class Lst<V> extends ArrayList<V> {\r
35 \r
36   public Lst() {\r
37     super();  \r
38   }\r
39   \r
40   /**\r
41    * @j2sIgnore\r
42    * \r
43    */\r
44   @Override\r
45   @Deprecated\r
46   public boolean add(V v) {\r
47     throw new NullPointerException("use addLast(value), not add(value) in List for JavaScript compatibility");\r
48   }\r
49   \r
50   public boolean addLast(V v) {\r
51     /**\r
52      * no overloading of add(Object) in JavaScript\r
53      * \r
54      * @j2sNative\r
55      * \r
56      * return this.add1(v);\r
57      *  \r
58      */\r
59     {\r
60       return super.add(v);\r
61     }\r
62   }\r
63   \r
64   /**\r
65    * @j2sIgnore\r
66    * \r
67    */\r
68   @Override\r
69   @Deprecated\r
70   public boolean remove(Object v) {\r
71     throw new NullPointerException("use removeObj(obj), not remove(obj) in List for JavaScript compatibility");\r
72   }\r
73   \r
74   public boolean removeObj(Object v) {\r
75     /**\r
76      * no overloading of remove(Object) in JavaScript\r
77      * \r
78      * @j2sNative\r
79      * \r
80      * return this.removeObject(v);\r
81      *  \r
82      */\r
83     {\r
84       return super.remove(v);\r
85     }\r
86   }\r
87   \r
88 }\r