View Javadoc
1   /**
2    *    Copyright 2009-2015 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.apache.ibatis.submitted.custom_collection_handling;
17  
18  import java.util.*;
19  
20  public class CustomCollection<T> {
21      
22      private List<T> data = new ArrayList<T>();
23  
24      public <K> K[] toArray(K[] a) {
25          return data.toArray(a);
26      }
27  
28      public Object[] toArray() {
29          return data.toArray();
30      }
31  
32      public List<T> subList(int fromIndex, int toIndex) {
33          return data.subList(fromIndex, toIndex);
34      }
35  
36      public int size() {
37          return data.size();
38      }
39  
40      public T set(int index, T element) {
41          return data.set(index, element);
42      }
43  
44      public boolean retainAll(Collection<?> c) {
45          return data.retainAll(c);
46      }
47  
48      public boolean removeAll(Collection<?> c) {
49          return data.removeAll(c);
50      }
51  
52      public T remove(int index) {
53          return data.remove(index);
54      }
55  
56      public boolean remove(Object o) {
57          return data.remove(o);
58      }
59  
60      public ListIterator<T> listIterator(int index) {
61          return data.listIterator(index);
62      }
63  
64      public ListIterator<T> listIterator() {
65          return data.listIterator();
66      }
67  
68      public int lastIndexOf(Object o) {
69          return data.lastIndexOf(o);
70      }
71  
72      public Iterator<T> iterator() {
73          return data.iterator();
74      }
75  
76      public boolean isEmpty() {
77          return data.isEmpty();
78      }
79  
80      public int indexOf(Object o) {
81          return data.indexOf(o);
82      }
83  
84      @Override
85      public int hashCode() {
86          return data.hashCode();
87      }
88  
89      public T get(int index) {
90          return data.get(index);
91      }
92  
93      @Override
94      public boolean equals(Object o) {
95          if (!(o instanceof CustomCollection)) return false;
96          return data.equals(((CustomCollection)o).data);
97      }
98  
99      public boolean containsAll(Collection<?> c) {
100         return data.containsAll(c);
101     }
102 
103     public boolean contains(Object o) {
104         return data.contains(o);
105     }
106 
107     public void clear() {
108         data.clear();
109     }
110 
111     public boolean addAll(int index, Collection<? extends T> c) {
112         return data.addAll(index, c);
113     }
114 
115     public boolean addAll(Collection<? extends T> c) {
116         return data.addAll(c);
117     }
118 
119     public void add(int index, T element) {
120         data.add(index, element);
121     }
122 
123     public boolean add(T e) {
124         return data.add(e);
125     }
126     
127 }