001: /*
002: * Copyright 2004 Clinton Begin
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package com.ibatis.sqlmap.engine.mapping.result;
017:
018: import java.util.Collection;
019: import java.util.Iterator;
020: import java.util.List;
021: import java.util.ListIterator;
022:
023: /**
024: * Not really sure what this is...it is not used internally
025: */
026: public class XmlList implements List {
027:
028: private List list;
029:
030: /**
031: * Build a list from another list
032: *
033: * @param list - a base list
034: */
035: public XmlList(List list) {
036: this .list = list;
037: }
038:
039: public int size() {
040: return list.size();
041: }
042:
043: public boolean isEmpty() {
044: return list.isEmpty();
045: }
046:
047: public boolean contains(Object o) {
048: return list.contains(o);
049: }
050:
051: public Iterator iterator() {
052: return list.iterator();
053: }
054:
055: public Object[] toArray() {
056: return list.toArray();
057: }
058:
059: public Object[] toArray(Object a[]) {
060: return list.toArray(a);
061: }
062:
063: public boolean add(Object o) {
064: return list.add(o);
065: }
066:
067: public boolean remove(Object o) {
068: return list.remove(o);
069: }
070:
071: public boolean containsAll(Collection c) {
072: return list.containsAll(c);
073: }
074:
075: public boolean addAll(Collection c) {
076: return list.addAll(c);
077: }
078:
079: public boolean addAll(int index, Collection c) {
080: return list.addAll(index, c);
081: }
082:
083: public boolean removeAll(Collection c) {
084: return list.removeAll(c);
085: }
086:
087: public boolean retainAll(Collection c) {
088: return list.retainAll(c);
089: }
090:
091: public void clear() {
092: list.clear();
093: }
094:
095: public Object get(int index) {
096: return list.get(index);
097: }
098:
099: public Object set(int index, Object element) {
100: return list.set(index, element);
101: }
102:
103: public void add(int index, Object element) {
104: list.add(index, element);
105: }
106:
107: public Object remove(int index) {
108: return list.remove(index);
109: }
110:
111: public int indexOf(Object o) {
112: return list.indexOf(o);
113: }
114:
115: public int lastIndexOf(Object o) {
116: return list.lastIndexOf(o);
117: }
118:
119: public ListIterator listIterator() {
120: return list.listIterator();
121: }
122:
123: public ListIterator listIterator(int index) {
124: return list.listIterator(index);
125: }
126:
127: public List subList(int fromIndex, int toIndex) {
128: return list.subList(fromIndex, toIndex);
129: }
130:
131: public String toString() {
132: StringBuffer buffer = new StringBuffer();
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: }
|