声明自己的类本身是什么意思?
public class SearchTaskResult {
public final String txt;
public final int pageNumber;
public final RectF searchBoxes[];
static private SearchTaskResult singleton;
SearchTaskResult(String _txt, int _pageNumber, RectF _searchBoxes[]) {
txt = _txt;
pageNumber = _pageNumber;
searchBoxes = _searchBoxes;
}
static public SearchTaskResult get() {
return singleton;
}
static public void set(SearchTaskResult r) {
singleton = r;
}
}
声明这个
static private SearchTaskResult singleton;
它自己返回,我不明白这是什么意思
static public SearchTaskResult get() {
return singleton;
}
我读过单例,
但是这种结构方法没有私有修饰符
SearchTaskResult(String _txt, int _pageNumber, RectF _searchBoxes[]) {
txt = _txt;
pageNumber = _pageNumber;
searchBoxes = _searchBoxes;
}