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
85 * return false;
86 * }
87 * }
88 * // Within filter constraints
89 * return true;
90 * }
91 * }
92 * }</pre>
93 * <P>
94 * The example above implements a simple range predicate. Note, that
95 * implementations should but are not required to provide <code>String</code>
96 * and integer index based constructors to provide for JDBC RowSet Implementation
97 * applications that use both column identification conventions.
98 *
99 * @author Jonathan Bruce, Amit Handa
100 * @since 1.5
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>
|
1 /*
2 * Copyright (c) 2003, 2014, 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
85 * return false;
86 * }
87 * }
88 * // Within filter constraints
89 * return true;
90 * }
91 * }
92 * }</pre>
93 * <P>
94 * The example above implements a simple range predicate. Note, that
95 * implementations should but are not required to provide <code>String</code>
96 * and integer index based constructors to provide for JDBC RowSet Implementation
97 * applications that use both column identification conventions.
98 *
99 * @author Jonathan Bruce, Amit Handa
100 * @since 1.5
101 *
102 */
103
104 // <h3>3.0 FilteredRowSet Internals</h3>
105 // internalNext, First, 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>
|