Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/entry/SearchVisitor.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.entry; | |
2 | |
3 import net.jini.core.transaction.TransactionException; | |
4 | |
5 import org.dancres.blitz.mangler.MangledEntry; | |
6 | |
7 /** | |
8 When an EntryRepository is asked to perform a search based on a template | |
9 it offers matches to a SearchVisitor until it either exhausts all | |
10 possibilities or is told to stop by the SearchVisitor. Note searches | |
11 should lock the state of the associated EntrySleeve whilst | |
12 <code>offer</code> is invoked to prevent acceptance by SearchVisitorImpl | |
13 which must later be cancelled due to the underlying EntrySleeve having | |
14 gone into an unreachable state. | |
15 */ | |
16 public interface SearchVisitor { | |
17 /** | |
18 Returned from offer when the SearchVisitor wishes to exit the search | |
19 and doesn't wish to accept the offer. | |
20 */ | |
21 public static final int STOP = 1; | |
22 | |
23 /** | |
24 Returned from offer when the SearchVisitor wishes to accept the offer. | |
25 The FS should make good on the offer before stopping the search. | |
26 */ | |
27 public static final int ACCEPTED = 2; | |
28 | |
29 /** | |
30 Indicates the SearchVisitor cannot accept the offer and wishes search | |
31 to continue with more offers | |
32 */ | |
33 public static final int TRY_AGAIN = 3; | |
34 | |
35 /** | |
36 This method can also be used by the asynchronous recent write code. | |
37 | |
38 @return STOP if the SearchVisitor wishes to halt the search and | |
39 doesn't want to act on the offer. | |
40 */ | |
41 public int offer(SearchOffer anOffer); | |
42 | |
43 /** | |
44 @return <code>true</code> if this Visitor wishes to perform a take. | |
45 */ | |
46 public boolean isDeleter(); | |
47 } |