⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 examplecreator.java

📁 lucene 是java 的版的搜索引擎公共模块
💻 JAVA
字号:
package com.bitmechanic.listlib;import javax.servlet.jsp.PageContext;import java.util.*;/** * Dummy example class that creates an ArrayList of HashMaps.. In a real * application, implementations of ListCreator would do more interesting things * like load data from a database or something. * * @version $Id: ExampleCreator.java,v 1.1 2002/03/29 22:08:59 pixel Exp $ */public class ExampleCreator implements ListCreator {    private static final int SIZE = 125;    public ListContainer execute(PageContext context, int offset, int max)        throws Exception {        ArrayList list = new ArrayList();        for (int i = offset; list.size() < max && i < SIZE; i++) {            HashMap map = new HashMap();            list.add(map);            map.put("firstName", "John " + (i+1));            map.put("lastName", "Doe " + (i+1));            map.put("city", "San Francisco");        }        ListContainer lc = new ListContainer(list.iterator(), SIZE);        return lc;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -