1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.bcel.verifier.statics;
18
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 /***
24 * A small utility class representing a set of basic int values.
25 *
26 * @version $Id: IntList.java 386056 2006-03-15 11:31:56Z tcurdt $
27 * @author Enver Haase
28 */
29 public class IntList{
30 /*** The int are stored as Integer objects here. */
31 private List theList;
32 /*** This constructor creates an empty list. */
33 IntList(){
34 theList = new ArrayList();
35 }
36 /*** Adds an element to the list. */
37 void add(int i){
38 theList.add(new Integer(i));
39 }
40 /*** Checks if the specified int is already in the list. */
41 boolean contains(int i){
42 Integer[] ints = new Integer[theList.size()];
43 theList.toArray(ints);
44 for (int j=0; j<ints.length; j++){
45 if (i == ints[j].intValue()) {
46 return true;
47 }
48 }
49 return false;
50 }
51 }