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

📄 defaultlistmodel.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/* * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @version $Id: DefaultListModel.java 4496 2006-02-08 20:27:04Z wehrens $ */package org.gridsphere.provider.portletui.model;import org.gridsphere.provider.portletui.beans.TagBean;import java.util.ArrayList;import java.util.Iterator;import java.util.List;/** * A <code>DefaultListModel</code> is a general tag bean container that stores tag beans in a list */public class DefaultListModel {    protected List list = new ArrayList();    /**     * Adds a tag bean to the list in the supplied location     *     * @param index the list location to add the tag bean to     * @param bean  the tag bean     */    public void addBean(int index, TagBean bean) {        list.add(index, bean);    }    /**     * Adds a tag bean to the list     *     * @param bean the tag bean     */    public void addBean(TagBean bean) {        list.add(bean);    }    /**     * Returns true if the list is empty, false otherwise     *     * @return true if the list is empty, false otherwise     */    public boolean isEmpty() {        if (list.size() == 0) {            return true;        } else {            return false;        }    }    /**     * Removes a tag bean from the list at a given location     *     * @param index the location of the tag bean to remove     */    public void remove(int index) {        list.remove(index);    }    /**     * Returns a list iterator     *     * @return a list iterator     */    public Iterator iterator() {        return list.iterator();    }    /**     * Returns the size of the list     *     * @return the size of the list     */    public int size() {        return list.size();    }    /**     * Clears the list of all tag beans     */    public void clear() {        list.clear();    }}

⌨️ 快捷键说明

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