{"id":27060,"date":"2021-05-09T23:10:06","date_gmt":"2021-05-10T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/a-class-the-encapsulates-the-urls-used-by-various-search-engines-programming-code-examples-java-j2ee-j2me-applets-and-basic-graphics\/"},"modified":"2021-05-09T23:10:06","modified_gmt":"2021-05-10T03:10:06","slug":"a-class-the-encapsulates-the-urls-used-by-various-search-engines-programming-code-examples-java-j2ee-j2me-applets-and-basic-graphics","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27060","title":{"rendered":"A class the encapsulates the URLs used by various search engines. #Programming Code Examples #Java\/J2EE\/J2ME #Applets and Basic Graphics"},"content":{"rendered":"<pre>\nSearchSpec.java\n*******************\n\/** Small class that encapsulates how to construct a\n *  search string for a particular search engine.\n *  Taken from Core Web Programming Java 2 Edition\n *  from Prentice Hall and Sun Microsystems Press,\n\n *  May be freely used or adapted.\n *\/\n\npublic class SearchSpec {\n  private String name, baseURL, numResultsSuffix;\n\n  private static SearchSpec[] commonSpecs =\n    { new SearchSpec(&quot;google&quot;,\n                     &quot;http:\/\/www.google.com\/search?q=&quot;,\n                     &quot;&amp;num=&quot;),\n      new SearchSpec(&quot;infoseek&quot;,\n                     &quot;http:\/\/infoseek.go.com\/Titles?qt=&quot;,\n                     &quot;&amp;nh=&quot;),\n      new SearchSpec(&quot;lycos&quot;,\n                     &quot;http:\/\/lycospro.lycos.com\/cgi-bin\/&quot; +\n                        &quot;pursuit?query=&quot;,\n                     &quot;&amp;maxhits=&quot;),\n      new SearchSpec(&quot;hotbot&quot;,\n                     &quot;http:\/\/www.hotbot.com\/?MT=&quot;,\n                     &quot;&amp;DC=&quot;)\n    };\n\n  public SearchSpec(String name,\n                    String baseURL,\n                    String numResultsSuffix) {\n    this.name = name;\n    this.baseURL = baseURL;\n    this.numResultsSuffix = numResultsSuffix;\n  }\n\n  public String makeURL(String searchString,\n                        String numResults) {\n    return(baseURL + searchString +\n           numResultsSuffix + numResults);\n  }\n\n  public String getName() {\n    return(name);\n  }\n\n  public static SearchSpec[] getCommonSpecs() {\n    return(commonSpecs);\n  }\n}\n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10212<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Applets and Basic Graphics<br \/>Tags:Java\/J2EE\/J2MEApplets and Basic Graphics<br \/> Post Data:2017-01-02 16:04:23<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SearchSpec.java ******************* \/** Small class that encapsulates how to construct a * search string for a particular search engine. * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems Press, * May be freely used or adapted. *\/ public class SearchSpec { private String name, baseURL, numResultsSuffix; private static &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27060\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-27060","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10421,"url":"http:\/\/bangla.sitestree.com\/?p=10421","url_meta":{"origin":27060,"position":0},"title":"A class the encapsulates the URLs used by various search engines.","author":"","date":"August 28, 2015","format":false,"excerpt":"SearchSpec.java ******************* \/** Small class that encapsulates how to construct a \u00a0*\u00a0 search string for a particular search engine. \u00a0*\u00a0 Taken from Core Web Programming Java 2 Edition \u00a0*\u00a0 from Prentice Hall and Sun Microsystems Press, \u00a0*\u00a0 May be freely used or adapted. \u00a0*\/ public class SearchSpec { \u00a0 private\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10170,"url":"http:\/\/bangla.sitestree.com\/?p=10170","url_meta":{"origin":27060,"position":1},"title":"SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html.","author":"","date":"August 19, 2015","format":false,"excerpt":"SearchEngines.java\u00a0 Servlet that redirects requests to various search engines. Uses the SearchSpec\u00a0 helper class. Accessed by means of SearchEngines.html. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; \/** Servlet that takes a search string, number of results per \u00a0*\u00a0 page, and a search engine name, sending the query\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26535,"url":"http:\/\/bangla.sitestree.com\/?p=26535","url_meta":{"origin":27060,"position":2},"title":"SearchEngines.java  Servlet that redirects requests to various search engines. Uses the SearchSpec  helper class. Accessed by means of SearchEngines.html. #Programming Code Examples #Java\/J2EE\/J2ME #Servlet","author":"Author-Check- Article-or-Video","date":"April 27, 2021","format":false,"excerpt":"SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; \/** Servlet that takes a search string, number of results per * page, and a search engine name, sending the query\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27058,"url":"http:\/\/bangla.sitestree.com\/?p=27058","url_meta":{"origin":27060,"position":3},"title":"An applet that searches multiple search engines, displaying the results in side-by-side frame cells. #Programming Code Examples #Java\/J2EE\/J2ME #Applets and Basic Graphics","author":"Author-Check- Article-or-Video","date":"May 9, 2021","format":false,"excerpt":"Using Applets as Front Ends to Server-Side Programs ************************************************** SearchApplet.java An applet that searches multiple search engines, displaying the results in side-by-side frame cells. Uses the following files: SearchSpec.javaParallelSearches.htmlSearchAppletFrame.htmlGoogleResultsFrame.htmlInfoseekResultsFrame.htmlLycosResultsFrame.html *************************************************** \/\/ import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.net.*; \/\/ \/** An applet that reads a value from a TextField,\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10419,"url":"http:\/\/bangla.sitestree.com\/?p=10419","url_meta":{"origin":27060,"position":4},"title":"An applet that searches multiple search engines, displaying the results in side-by-side frame cells.","author":"","date":"August 28, 2015","format":false,"excerpt":"Using Applets as Front Ends to Server-Side Programs ************************************************** SearchApplet.java An applet that searches multiple search engines, \u00a0displaying the results in side-by-side frame cells. Uses the following files: SearchSpec.javaParallelSearches.htmlSearchAppletFrame.htmlGoogleResultsFrame.htmlInfoseekResultsFrame.htmlLycosResultsFrame.html *************************************************** \/\/ import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.net.*; \/\/ \/** An applet that reads a value from a TextField,\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26830,"url":"http:\/\/bangla.sitestree.com\/?p=26830","url_meta":{"origin":27060,"position":5},"title":"DBResults.java: Class to store completed results of a JDBC Query. Differs from a ResultSet in several ways #Programming Code Examples #Java\/J2EE\/J2ME #JDBC","author":"Author-Check- Article-or-Video","date":"May 2, 2021","format":false,"excerpt":"# DBResults.java Class to store completed results of a JDBC Query. Differs from a ResultSet in several ways: * ResultSet doesn?t necessarily have all the data; reconnection to database occurs as you ask for later rows. * This class stores results as strings, in arrays. * This class includes DatabaseMetaData\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27060"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27060\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27060"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}