KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > utils > pagination > PaginatablePrebuiltList


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
// PaginatablePrebuiltList
14
//
15
//
16

17 package org.jahia.utils.pagination;
18
19
20 import java.util.HashMap JavaDoc;
21 import java.util.List JavaDoc;
22 import java.util.Map JavaDoc;
23
24 /**
25  * Sometimes you already have a list and you want to paginate it.
26  * That's what this is for. you don't get searching or sorting without it.
27  *
28  * @author MJ
29  */

30 public class PaginatablePrebuiltList extends PaginatableList
31 {
32     public static final Map JavaDoc filterableFields = new HashMap JavaDoc();
33
34
35     /**
36      * A basic constructor.
37      */

38     public PaginatablePrebuiltList(Integer JavaDoc itemsPerPage, List JavaDoc list)
39     {
40         clear();
41         addAll(list);
42         this.itemsPerPage = itemsPerPage.intValue();
43     }
44     
45     public String JavaDoc toString()
46     {
47         StringBuffer JavaDoc d = new StringBuffer JavaDoc();
48         d.append("PaginatablePrebuiltList containing ").append(size())
49             .append(" elements.");
50         return d.toString();
51     }
52 }
53
Popular Tags