final DocList docList = reader.getMatchList(kqm.getKeywords()[kqm
.getCurrentKeywordIndex()]);
idf = reader.getIdf();
final ScoreDocList sdList = new ScoreDocList(docList);
if (kqm.getCurrentBloomFilter() != null) {
SimpleBloomFilter receivedBloomFilter = kqm
.getCurrentBloomFilter();
// calculate F(a) intersects B
sdList.intersects(receivedBloomFilter);
}
final SimpleBloomFilter currentBloomFilter = (new BloomFilterCreator())
.createBloomFilter(sdList);
try {
OverlayNetwork network = PastryNetwork.getInstance();
if (kqm.getCurrentKeywordIndex() < kqm.getKeywords().length - 1) {
// if current node is NOT the last node of the message-chaining
// process
KeywordQueryMessage newKqm = new KeywordQueryMessage(kqm
.getKeywords(), kqm.getCurrentKeywordIndex() + 1, currentBloomFilter);
network.send(
kqm.getKeywords()[kqm.getCurrentKeywordIndex() + 1],
newKqm, new MessageCallback() {
public void onResponse(ResponseMessage response) {
if (response instanceof KeywordQueryRespMessage) {
ScoreDocList receivedSdList = ((KeywordQueryRespMessage) response)
.getSdList();
Scorer.calculateScore(docList,
receivedSdList, idf);
resp.value = new KeywordQueryRespMessage(