Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/DiskView.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; | |
2 | |
3 import org.dancres.blitz.entry.SearchOffer; | |
4 import org.dancres.blitz.entry.SearchVisitor; | |
5 import org.dancres.blitz.mangler.MangledEntry; | |
6 | |
7 /** | |
8 * Responsible for sourcing matching Entry's from the EntryRepositories to | |
9 * go into the UIDSet | |
10 */ | |
11 class DiskView implements SearchVisitor { | |
12 private UIDSet theUIDs; | |
13 private MangledEntry theTemplate; | |
14 | |
15 DiskView(MangledEntry aTemplate, UIDSet aSet) { | |
16 theTemplate = aTemplate; | |
17 theUIDs = aSet; | |
18 } | |
19 | |
20 public int offer(SearchOffer anOffer) { | |
21 MangledEntry myTarget = anOffer.getEntry(); | |
22 | |
23 if (theTemplate.match(myTarget)) { | |
24 // Need to record a globally unique id for later | |
25 theUIDs.add(new SpaceEntryUID(anOffer.getEntry().getType(), | |
26 anOffer.getInfo().getOID())); | |
27 } | |
28 | |
29 if (theUIDs.isFull()) | |
30 return STOP; | |
31 else | |
32 return TRY_AGAIN; | |
33 } | |
34 | |
35 /** | |
36 @return <code>true</code> if this Visitor wishes to perform a take. | |
37 */ | |
38 public boolean isDeleter() { | |
39 return false; | |
40 } | |
41 } |