2 * Copyright 2004-2005 the original author or authors.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 import java
.util
.List
;
19 import java
.util
.Iterator
;
20 import java
.util
.Collection
;
21 import java
.util
.ListIterator
;
22 import java
.io
.Serializable
;
25 * A result list for Criteria list calls, which is aware of the totalCount for the paged result
27 * @author Siegfried Puchbauer
30 public class PagedResultList
implements List
, Serializable
{
34 protected int totalCount
;
36 public PagedResultList(List list
) {
40 public PagedResultList(List list
, int totalCount
) {
42 this.totalCount
= totalCount
;
49 public boolean isEmpty() {
50 return list
.isEmpty();
53 public boolean contains(Object o
) {
54 return list
.contains(o
);
57 public Iterator
iterator() {
58 return list
.iterator();
61 public Object
[] toArray() {
62 return list
.toArray();
65 public Object
[] toArray(Object
[] objects
) {
66 return list
.toArray(objects
);
69 public boolean add(Object o
) {
73 public boolean remove(Object o
) {
74 return list
.remove(o
);
77 public boolean containsAll(Collection collection
) {
78 return list
.containsAll(collection
);
81 public boolean addAll(Collection collection
) {
82 return list
.addAll(collection
);
85 public boolean addAll(int i
, Collection collection
) {
86 return list
.addAll(i
, collection
);
89 public boolean removeAll(Collection collection
) {
90 return list
.removeAll(collection
);
93 public boolean retainAll(Collection collection
) {
94 return list
.retainAll(collection
);
101 public boolean equals(Object o
) {
102 return list
.equals(o
);
105 public int hashCode() {
106 return list
.hashCode();
109 public Object
get(int i
) {
113 public Object
set(int i
, Object o
) {
114 return list
.set(i
, o
);
117 public void add(int i
, Object o
) {
121 public Object
remove(int i
) {
122 return list
.remove(i
);
125 public int indexOf(Object o
) {
126 return list
.indexOf(o
);
129 public int lastIndexOf(Object o
) {
130 return list
.lastIndexOf(o
);
133 public ListIterator
listIterator() {
134 return list
.listIterator();
137 public ListIterator
listIterator(int i
) {
138 return list
.listIterator(i
);
141 public List
subList(int i
, int i1
) {
142 return list
.subList(i
, i1
);
145 public int getTotalCount() {
149 public void setTotalCount(int totalCount
) {
150 this.totalCount
= totalCount
;