resultsetdatamodel.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 555 行 · 第 1/2 页
HTML
555 行
<A NAME="isRowAvailable()"><!-- --></A><H3>isRowAvailable</H3><PRE>public boolean <B>isRowAvailable</B>()</PRE><DL><DD><p>Return <code>true</code> if there is <code>wrappedData</code> available, and the result of calling <code>absolute()</code> on the underlying <code>ResultSet</code>, passing the current value of <code>rowIndex</code> plus one (to account for the fact that <code>ResultSet</code> uses one-relative indexing), returns <code>true</code>. Otherwise, return <code>false</code>.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#isRowAvailable()">isRowAvailable</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row availability</DL></DD></DL><HR><A NAME="getRowCount()"><!-- --></A><H3>getRowCount</H3><PRE>public int <B>getRowCount</B>()</PRE><DL><DD><p>Return -1, since <code>ResultSet</code> does not provide a standard way to determine the number of available rows without scrolling through the entire <code>ResultSet</code>, and this can be very expensive if the number of rows is large.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#getRowCount()">getRowCount</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row count</DL></DD></DL><HR><A NAME="getRowData()"><!-- --></A><H3>getRowData</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getRowData</B>()</PRE><DL><DD><p>If row data is available, return a <code>Map</code> representing the values of the columns for the row specified by <code>rowIndex</code>, keyed by the corresponding column names. If no wrapped data is available, return <code>null</code>.</p> <p>If a non-<code>null</code> <code>Map</code> is returned, its behavior must correspond to the contract for a mutable <code>Map</code> as described in the JavaDocs for <code>AbstractMap</code>, with the following exceptions and specialized behavior:</p> <ul> <li>The <code>Map</code>, and any supporting objects it returns, must perform all column name comparisons in a case-insensitive manner. This case-insensitivity must be implemented using a case-insensitive <code>Comparator</code>, such as <code>String.CASE_INSENSITIVE_ORDER</code>.</li> <li>The following methods must throw <code>UnsupportedOperationException</code>: <code>clear()</code>, <code>remove()</code>.</li> <li>The <code>entrySet()</code> method must return a <code>Set</code> that has the following behavior: <ul> <li>Throw <code>UnsupportedOperationException</code> for any attempt to add or remove entries from the <code>Set</code>, either directly or indirectly through an <code>Iterator</code> returned by the <code>Set</code>.</li> <li>Updates to the <code>value</code> of an entry in this <code>set</code> must write through to the corresponding column value in the underlying <code>ResultSet</code>.</li> </ul></li> <li>The <code>keySet()</code> method must return a <code>Set</code> that throws <code>UnsupportedOperationException</code> on any attempt to add or remove keys, either directly or through an <code>Iterator</code> returned by the <code>Set</code>.</li> <li>The <code>put()</code> method must throw <code>IllegalArgumentException</code> if a key value for which <code>containsKey()</code> returns <code>false</code> is specified. However, if a key already present in the <code>Map</code> is specified, the specified value must write through to the corresponding column value in the underlying <code>ResultSet</code>. </li> <li>The <code>values()</code> method must return a <code>Collection</code> that throws <code>UnsupportedOperationException</code> on any attempt to add or remove values, either directly or through an <code>Iterator</code> returned by the <code>Collection</code>.</li> </ul><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#getRowData()">getRowData</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row data<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if now row data is available at the currently specified row index</DL></DD></DL><HR><A NAME="getRowIndex()"><!-- --></A><H3>getRowIndex</H3><PRE>public int <B>getRowIndex</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/model/DataModel.html#getRowIndex()">DataModel</A></CODE></B></DD><DD><p>Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no <code>wrappedData</code> is available, return -1.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#getRowIndex()">getRowIndex</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row index</DL></DD></DL><HR><A NAME="setRowIndex(int)"><!-- --></A><H3>setRowIndex</H3><PRE>public void <B>setRowIndex</B>(int rowIndex)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/model/DataModel.html#setRowIndex(int)">DataModel</A></CODE></B></DD><DD><p>Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the <code>isRowAvailable()</code> method to detect whether row data will be available for use by the <code>getRowData()</code> method.</p> <p>If there is no <code>wrappedData</code> available when this method is called, the specified <code>rowIndex</code> is stored (and may be retrieved by a subsequent call to <code>getRowData()</code>), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a <A HREF="../../../javax/faces/model/DataModelEvent.html" title="class in javax.faces.model"><CODE>DataModelEvent</CODE></A> will be sent to the <code>rowSelected()</code> method of all registered <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A>s.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#setRowIndex(int)">setRowIndex</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rowIndex</CODE> - The new zero-relative index (must be non-negative)<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs setting the row index<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>rowIndex</code> is less than -1</DL></DD></DL><HR><A NAME="getWrappedData()"><!-- --></A><H3>getWrappedData</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getWrappedData</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/model/DataModel.html#getWrappedData()">DataModel</A></CODE></B></DD><DD><p>Return the object representing the data wrapped by this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>, if any.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#getWrappedData()">getWrappedData</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setWrappedData(java.lang.Object)"><!-- --></A><H3>setWrappedData</H3><PRE>public void <B>setWrappedData</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> data)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/model/DataModel.html#setWrappedData(java.lang.Object)">DataModel</A></CODE></B></DD><DD><p>Set the object representing the data collection wrapped by this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>. If the specified <code>data</code> is <code>null</code>, detach this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A> from any previously wrapped data collection instead.</p> <p>If <code>data</code> is non-<code>null</code>, the currently selected row index must be set to zero, and a <A HREF="../../../javax/faces/model/DataModelEvent.html" title="class in javax.faces.model"><CODE>DataModelEvent</CODE></A> must be sent to the <code>rowSelected()</code> method of all registered <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A>s indicating that this row is now selected.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/model/DataModel.html#setWrappedData(java.lang.Object)">setWrappedData</A></CODE> in class <CODE><A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model">DataModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - Data collection to be wrapped, or <code>null</code> to detach from any previous data collection<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang">ClassCastException</A></CODE> - if <code>data</code> is not of the appropriate type for this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A> implementation</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/faces/model/ResultDataModel.html" title="class in javax.faces.model"><B>PREV CLASS</B></A> <A HREF="../../../javax/faces/model/ScalarDataModel.html" title="class in javax.faces.model"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/faces/model/ResultSetDataModel.html" target="_top"><B>FRAMES</B></A> <A HREF="ResultSetDataModel.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?