public static SearchServer getInstance() { if (MySearchServer == null) { MySearchServer = new SearchServer(false); MySearchHandler = SearchHandler.getInstance(MySearchServer); } return (MySearchServer); }
/** Receive a completed assignment. */ public void returnAssignment(Assignment MyAssignment) { /* if(MyAssignment instanceof SearchAssignment){ RESULT=false; SearchAssignment SA=(SearchAssignment)MyAssignment; MySearchHandler.requestSearch(SA); }else*/ if (MyAssignment instanceof IndexPageAssignment) { IndexPageAssignment IPA = (IndexPageAssignment) MyAssignment; MySearchHandler.indexPage(IPA.getTitle(), IPA.getAddress(), IPA.getContent()); } }
/** Do search. */ public SearchResultAssignment requestSearch(Assignment MyAssignment) { return (MySearchHandler.requestSearch((SearchAssignment) MyAssignment)); }