KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > query > Evaluation


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o.query;
22
23 /**
24  * for implementation of callback evaluations.
25  * <br><br>
26  * To constrain a {@link Query} node with your own callback
27  * <code>Evaluation</code>, construct an object that implements the
28  * <code>Evaluation</code> interface and register it by passing it
29  * to {@link Query#constrain(Object)}.
30  * <br><br>
31  * Evaluations are called as the last step during query execution,
32  * after all other constraints have been applied. Evaluations in higher
33  * level {@link Query} nodes in the query graph are called first.
34  * <br><br>Java client/server only:<br>
35  * db4o first attempts to use Java Serialization to allow to pass final
36  * variables to the server. Please make sure that all variables that are
37  * used within the evaluate() method are Serializable. This may include
38  * the class an anonymous Evaluation object is created in. If db4o is
39  * not successful at using Serialization, the Evaluation is transported
40  * to the server in a db4o MemoryFile. In this case final variables can
41  * not be restored.
42  */

43 public interface Evaluation extends java.io.Serializable JavaDoc {
44     
45     /**
46      * callback method during {@link Query#execute() query execution}.
47      * @param candidate reference to the candidate persistent object.
48      */

49     public void evaluate(Candidate candidate);
50     
51 }
52
Popular Tags