KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > cache > QueryList


1 /*
2  * This file is part of "SnipSnap Wiki/Weblog".
3  *
4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
5  * All Rights Reserved.
6  *
7  * Please visit http://snipsnap.org/ for updates and contact.
8  *
9  * --LICENSE NOTICE--
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  * --LICENSE NOTICE--
24  */

25
26 package org.snipsnap.cache;
27
28 import org.snipsnap.snip.storage.query.Query;
29 import org.snipsnap.snip.storage.query.QueryKit;
30
31 import java.util.*;
32
33 /**
34  * List with a query interface
35  *
36  * @author stephan
37  * @version $Id: QueryList.java 864 2003-05-23 10:47:26Z stephan $
38  */

39
40 public class QueryList implements List {
41   private List list;
42
43   public QueryList(List list) {
44     this.list = list;
45   }
46
47   public List querySorted(Comparator c, int size) {
48     return QueryKit.querySorted(list, c, size);
49   }
50
51   public List querySorted(Query query, Comparator c) {
52     return QueryKit.querySorted(list, query, c);
53   }
54
55   public List querySorted(Query query, Comparator c, int size) {
56     return QueryKit.querySorted(list, query, c, size);
57   }
58
59   public List query(Query query) {
60     return QueryKit.query(list, query);
61   }
62
63   // List interface
64
public int size() {
65     return list.size();
66   }
67
68   public boolean isEmpty() {
69     return list.isEmpty();
70   }
71
72   public boolean contains(Object JavaDoc o) {
73     return list.contains(o);
74   }
75
76   public Iterator iterator() {
77     return list.iterator();
78   }
79
80   public Object JavaDoc[] toArray() {
81     return list.toArray();
82   }
83
84   public Object JavaDoc[] toArray(Object JavaDoc[] objects) {
85     return list.toArray(objects);
86   }
87
88   public boolean add(Object JavaDoc o) {
89     return list.add(o);
90   }
91
92   public boolean remove(Object JavaDoc o) {
93     return list.remove(o);
94   }
95
96   public boolean containsAll(Collection collection) {
97     return list.containsAll(collection);
98   }
99
100   public boolean addAll(Collection collection) {
101     return list.addAll(collection);
102   }
103
104   public boolean addAll(int i, Collection collection) {
105     return list.addAll(i, collection);
106   }
107
108   public boolean removeAll(Collection collection) {
109     return list.removeAll(collection);
110   }
111
112   public boolean retainAll(Collection collection) {
113     return list.retainAll(collection);
114   }
115
116   public void clear() {
117     list.clear();
118   }
119
120   public Object JavaDoc get(int i) {
121     return list.get(i);
122   }
123
124   public Object JavaDoc set(int i, Object JavaDoc o) {
125     return list.set(i, o);
126   }
127
128   public void add(int i, Object JavaDoc o) {
129     list.add(i, o);
130   }
131
132   public Object JavaDoc remove(int i) {
133     return list.remove(i);
134   }
135
136   public int indexOf(Object JavaDoc o) {
137     return list.indexOf(o);
138   }
139
140   public int lastIndexOf(Object JavaDoc o) {
141     return list.lastIndexOf(o);
142   }
143
144   public ListIterator listIterator() {
145     return list.listIterator();
146   }
147
148   public ListIterator listIterator(int i) {
149     return list.listIterator(i);
150   }
151
152   public List subList(int i, int i1) {
153     return list.subList(i, i1);
154   }
155
156   public int hashCode() {
157     return list.hashCode();
158   }
159
160   public boolean equals(Object JavaDoc o) {
161     return list.equals(o);
162   }
163 }
164
165
Popular Tags