1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.util;
16  
17  import java.util.Collection;
18  import java.util.Iterator;
19  import java.util.List;
20  import java.util.ListIterator;
21  
22  /**
23   * <a href="ListWrapper.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class ListWrapper<E> implements List<E> {
28  
29      public ListWrapper(List<E> list) {
30          _list = list;
31      }
32  
33      public boolean add(E o) {
34          return _list.add(o);
35      }
36  
37      public void add(int index, E element) {
38          _list.add(index, element);
39      }
40  
41      public boolean addAll(Collection<? extends E> c) {
42          return _list.addAll(c);
43      }
44  
45      public boolean addAll(int index, Collection<? extends E> c) {
46          return _list.addAll(index, c);
47      }
48  
49      public void clear() {
50          _list.clear();
51      }
52  
53      public boolean contains(Object o) {
54          return _list.contains(o);
55      }
56  
57      public boolean containsAll(Collection<?> c) {
58          return _list.containsAll(c);
59      }
60  
61      public E get(int index) {
62          return _list.get(index);
63      }
64  
65      public int indexOf(Object o) {
66          return _list.indexOf(o);
67      }
68  
69      public boolean isEmpty() {
70          return _list.isEmpty();
71      }
72  
73      public Iterator<E> iterator() {
74          return _list.iterator();
75      }
76  
77      public int lastIndexOf(Object o) {
78          return _list.lastIndexOf(o);
79      }
80  
81      public ListIterator<E> listIterator() {
82          return _list.listIterator();
83      }
84  
85      public ListIterator<E> listIterator(int index) {
86          return _list.listIterator(index);
87      }
88  
89      public boolean remove(Object o) {
90          return _list.remove(o);
91      }
92  
93      public E remove(int index) {
94          return _list.remove(index);
95      }
96  
97      public boolean removeAll(Collection<?> c) {
98          return _list.removeAll(c);
99      }
100 
101     public boolean retainAll(Collection<?> c) {
102         return _list.retainAll(c);
103     }
104 
105     public E set(int index, E element) {
106         return _list.set(index, element);
107     }
108 
109     public int size() {
110         return _list.size();
111     }
112 
113     public List<E> subList(int fromIndex, int toIndex) {
114         return _list.subList(fromIndex, toIndex);
115     }
116 
117     public Object[] toArray() {
118         return _list.toArray();
119     }
120 
121     public <T> T[] toArray(T[] a) {
122         return _list.toArray(a);
123     }
124 
125     private List<E> _list;
126 
127 }