1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.googlecode.mgwt.collection.shared.java;
17
18 import com.googlecode.mgwt.collection.shared.LightArrayInt;
19
20
21
22
23
24
25
26 public class JavaLightArrayInt implements LightArrayInt {
27
28 private JavaLightArray<Integer> array;
29
30
31
32
33 public JavaLightArrayInt() {
34 array = new JavaLightArray<Integer>();
35 }
36
37 @Override
38 public int get(int index) {
39 Integer integer = array.get(index);
40 if (integer != null)
41 return integer;
42 return 0;
43 }
44
45 @Override
46 public int length() {
47 return array.length();
48 }
49
50 @Override
51 public void push(int value) {
52 array.push(Integer.valueOf(value));
53
54 }
55
56 @Override
57 public void set(int index, int value) {
58 array.set(index, Integer.valueOf(value));
59
60 }
61
62 @Override
63 public int shift() {
64 Integer shift = array.shift();
65 if (shift != null)
66 return shift;
67 return 0;
68 }
69
70 @Override
71 public void unshift(int value) {
72 array.unshift(Integer.valueOf(value));
73
74 }
75
76 }