📄 queryresultsformbean.java
字号:
/* @LICENSE_COPYRIGHT@ */package net.sf.irunninglog.servlet.formbean;import java.util.Collection;import java.util.Collections;import java.util.Iterator;/** * Form bean used to store query results. This is essentially just a wrapper * around an internal <code>Collection</code>, with methods for setting and * accessing the internal data. * * @author <a href="mailto:allan_e_lewis@yahoo.com">Allan Lewis</a> * @version $Revision: 1.1.1.1 $ $Date: 2005/06/23 01:49:01 $ * @since iRunningLog 1.0 */public final class QueryResultsFormBean extends FormBean { /** Collection of query results. */ private Collection mResults; /** * Create a new form bean. There will be no results stored in this object, * and <code>getResults</code> will return <code>null</code>. * * @see #getResults() */ public QueryResultsFormBean() { super(); mResults = Collections.EMPTY_LIST; } /** * Access the collection of query results stored in this bean. This will * return an unmodifiable collection of query results. * * @return The query results stored in this bean */ public Collection getResults() { return mResults; } /** * Store a collection of query results in this bean. This will convert the * parameter collection so that it is unmodifiable and store it in this * bean. * * @param results The results to be stored in this bean */ public void setResults(Collection results) { if (results != null) { mResults = Collections.unmodifiableCollection(results); } else { mResults = Collections.EMPTY_LIST; } } /** * Custom toString override to provide a meaningful <code>String</code> * representation of this object. * * @return A <code>String</code> representation of this object */ public String toString() { StringBuffer buff = new StringBuffer(); buff.append(getClass()); buff.append("[size='"); buff.append(getResults().size()); buff.append("' results={"); for (Iterator i = getResults().iterator(); i.hasNext();) { buff.append(i.next()); if (i.hasNext()) { buff.append(", "); } } buff.append("}"); buff.append("]"); return buff.toString(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -