2ronwalf// The MIT License
2ronwalf//
2ronwalf// Copyright (c) 2004 Evren Sirin
2ronwalf//
2ronwalf// Permission is hereby granted, free of charge, to any person obtaining a copy
2ronwalf// of this software and associated documentation files (the "Software"), to
2ronwalf// deal in the Software without restriction, including without limitation the
2ronwalf// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2ronwalf// sell copies of the Software, and to permit persons to whom the Software is
2ronwalf// furnished to do so, subject to the following conditions:
2ronwalf//
2ronwalf// The above copyright notice and this permission notice shall be included in
2ronwalf// all copies or substantial portions of the Software.
2ronwalf//
2ronwalf// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2ronwalf// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2ronwalf// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2ronwalf// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2ronwalf// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2ronwalf// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2ronwalf// IN THE SOFTWARE.
2ronwalf
2ronwalf/*
2ronwalf * Created on Dec 29, 2004
2ronwalf */
2ronwalfpackage impl.owl;
2ronwalf
2ronwalfimport java.util.Collection;
2ronwalfimport java.util.Iterator;
2ronwalfimport java.util.List;
2ronwalfimport java.util.ListIterator;
2ronwalf
2ronwalf/**
2ronwalf * @author Evren Sirin
2ronwalf *
2ronwalf */
2ronwalfpublic class WrappingList implements List {
2ronwalf private List baseList = null;
2ronwalf
2ronwalf public WrappingList(List baseList) {
2ronwalf this.baseList = baseList;
2ronwalf }
2ronwalf
2ronwalf public List getBaseList() {
2ronwalf return baseList;
2ronwalf }
2ronwalf
2ronwalf public boolean equals(Object obj) {
2ronwalf if(obj == null) return false;
2ronwalf
2ronwalf if(!(obj instanceof WrappingList))
2ronwalf return false;
2ronwalf
2ronwalf WrappingList other = (WrappingList) obj;
2ronwalf
2ronwalf return baseList.equals(other.baseList);
2ronwalf }
2ronwalf
2ronwalf public int size() {
2ronwalf return baseList.size();
2ronwalf }
2ronwalf
2ronwalf public boolean isEmpty() {
2ronwalf return baseList.isEmpty();
2ronwalf }
2ronwalf
2ronwalf public boolean contains(Object o) {
2ronwalf return baseList.contains(o);
2ronwalf }
2ronwalf
2ronwalf public Iterator iterator() {
2ronwalf return baseList.iterator();
2ronwalf }
2ronwalf
2ronwalf public Object[] toArray() {
2ronwalf return baseList.toArray();
2ronwalf }
2ronwalf
2ronwalf public Object[] toArray(Object a[]) {
2ronwalf return baseList.toArray(a);
2ronwalf }
2ronwalf
2ronwalf public boolean add(Object o) {
2ronwalf return baseList.add(o);
2ronwalf }
2ronwalf
2ronwalf public boolean remove(Object o) {
2ronwalf return baseList.remove(o);
2ronwalf }
2ronwalf
2ronwalf public boolean containsAll(Collection c) {
2ronwalf return baseList.containsAll(c);
2ronwalf }
2ronwalf
2ronwalf public boolean addAll(Collection c) {
2ronwalf return baseList.addAll(c);
2ronwalf }
2ronwalf
2ronwalf public boolean addAll(int index, Collection c) {
2ronwalf return baseList.addAll(index, c);
2ronwalf }
2ronwalf
2ronwalf public boolean removeAll(Collection c) {
2ronwalf return baseList.removeAll(c);
2ronwalf }
2ronwalf
2ronwalf public boolean retainAll(Collection c) {
2ronwalf return baseList.retainAll(c);
2ronwalf }
2ronwalf
2ronwalf public void clear() {
2ronwalf baseList.clear();
2ronwalf }
2ronwalf
2ronwalf public int hashCode() {
2ronwalf return baseList.hashCode();
2ronwalf }
2ronwalf
2ronwalf public Object get(int index) {
2ronwalf return baseList.get(index);
2ronwalf }
2ronwalf
2ronwalf public Object set(int index, Object element) {
2ronwalf return baseList.set(index, element);
2ronwalf }
2ronwalf
2ronwalf public void add(int index, Object element) {
2ronwalf baseList.add(index, element);
2ronwalf }
2ronwalf
2ronwalf public Object remove(int index) {
2ronwalf return baseList.remove(index);
2ronwalf }
2ronwalf
2ronwalf public int indexOf(Object o) {
2ronwalf return baseList.indexOf(o);
2ronwalf }
2ronwalf
2ronwalf public int lastIndexOf(Object o) {
2ronwalf return baseList.lastIndexOf(o);
2ronwalf }
2ronwalf
2ronwalf public ListIterator listIterator() {
2ronwalf return baseList.listIterator();
2ronwalf }
2ronwalf
2ronwalf public ListIterator listIterator(int index) {
2ronwalf return baseList.listIterator(index);
2ronwalf }
2ronwalf
2ronwalf public List subList(int fromIndex, int toIndex) {
2ronwalf List list = baseList.subList(fromIndex, toIndex);
2ronwalf List result = new WrappingList(list);
2ronwalf return result;
2ronwalf }
2ronwalf
2ronwalf public String toString() {
2ronwalf return baseList.toString();
2ronwalf }
2ronwalf}
2ronwalf