KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibatis > sqlmap > engine > mapping > result > XmlList


1 /*
2  * Copyright 2004 Clinton Begin
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 com.ibatis.sqlmap.engine.mapping.result;
17
18 import java.util.Collection JavaDoc;
19 import java.util.Iterator JavaDoc;
20 import java.util.List JavaDoc;
21 import java.util.ListIterator JavaDoc;
22
23 /**
24  * Not really sure what this is...it is not used internally
25  */

26 public class XmlList implements List JavaDoc {
27
28   private List JavaDoc list;
29
30   /**
31    * Build a list from another list
32    *
33    * @param list - a base list
34    */

35   public XmlList(List JavaDoc list) {
36     this.list = list;
37   }
38
39   public int size() {
40     return list.size();
41   }
42
43   public boolean isEmpty() {
44     return list.isEmpty();
45   }
46
47   public boolean contains(Object JavaDoc o) {
48     return list.contains(o);
49   }
50
51   public Iterator JavaDoc iterator() {
52     return list.iterator();
53   }
54
55   public Object JavaDoc[] toArray() {
56     return list.toArray();
57   }
58
59   public Object JavaDoc[] toArray(Object JavaDoc a[]) {
60     return list.toArray(a);
61   }
62
63   public boolean add(Object JavaDoc o) {
64     return list.add(o);
65   }
66
67   public boolean remove(Object JavaDoc o) {
68     return list.remove(o);
69   }
70
71   public boolean containsAll(Collection JavaDoc c) {
72     return list.containsAll(c);
73   }
74
75   public boolean addAll(Collection JavaDoc c) {
76     return list.addAll(c);
77   }
78
79   public boolean addAll(int index, Collection JavaDoc c) {
80     return list.addAll(index, c);
81   }
82
83   public boolean removeAll(Collection JavaDoc c) {
84     return list.removeAll(c);
85   }
86
87   public boolean retainAll(Collection JavaDoc c) {
88     return list.retainAll(c);
89   }
90
91   public void clear() {
92     list.clear();
93   }
94
95   public Object JavaDoc get(int index) {
96     return list.get(index);
97   }
98
99   public Object JavaDoc set(int index, Object JavaDoc element) {
100     return list.set(index, element);
101   }
102
103   public void add(int index, Object JavaDoc element) {
104     list.add(index, element);
105   }
106
107   public Object JavaDoc remove(int index) {
108     return list.remove(index);
109   }
110
111   public int indexOf(Object JavaDoc o) {
112     return list.indexOf(o);
113   }
114
115   public int lastIndexOf(Object JavaDoc o) {
116     return list.lastIndexOf(o);
117   }
118
119   public ListIterator JavaDoc listIterator() {
120     return list.listIterator();
121   }
122
123   public ListIterator JavaDoc listIterator(int index) {
124     return list.listIterator(index);
125   }
126
127   public List JavaDoc subList(int fromIndex, int toIndex) {
128     return list.subList(fromIndex, toIndex);
129   }
130
131   public String JavaDoc toString() {
132     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
133     for (int i = 0, n = list.size(); i < n; i++) {
134       buffer.append(list.get(i));
135       buffer.append("\r\n");
136     }
137     return buffer.toString();
138   }
139
140 }
141
Popular Tags