1 /*
2 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
94 * <P>
95 * The example above implements a simple range predicate. Note, that
96 * implementations should but are not required to provider <code>String</code>
97 * and integer index based constructors to provide for JDBC RowSet Implementation
98 * applications that use both column identification conventions.
99 *
100 * @author Jonathan Bruce, Amit Handa
101 *
102 */
103
104 // <h3>3.0 FilteredRowSet Internals</h3>
105 // internalNext, Frist, Last. Discuss guidelines on how to approach this
106 // and cite examples in reference implementations.
107 public interface Predicate {
108 /**
109 * This method is typically called a <code>FilteredRowSet</code> object
110 * internal methods (not public) that control the <code>RowSet</code> object's
111 * cursor moving from row to the next. In addition, if this internal method
112 * moves the cursor onto a row that has been deleted, the internal method will
113 * continue to ove the cursor until a valid row is found.
114 *
115 * @return <code>true</code> if there are more rows in the filter;
116 * <code>false</code> otherwise
117 */
118 public boolean evaluate(RowSet rs);
119
120
121 /**
122 * This method is called by a <code>FilteredRowSet</code> object
123 * to check whether the value lies between the filtering criterion (or criteria
124 * if multiple constraints exist) set using the <code>setFilter()</code> method.
125 * <P>
126 * The <code>FilteredRowSet</code> object will use this method internally
127 * while inserting new rows to a <code>FilteredRowSet</code> instance.
128 *
129 * @param value An <code>Object</code> value which needs to be checked,
130 * whether it can be part of this <code>FilterRowSet</code> object.
131 * @param column a <code>int</code> object that must match the
132 * SQL index of a column in this <code>RowSet</code> object. This must
133 * have been passed to <code>Predicate</code> as one of the columns
134 * for filtering while initializing a <code>Predicate</code>
|
1 /*
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
94 * <P>
95 * The example above implements a simple range predicate. Note, that
96 * implementations should but are not required to provider <code>String</code>
97 * and integer index based constructors to provide for JDBC RowSet Implementation
98 * applications that use both column identification conventions.
99 *
100 * @author Jonathan Bruce, Amit Handa
101 *
102 */
103
104 // <h3>3.0 FilteredRowSet Internals</h3>
105 // internalNext, Frist, Last. Discuss guidelines on how to approach this
106 // and cite examples in reference implementations.
107 public interface Predicate {
108 /**
109 * This method is typically called a <code>FilteredRowSet</code> object
110 * internal methods (not public) that control the <code>RowSet</code> object's
111 * cursor moving from row to the next. In addition, if this internal method
112 * moves the cursor onto a row that has been deleted, the internal method will
113 * continue to ove the cursor until a valid row is found.
114 * @param rs The {@code RowSet} to be evaluated
115 * @return <code>true</code> if there are more rows in the filter;
116 * <code>false</code> otherwise
117 */
118 public boolean evaluate(RowSet rs);
119
120
121 /**
122 * This method is called by a <code>FilteredRowSet</code> object
123 * to check whether the value lies between the filtering criterion (or criteria
124 * if multiple constraints exist) set using the <code>setFilter()</code> method.
125 * <P>
126 * The <code>FilteredRowSet</code> object will use this method internally
127 * while inserting new rows to a <code>FilteredRowSet</code> instance.
128 *
129 * @param value An <code>Object</code> value which needs to be checked,
130 * whether it can be part of this <code>FilterRowSet</code> object.
131 * @param column a <code>int</code> object that must match the
132 * SQL index of a column in this <code>RowSet</code> object. This must
133 * have been passed to <code>Predicate</code> as one of the columns
134 * for filtering while initializing a <code>Predicate</code>
|