📄 contentsearch.java
字号:
package connex.plugins.filesharing;
import java.util.*;
import net.jxta.peergroup.*;
import net.jxta.share.*;
import net.jxta.share.client.*;
public class ContentSearch
extends CachedListContentRequest {
private String myId;
private ContentAdvertisement[] result = null;
private int f;
/**
* @directed
*/
ContentSearchListener listener;
public ContentSearch(PeerGroup group, String inSubStr,
ContentSearchListener listener) {
super(group, inSubStr);
this.myId = group.getPeerID().toString();
this.listener = listener;
}
public void notifyMoreResults() {
try {
result = this.getResults();
}
catch (Exception ex) {
}
if (result != null) {
displayResults();
f = result.length;
}
}
public void displayResults() {
ContentAdvertisement myAdv = null;
String length;
for (int i = f; i < result.length; i++) {
myAdv = result[i];
if (!myAdv.getAddress().equals(myId)) {
listener.receiveResult(myAdv);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -